Source Code Project Mantis - FSSCP
View Issue Details
0001638FSSCP---------public2008-03-23 17:342008-03-31 13:08
ReporterFUBAR-BDHR 
Assigned Totaylor 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.6.9 
Target VersionFixed in Version3.6.10 
Summary0001638: Special explosions not working correctly with shockwaves
DescriptionSpecial explosions in regular FS2 seem to work just fine. In TBP however the damage does not work correctly if shockwave is enabled. Only ships between the inner and outer damage radius seem to take damage. Ship closest to the blast don't take any damage or minimal damage.
Additional InformationDidn't know what to report this under since it works in FS2 and I haven't tried it in BTRL. Happens in both the latest 3.6.9 build of TBP and Kara's 3.6.10 recent build. First file is from FS2. Second from TBP.
TagsNo tags attached.
Attached Files? blasttest.fs2 (7,505) 2008-03-23 17:34
http://scp.indiegames.us/mantis/file_download.php?file_id=1000&type=bug
? blasttest2.fs2 (9,251) 2008-03-23 17:36
http://scp.indiegames.us/mantis/file_download.php?file_id=1001&type=bug
log fs2_open.log (83,481) 2008-03-27 22:21
http://scp.indiegames.us/mantis/file_download.php?file_id=1003&type=bug
diff damage_fix.diff (2,682) 2008-03-29 10:44
http://scp.indiegames.us/mantis/file_download.php?file_id=1004&type=bug

Notes
(0009023)
FUBAR-BDHR   
2008-03-23 17:49   
I also notice that with the shockwave turned off the explosion is invisible. Don't know if that is by design or not.
(0009041)
karajorma   
2008-03-27 21:57   
Hmmmm. I get a

Warning: Null vec3d in vec3d normalize.
Trace out of vecmat.cpp and find offending code.

when running both missions. Beyond that I think this is well beyond my expertise as vecmat.cpp give me palpitations.
(0009042)
FUBAR-BDHR   
2008-03-27 22:21   
(Last edited: 2008-03-27 22:22)
Yea I get the same thing when I run in debug mode. Attaching log from the is-player build. Wonder if the same thing happens in BTRL or if it's just TBP. I don't have BTRL installed or I'd give it a try.

(0009046)
FUBAR-BDHR   
2008-03-28 01:40   
(Last edited: 2008-03-28 01:41)
I knew that error message sounded familiar. http://scp.indiegames.us/mantis/view.php?id=1090

(0009054)
taylor   
2008-03-29 10:33   
Not sure if anyone was actually working seriously on this or not, but after about 2 hours of trying to track it down I finally figured it out. The heart of the problem is the "carry no damage" flag on subsystems and a bug that messes up how it's handled.

When "carry no damage" is used it will subtract the damage used against that subsystem from what the rest of the ship gets. Unfortunately the check that got added to return the eventual damage level turned out to only check the first subsystem for the "carry no damage" flag and then assumes that none of the other subsystems carry damage either. In cases where a ship has a mix of subsystems that have that flag it will obviously screw up the damage count and can easily apply far too little damage to the ship in the end (particularly in this case with EF1 and the "rotatea" subsystem which doesn't have the flag but accounts for about 50% of the hull).

This can be fixed by handling that stuff properly, but I'm a little worried about what might break in the process. Technically it's a pretty bad bug though so we'll have to do something about it one way or the other.
(0009055)
taylor   
2008-03-29 10:44   
And here is the patch that I'm testing with now. It's got an ai_lethality fix in there too however.
(0009106)
FUBAR-BDHR   
2008-03-31 05:24   
Tested the 3.6.9 build with this fix included that Kara made for TBP and it looks like it's working just fine.
(0009112)
taylor   
2008-03-31 13:05   
Good to hear. I'm going to go ahead and commit, but with a slight change from the attached diff. I was previously reducing the damage total after the armor reduction call, but that doesn't account for the total damage that was applied to that subsystem. So going by WMC's comment right above that I moved the block just above the armor call so that we get the proper amount of damage removed from the total.

I'm not sure what sort of affect that would have on your tests, but it should be negligible, at most. Maybe karajorma's next build will have the modification and then you can give it another test just to be 100% sure.
(0009113)
taylor   
2008-03-31 13:08   
Fixered.

Issue History
2008-03-23 17:34FUBAR-BDHRNew Issue
2008-03-23 17:34FUBAR-BDHRFile Added: blasttest.fs2
2008-03-23 17:36FUBAR-BDHRFile Added: blasttest2.fs2
2008-03-23 17:49FUBAR-BDHRNote Added: 0009023
2008-03-27 21:57karajormaNote Added: 0009041
2008-03-27 22:21FUBAR-BDHRFile Added: fs2_open.log
2008-03-27 22:21FUBAR-BDHRNote Added: 0009042
2008-03-27 22:22FUBAR-BDHRNote Edited: 0009042
2008-03-28 01:40FUBAR-BDHRNote Added: 0009046
2008-03-28 01:41FUBAR-BDHRNote Edited: 0009046
2008-03-29 10:33taylorNote Added: 0009054
2008-03-29 10:44taylorFile Added: damage_fix.diff
2008-03-29 10:44taylorNote Added: 0009055
2008-03-31 04:58taylorStatusnew => assigned
2008-03-31 04:58taylorAssigned To => taylor
2008-03-31 05:24FUBAR-BDHRNote Added: 0009106
2008-03-31 13:05taylorNote Added: 0009112
2008-03-31 13:08taylorStatusassigned => resolved
2008-03-31 13:08taylorFixed in Version => 3.6.10
2008-03-31 13:08taylorResolutionopen => fixed
2008-03-31 13:08taylorNote Added: 0009113