A caution, and a feature!
If you have a plug and have been including missiles that have represented multiple stages using submunitions, (launch, guiding, terminal)
Take care when also using a proximity trigger and a blast radius.
Depending of the size of the prox and the closure rate, you can accidently create situations that lead to your missile doing vastly more ammounts of damage than intended.
The reason for this is that a "hit" scored by the prox trigger will still allow subs to function, unlike a hit scored by an actual impact.
Let's say you have a missile with 3 stages, launch, guidance, and terminal.
Say we wanted these stages to represent different flight characterstics of the same missile. But this missile was also supposed to detonate if it got close to the target, say 50 pixels with a blast radius of 60 pixels, and these characterstics are applied to every stage.
This example missile will do 200 damage and also have a speed of 1000 (or 10 pixels per frame)
In this example, say the missile was launched, but found its target before it even got into its second stage.
So what happens is this...
During the first stage the missile got to within 50 pixels of the target. The prox trigger went off and did 200 damage to the target.
Now because the missile didn't physicaly hit the target's sprite, the missile will still sub into stage two.
The next frame, the stage two missile travels 10 pixels closer. Now the missle is within 40 pixels of the target so the prox trigger goes off again and deals another 200 damage to the target.
Since the missile still has not yet physicaly entered the target sprite, it subs into stage 3.
One frame later the third stage travels to within 30 pixels, prox triggers, and another 200 damage is dealt.
At this point, it doesn't matter if the missile has physicaly hit the target yet, because there are no more submunitions, and this missile instance will finally end.
Obviously this is a big problem if your 200 damage missile ends up dealing 600 points of damage.
One more wrench for the works. Let's now say the target was also moving towards the missile at 2000, for a combined closure rate of 3000 (or 30 pixels per frame). Let's also say that 1 frame before prox is triggered the missile happened to be 60 pixels away, so:
frame 0 - range 60: Nothing yet happens, missile continues inbound to target.
frame 1 - range 30: prox triggers, 200 damage dealt, subs to stage two.
frame 2 - range 0: target impacted, 200 damage dealt, subs do not function because of physical contact, missile instance ends.
In this case 400, not 600, damage was dealt to the target.
Ok, now some options to handle this:
- Not use the prox trigger.
- Only use the prox trigger on the last stage.
- Split up the total potential damage amongst the stages. This will make the missile do less damage the later in it's life it happens to hit the target, but would likely need some explanation scenario-wise.
For exmple, an energey based missile that losses intensity the longer it remains in space.
Stage 1 - 85 Damage, Stage 2 - 65 Damage, Stage 3 - 50 Damage
So if the target is struck during stage 1, all 200 points would be dealt over 3 frames. If the target was struck during stage 3, only 50 points of damage are dealt.
Then, you could either talor your prox radius and speeds to ensure that a too great of a closure rate would be very unlikely, or explain why a fast closure rate may result in less damage.