Occasionally, the missile simply fizzles harmlessly on impact to target. Player sees the root missile's hitEffect, but the fragments fail to execute and the target takes no damage even if the root missile has damage defined.
This can occur even missile does not have a failsafe defined. If failsafe was defined, this bug can occur after failsafe has clearly expired.
Are you by any chance talking about area or radius fragments? Because there's a recent change such that if the missile is inside an object when it goes off, it only has a 50% chance to spawn each fragment. I suspect this is (inappropriately) getting applied in cases where there's only one fragment of a given type.
All fragments. Any missile with <Fragment>. The missile does not need to be inside an object for this bug to occur. I have seen such missiles travel a bit and score a direct hit on a target, but the missile does not explode and does no damage at all.
I took a look at a lot of missile code. I didn't find the problem (although I did find an unrelated bug with tracking missiles). Since I don't think I've seen this myself, maybe we can narrow it down:
- Does it happen with vanilla weapons, or only modded?
- Do they have events that occur on fragmentation? (This replaces the normal behavior.)
- Is is more common with slow missiles, such as MAGs, and/or fast targets? (This makes it more likely that the explosion position will be inside the target.)
- Does it happen with proximity detonation (passing the target), or only on collision?
-Happens with any fragmentation weapon.
-Confirmed with those without events, but I think those with events are affected too.
-Does not seem to matter.
-Fragmentation always denotates a short distance away, unless shot on top of target (e.g., nukes over middle of Starton Eridani).
- Does it happen with proximity detonation (passing the target), or only on collision?
-Fragmentation always denotates a short distance away, unless shot on top of target (e.g., nukes over middle of Starton Eridani).
That's not exactly true, as I explained in my hit detection suggestion. What I meant was, do fragmenting missiles sometimes just disappear or explode without creating fragments in open space as they pass a target, before their lifetime runs out? Or do they only fail to fragment if they appear to collide with or get created on top of an object?
The missile stops when it should fragment (like in 1.6.x), but fragments may not be created when they should, and when they do not, the missile creates a hit effect then disappears much like any other weapon/missile type with no fragments defined.
I'm still not clear on whether the bug can occur if the missile would hit the target if it weren't a fragmenting missile, if the missile would miss the target if it weren't fragmenting, or both. Because the code works differently in these two cases.
Also, what weapons have you observed this with, and could you estimate what fraction of shots are affected?
Both. Missiles stop when they should. They simply fail to fragment and fizzle harmlessly. I tried a wide enough variety to be convinced that it affects all of them. Fragment failure is sporadic, and does not happen very often... maybe less than a third? If you want to see for yourself, try XM900 Lucifers, or anything else that fragments.
Well, I can reproduce this when firing a Lucifer missile on top of a target, as I expected, but not in any other situation so far.
Need to investigate.
As NMS says, I think this is related to the code that discards 50% of fragments when we detonate inside a target.
There are two possible problems:
- For weapons with a single fragment, there is a 50% chance of no detonation. I've fixed this so that we always get at least a single fragment.
- For weapons with a low number of fragments (e.g., 3) there is a chance that we will get 0 fragments if we roll <50% for each one. I've fixed it so that we always get exactly 50% of fragments.