Source Code Project Mantis - FSSCP
View Issue Details
0002673FSSCPmath-relatedpublic2012-06-27 01:032012-07-01 21:45
Assigned ToValathil 
PlatformOSOS Version
Product Version 
Target Version3.6.14Fixed in Version 
Summary0002673: Weapon Velocity < Target Object Max Speed Collsion Culling
DescriptionWhen the weapon being fired is slower than the ship's max velocity that the collision pair is being tested on, the collision pair is culled.
Steps To Reproduce1. Make or modify a weapon with a very slow velocity (ie something < 60 m/s)
2. Have a ship with a fairly fast speed (ie GTF Perseus or GTF Pegasus)
3. Have something fire this new weapon.
4. Sit still and watch as it passes right through the fighter. Move around a bit, even right into it and it'll just go right through.
Attached Filespatch objcollide.cpp.patch (1,313) 2012-06-28 23:47
patch objcollide.cpp.goober.patch (1,996) 2012-06-29 01:54

2012-06-27 01:30   
This should go in 3.6.14 once reviewed and confirmed.
2012-06-27 01:37   
I've posted a patch that should fix the issue. Explanation: The algorithm for pruning breaks down if the weapon is slower than the ship its targeting. I've added a check for that and generate a new timestamp assuming the ship and the weapon are flying head on at max speed at each other. If the projectile is inside the radius of the target check every frame. I can't prune out the pair cause even though the weapon might have missed, the ship could still catch up with it later cause it's faster!
2012-06-28 23:48   
Ok new version of the patch. I've added a case where if the ship and the weapon can never interact because of the limited weapon lifetime the pair gets culled.
2012-06-29 01:54   
I've uploaded a new patch that uses Volition's existing formula and just handles the opposite cases.
2012-06-30 19:31   
Fix committed to trunk@8917.
2012-07-01 21:45   
Fix committed to fs2_open_3_6_14@8966.

Issue History
2012-06-27 01:03AndrewofDoomNew Issue
2012-06-27 01:05AndrewofDoomTag Attached: physics
2012-06-27 01:30Goober5000Note Added: 0013728
2012-06-27 01:30Goober5000Assigned To => Valathil
2012-06-27 01:30Goober5000Statusnew => code review
2012-06-27 01:30Goober5000Target Version => 3.6.14
2012-06-27 01:32ValathilStatuscode review => assigned
2012-06-27 01:33ValathilFile Added: objcollide.cpp.patch
2012-06-27 01:37ValathilNote Added: 0013730
2012-06-27 01:38ValathilStatusassigned => code review
2012-06-27 04:03ValathilFile Deleted: objcollide.cpp.patch
2012-06-27 04:03ValathilFile Added: objcollide.cpp.patch
2012-06-28 23:40ValathilFile Deleted: objcollide.cpp.patch
2012-06-28 23:47ValathilFile Added: objcollide.cpp.patch
2012-06-28 23:48ValathilNote Added: 0013735
2012-06-29 01:54Goober5000File Added: objcollide.cpp.goober.patch
2012-06-29 01:54Goober5000Note Added: 0013736
2012-06-30 19:31Goober5000Changeset attached => fs2open trunk r8917
2012-06-30 19:31Goober5000Note Added: 0013738
2012-06-30 19:31Goober5000Statuscode review => resolved
2012-06-30 19:31Goober5000Resolutionopen => fixed
2012-07-01 21:45ZacamChangeset attached => fs2open fs2_open_3_6_14 r8966
2012-07-01 21:45ZacamNote Added: 0013775