Sunday, June 24, 2012

How to design a massive boss battle

Initially I wanted to get ready an introduction scene and a boss battle. Shortly after I realized the timeframe wouldn't allow me to do both. I had to choose. So which one would more badass and entertain more? I went for the boss. And I'm glad I did.

In case you have no idea what I'm walking about, you can watch the video here. Or download the game demo from here.

Creating the boss battle

I had an idea of a giant enemy. Something BIG(*). something that would cause impact in many senses. This boss presented a lot of challenges:
  1. Physics representation was enormous (Sphere radius was of roughly 80m). Havok isn't prepared for something that big unless it's static. And you were supposed to to hop on it while it's moving?
  2. A lot of animation data was in this boss. Therefore the physics need to interact accordingly.
  3. Not only is it big, but some movements are fast. Due to it's size, some velocities reached the order of 1.000 m/s. Again, Havok isn't used to such operating conditions.
  4. Even with continuous physics enabled, using mesh shapes resulted in lots of bullet-through paper glitches. Too often the player would end up stuck inside Turtarian's shell.
  5. The engine's code needed to be improved too. How the camera handles tracking of such a large object, the allies & foes' AI was going nuts with him, a custom AI had to be made to script the boss battle, the lock-on system was buggy, etc. Placing this object in scene revealed a lot of small bugs or limitations that needed fixing.
  6. All of this while the game is running internally @60 fps.

Standing on top while still running at 60 fps and no glitches wasn't easy.
Once it started to work, it seemed reminiscent of Shadow of the Colossus®, even though I've never played it. So, I started to watch more Youtube videos about SotC, God of War III®, and Castlevania: Lord of Shadows®, all of them featuring gigantic bosses.
I liked more the idea behind SotC & Castlevania: LoS, rather than God of War's. In the latter, giant boss battles were limited to “face the enemy straight and smash the attack button”; where in the former two, there was a more strategic and patient approach. What I really missed was to ditch the climbing elements present in SotC and Castlevania, which are very fun when the boss is moving. Originally, when I first starting coding the engine, I wasn't thinking of large scale-enemies. It was a happy coincidence that worked far more than I expected.

(*) Rule #1 of scale: if everything's big, nothing's big. Just because your 3D model software says it's huge, doesn't make it so. A giant must be in contrast in a place where almost everything is tiny, in

How the solution was approached

I tried several solutions before ending up with something I liked and worked:
  • A dummy object is used for character controller. Everything else (shell, head, claws, tail) is controlled setting Havok's motion types to Keyframed.
  • The main shell is a mesh shape, based from the same object that is rendered, but previously decimated.
Physics shell (left) vs Final version used to render (right)

Phantom inside the shell to prevent getting inside

  • Using the mesh shape caused lots of bullet-through paper. Since you're not supposed to be inside it; multiple phantom shapes had to be placed inside the shell, teleporting you out of it as soon as you get in contact with it. Due to time constraints, I was unable to refine their placement, therefore some players may still experience a few glitches for a few moments if they try hard to get inside.
  • The claws, tail, neck and head are all native shapes. Mostly capsules, and a few boxes & spheres. All of them are compund objects. Each compund object was attached to a bone. A blender script exported the shape's definitions, as well as the correct parameters to make a perfect alignment when attached to the bone.
Capsules boxes and spheres were used for the physics representation (left). They don't exhibit bullet through paper like the shell, because of they're native and closed method. On these objects, bullet through paper would only appear if a velocity is so big that between two frames, the character goes from one point to the other of the capsule. This isn't a problem when your objects are this big. Think of it as having native objects being filled, while Mesh objects instead being thin and hollow.
Blender supports Bullet physics. Since Bullet & Havok are ridiculously similar, the Logic pane was used to set the Physics shape information correctly, using parenting to define compound linkage.
I admit, Turtarian's boss battle experience may not be yet on par to SotC or Castlevania's, I'd love to be proven wrong by gamers, but I know there's a lot of room for improvement, and I can do it much better.
It was my first giant boss fight. And I learned a lot. Plus, now I have the tools development, and a stable code that can handle it.
As with all games, a lot of ideas were cut. Furthermore, the more I played with Turtarian, the more ideas kept popping out. Specially ideas on how to climb big bosses while using current mechanics. It's very common to think of using gameplay mechanics from other games, some of which are not even implemented or would be difficult to do. That's why it's very important to test, test, test.
New ideas will keep coming that will match your mechanics.
Other ideas included additional environment models where you could climb to hop easier to Turtarian. Even interacting with the city walls was very interesting, because they were more or less the same height.
Even more ideas kept coming after I tried Turtarian in the final terrain, which has uneven heights. For a long time, I only tested the boss battle in a flat terrain. Getting your character on elevated ground gives you an advantage, while being in great disadvantage if you stayed on lower grounds. Furthermore difficulty suddenly increased when the tail (which at some point becomes a weakpoint you need to hit) was burried underground because of a sand hill, therefore you first needed to attract Turtarian by running off that place.

Thanks for reading!
Matias /signing off

1 comment:

  1. That looks awesome, and Turtarian is BIG indeed! Kudos...