As Alex mentioned before, we’re putting a lot of work into the explosions and death sequences for Star Villains and Space Heroes. I am reasonably happy with the explosions that I had made for the demo. However, there’s always room to improve! In this post, I’ll talk about how we go from the intact mesh to the destroyed mesh that Alex showed you in the previous devlog.
Once I get a bunch of ship chunks from Alex, I proceed to have a look at it to see how it should explode. He’ll generally split the model into 3-6 pieces to work with, so it’s my job to disguise the transition to the new model with fire and smoke. I’ll mentally label the model, looking for good places to put explosions. I create empty nodes at these points - the importer will do the work assuming I name them correctly. For the Kilo mesh he created in the last post, I did something like this:
The system that I’ve created for animating destruction allows for easy variation in explosions. I create a bunch of various blasts as prefabs in Unity, and divide them by class. We use small, medium and “main” types. For each faction I create a large library of explosions. Currently EMPOL ships have about 10 choices for medium explosions and 15 for small explosions. We can choose which ships use which choices from this library, and our importer will correctly associate the explosions with the ship.
This is useful, as for example I have one that specifically looks like a missile magazine cooking off - I’d use this one uniquely for missile-heavy ships like the Vegas class. Explosions are randomly placed at the selected points on the ship, which ensures the death of any ship will never be quite the same. Here’s a shot of the medium explosions going off on the Kilo.
Each small or medium explosion is based primarily on a Shuriken particle component. Optionally, I can add camera shake effects, secondary particle systems, light flares and of course, sounds to each system. Thanks to a custom framework I developed, the beta version of SVSH allows particle effects to be degraded based on a new user setting for Particle Effects. This means that I can go nuts with smoke, fireballs and sparks and not penalize users with lower-end systems. We also now use a custom level of detail system to cull explosions based on distance, so the small explosions won’t render when you can’t see them. Once the medium explosions go off, the main explosions takes over…
Of course, after the explosion sequence is done, I can finally make use of Alex’s ship bits. I work out physics properties for the pieces based on how much of the ship’s volume they take up. I also create some specific particle systems for glows, fires and sparks and attach them to the pieces. The wreckage is then created at a specific point in the explosion sequence and blasted outward. New from the demo, adjustable graphics settings controlling the lifetime of wreckage. Now, if you really want to, wreckage can last practically forever.
With this workflow, we can make explosions and debris that look pretty damn cool, particularly when a dozen ships have just blown up and there’s debris scattered all over the battlefield. That’s all for now!