Missile Explosions and Hull Damage Detection
-
Collision groups are the reason that the problem is arising for me. I am creating a massive FX pack that is based on damage-per-section and it all works out great except if their is a problem with the missile/torpedo splash damage carrying over to mutiple collision groups and giving bonus damage. (up to 8 times as much in some places)
-
This is indeed a very annoying problem that we’ve been struggling with in Flak for quite some time. So far, I’ve simply tried to find a balance in a sufficiently high explosion radius that does not sacrifice fighter balance in the process.
One thing that may be worth looking into, however, is moving the hull_damage and shield_damage entries on your missiles/torpedoes from [Explosion] to [Munition], without changing any other properties of the missile. I haven’t had time to extensively test this, but it seems to allow guided munitions to damage any part of any craft only once - however, it also sacrifices any splash damage, which can be a large balancing part of most ordinance (twin-torpedo Stealth Bombers would be crazy overpowered in Flak if they were able to bomb at close ranges without killing themselves). I’m not sure if it still takes detonation_dist into account (so if the missile is set to detonate16m from the target, I don’t know if it will still damage the target from that range or if it must physically hit the target), and of course at the end of the day it’s still a sloppy workaround.
I think M0tah was originally intending to look at a Hook-side solution for this, but I’m not sure what his progress was - he’s been busy as of late and hasn’t had time for FLHook work. Adoxa, you said ordinance still returned a specific damage type (16) even though it didn’t always damage the craft?
-
Maybe instead of moving both shield and hull damage just move the hull damage to the [Munition] entries (Since Shield damage still works). Or leave the [damage] entry and balance the damage out between the munition and damage (So you have the splash damage and not an overly damaging weapon).
-
Decided to investigate the issue; here’s what I found.
0x0C->0x00 in server.dll, 0x960C = fixes explosion damage at full strength ```This should fix the issue (it has in my testing so far). Explanation FL hardcodes three different multipliers of damage for explosions - 1, 2/3, 1/3, and 0, depending on how far away from the center of the object the explosion is. As far as I can tell, this is computed using the following mapping: Distance^2 -> Strength <= (Explosion radius)^2 * 0.1111… -> 1 <= (Explosion radius)^2 * 0.4444... -> 2/3 <= (Explosion radius)^2 -> 1/3 > (Explosion radius)^2 -> 0 So when the hit is farther than the explosion's radius away from the root of the ship, no damage is dealt. The above hack fixes the multiplier at 1 regardless of the distance.
-
Absolutely amazing M0tah
-
Holy shit…that’s amazing!!
I’ll use this tomorrow when I start working on FW:ToW.
Nice find, M0tah!
-
In single player, this hack will generate additional damage. For example, I changed the Javelin to do 10 damage and Flint to a Rheinland battleship (rm_r_battleship). Firing a missile into the center hits two groups (Rh_main_lod1/DpMain & Rh_midfrnt_lod1/DpMidFrnt) for 20 damage. Applying the patch then does 30 damage - the two groups plus presumably the ship as a whole.
The damage is actually found a little further down, in the function at 0x(6ce)9690. In SP, GetRadius returns a valid value, but in MP it is returning 0. I think the real problem is with something used by GetBoundingSphere. That’s as far as I went, back to you, M0tah…
-
It worked beautifully for me. I’m so thrilled Thanks so much, M0tah!
-
It won’t be a problem for any model without subcomponents.
-
adoxa wrote:
In single player, this hack will generate additional damage. For example, I changed the Javelin to do 10 damage and Flint to a Rheinland battleship (rm_r_battleship). Firing a missile into the center hits two groups (Rh_main_lod1/DpMain & Rh_midfrnt_lod1/DpMidFrnt) for 20 damage. Applying the patch then does 30 damage - the two groups plus presumably the ship as a whole.The damage is actually found a little further down, in the function at 0x(6ce)9690. In SP, GetRadius returns a valid value, but in MP it is returning 0. I think the real problem is with something used by GetBoundingSphere. That’s as far as I went, back to you, M0tah…
Did some more testing, and I couldn’t get CArchGroup::GetRadius to be called at all, in either MP or SP (though 0x9690 is). You are referring to that call in 0x9690, correct?
-
It seems that part of the function is only called if the object has collision groups (restoring the original Flint still broke; commenting the [CollisionGroup] entries failed to break). Even so, these particular collision groups are different to the battleship ones, generating a radius of 0 (it skips the bounding sphere altogether).