In this Tech post we will talk a bit about new features in Gemini wars.
Physx real time explosions and simulation of exploding structures in space.
What’s a space game without nice explosions? All big ships have awesome explosions, who doesn’t remember star wars or stargate ships blowing up? If we pay close attention to movies, it usually starts with a chain reaction of small explosions around the ship, and then a huge final explosion as the ship is vaporized.
Well, we want the same in Gemini. And we worked quite a bit at it, making a big ship explode in a cool and epic way is not easy.
We want the explosions of space stations and massive ships to be gradual, we want the player in panic and pain witnessing his precious ship being pulverized, or ecstatic at the massive destruction that he’s delivering his opponent. We really believe this is a must for gameplay.
So to achieve this, a ship exploding has two stages:
First, when a ship “dies”, several explosions are set off in key parts of the ship, like a chain of explosions.
Then, just before the final explosion the ship is broken into massive fragments.
The original idea we had was to “break” the ship in a modeling program, let’s say in 50 different pieces, attach to them a rigid body, and when the ship is about to explode, just hide the rendered ship and exchange it with these pieces. Then a force would be applied into these pieces and we would let the physics engine calculate the pieces flying away.
Technically it could be done. But it would be a nightmare for a large amount of ships and structures. The player would need a super computer to calculate forces, rigid bodies, etc. In other words, it wouldn’t be a very good solution for slower machines, so, we came up with another solution, much faster than this one.
What we do is still break the ship into pieces and make it explode, still using rigid bodies and forces that PhysX calculate, but all is pre computed into a 3d animation file. So the 3d simulation of breaking parts flying around is no longer using the CPU to calculate all of this in real time, instead we just play back an animation of what PhysX did.
So now when a ship explodes, we change the ship object by a low poly version of a ship animation exploding into pieces. The result is pure awesomeness ? and an extremely fast effect.
To make it look better, we unblend an alpha factor on the ship pieces in time, so that when the pieces are moving away they fade out nicely while moving.
We made a small video showing USF Battleships exploding:
We hope it looks as good to you guys as it looks to us.
Until next time, in Gemini Sector.