Missile Explosions and Hull Damage Detection
-
no, i was saying to do it in reverse. The problem is with the missiles, the guns work ok. If the hit detection could work like the gun bullets do (they dont need a radius to register damage), then all the rest of the stats could work like a missile.
in an unrelated question: does anyone know what that “strength = 100” in the explosion means?
-
Took a different approach, using the mission Rheinland battleship (MSN_d_r_battleship) as Flint (suprise_pi_freighter). In SP, with a radius of 0.001, hits were taken everywhere, except for the very front; restoring 16, even the front took hits. In MP, I see what you mean - it is very particular as to where it takes damage. I’ll have more of a play later, but don’t get your hopes up.
Strength isn’t used, ignore it (I’ll delete them with the next release of JFLP).
-
It would appear missiles deal damage only to the center of a group. If the model is multi-part, it will deal damage to each part whose center is within the radius of the explosion.
I wonder if there would be a way to change this so that it uses the same method as guns…
-
FriendlyFire wrote:
It would appear missiles deal damage only to the center of a group. If the model is multi-part, it will deal damage to each part whose center is within the radius of the explosion.I wonder if there would be a way to change this so that it uses the same method as guns…
Thats what i was saying…
Can you simply change it to “type = gun” somehow, but keep the motor, tracking, FX, etc?
-
No.
-
So, maybe make a model that is made of many small(so that the centre is easely accessible by explosion)collision_groups, give them the same hit_pts as the root(a very small .cmp for the root), proper fuses, root_health_proxy = true and here you go/
It will take a lot of time, but no visible changes will be seen after and it should work(at least for npcs, as they will fire only at the centre of the ship model), also will work for players with some limitations.
BTW, afair you can assign a fuse through collision group to the hole model.
Also the collision_groups may be superfacial only = less work + working variant. -
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).