Today I worked out how to make a better explosion graphic by abusing the hell out of the particle system. The trick is to use particle fragments as
graphics, but not as actual damaging elements. The reason for this is threefold:
1. Particles that the game generates (as opposed to missile-based particles) have horrendously buggy hit detection and will oftne pass right through a target. This is particularly common immediately after generation. This makes low-density particle weapons unsuited to general use in missiles.
2. Damage control. because of their...unusual properties and the way in which damage is calculate for this sort of weapon, particle-based explosions have both a heavy drop-off with range, and an exceptionally difficult balancing act. It's very easy to make a weapon that's absurdly overpowered or absurdly underpowered. In fact, it's possible to do
both with the same weapon. Shields are also unusually effective, but you get "phantom WMD" effects as well. In short, it's stupidly hard to balance these things.
3. The audio system. The game tries to mix the sounds ingame in real-time. This is fine under normal conditions, but it can only handle so many sounds at once. Where does this fall down? When you have an awful lot of hits at once. When you've got 700-1500 particles all hitting multiple ships at once (yay, buggy hit detection causing passthrough!), you have two problems. First, the game lags to a crawl as the sound system desperately looks for a way to end its torment. Secondly, your eardrums will collapse because the system gives up and throws everything at you.
The solution is simple: Remove all damage from the particles, and give them null hiteffects. The latter is redundant, but that's a good thing here. Simply giving a null hiteffect will not work: the shield hiteffect is hardcoded and can't be changed, and so you will get horrible lag and ear-murder when you hit a shielded target. Removing all damage means no hiteffects are generated in the first place, and the null code is just for good measure.
However you've still got to get some damage. The trick here is to use a fragmentation pattern, shockwave and/or radius fragment to do your damage, hidden under your particle effects. With care, you can get extremely complex graphical effects going without the use of a spritesheet.
I've been using this approach experimentally, and I'm close to having a working final weapon. I chose the Quantumsphere Disintegrator for an upgrade, because I though it could use one. It's now a
little more spectacular than it used to be.
Screenshot taken using a test-missile with identical setup, weapon is not currently balanced or finalised.And the blue is slightly the wrong color (I based the particles off the Ion9, so it's a bit deep. I'll fix that later). In this case, the small effects are purely decorative particles. On proximity or impact, the projectile spawns 175 small no-damage fragments, plus a small flare effect on each of them. It spawns 8 fragments that travel away from the detonation, with damage and disintegration effects. These are missile fragments, so they're a bit more reliable. However, because they're spawned outside of the central hitbox, they often won't hit a small target in the middle of the effect (although the centaur raider in these pictures has absorbed one of them). To hit that, plus anything else right next to it, there's a small radius fragment with a larger flare effect, finishing off the effect.
This is rather conservative: even with damage enabled I was able to get up to 300 particles working quite nicely on the very first test weapon. However, for this weapon I toned it down so it didn't overpower the graphics. But with hiteffects and broken sound code no longer an issue, I am planning to ramp up to much larger numbers (500-2500 particles) on the next set of test weapons. This weapon also only uses only one set of particles for graphical effects, and they're a pretty basic type and style. In theory, the only upper limit is what a computer can handle, and other styles of particle can be used to fake more complex effects. Since the graphics code is fairly well streamlined (it seems), this could result in exceptionally complex effects being possible. Although it'll never be as good as an exceptionally well made pre-rendered graphic made with something like Luminous, of course. Not that that stops anyone from combining the techniques, of course.