Overview
Game:
G.I. Joe: The Rise of Cobra

Platform:
Nintendo DS

Developer:
Backbone Entertainment

Tools used:
Character and tank behaviors written in XML, level design elements and vehicle waypoints created in Maya

Time taken:
This battle took approximately 2 weeks to put together and several days to tune

Destro is the third boss in the game, but he was the second one I made during the development of G.I. Joe. I planned the battle, scripted the actors, wrote the dialog, and implemented the level scripting.
Due to the nature of how vehicles worked in this engine, this fight contained some of the most complex level scripts found in the game. I had to come up with a visual language for formatting the scripting nodes just to keep track of everything, this increased my productivity immensely for the rest of the project.
Battle mechanics
Destro is the vehicle boss. The fight begins on foot, primarily so that players can see who they are fighting, but after the intro round Destro teleports an advanced tank into the center of the level and hops inside. From here it becomes a multi-stage fight, where the tank progresses through 3 behaviors as it accumulates damage. For much of this fight the focus is on the player's ability to dodge, as many of Destro's weapons deal instant death.

     Intro stage
  • Approaches the player until within firing range
    • Attacks the player with a continuous burst of gunfire
  • When he takes damage past a certain threshold he kneels immobilized
    • He stands up and aims a wrist rocket at the player for a couple of seconds
      • If it hits, the rocket is instantly lethal
  • After 3 repetitions of this behavior, a tank appears in the center of the level and the actor moves towards it and disappears

     Tank stage 1
  • The tank rotates 180 degrees while firing a near continuous stream of gunfire
    • The beam of fire is instant death for the player
    • Dodging is the only way to cross the beam
  • After the first rotation the tank drives to the top of the map and continues a similar behavior
    • It travels left and right between 2 points
      • Firing the beam as it turns around between trips

     Tank stage 2
  • Destro's tank starts driving in a large circle around the edge of the level
    • Every 3 seconds he launches a homing missile that flies slowly towards the player
      • The missile launch rate increases as he takes damage

     Tank stage 3
  • The tank stops moving
  • Track the player with the main gun for 3 seconds
    • Stop aiming the gun and emit a charge up particle
      • As the particle ends, fire an instant kill shot
      • Repeat the aim state
All the "little" things
From showing Destro getting into his tank, to making certain that the player sees him escaping its burning wreckage, a lot of work had to go into the details of this battle. It all stems from the fact that this is the most heavily scripted moment in the game. Extra care was needed to make sure that these scripts remained flexible, even in the face of unpredictable players.

Waypoints
The tank's movement is entirely controlled by waypoints. Because I can't control when in the 1st tank stage the player will do enough damage to start the 2nd stage I have to be prepared to make the tank follow a clockwise or counterclockwise circular waypoint path.
  • If the tank was traveling towards the left at the end of the 1st stage
    • Follow the clockwise path during the 2nd stage
  • If the tank was traveling towards the right at the end of the 1st stage
    • Follow the counterclockwise path during the 2nd stage

Camera scripts
All scripted camera movement is governed by nodes that are placed in the level. Because it was likely that the tank would be offscreen as it was destroyed, I wanted to point a camera in its direction for its final moment. This meant that I needed to keep track of which node was nearest to the current position of the tank as it traveled around its waypoint paths.
  • When the tank enters a waypoint, the waypoint sends a signal
    • The repeater tied to its corresponding camera node hears the signal and activates
      • If the repeater hears the final camera signal it will activate the camera node
    • Another repeater sends signals to the repeaters tied to the 2 adjacent camera nodes shutting them off
      • This has to be done because the tank can be traveling in either direction

Seeing Destro
In an homage to the cartoon, Destro leaps clear of his ruined tank just before it explodes.
  • At death, while the camera is pointed at it, the tank spawns a Destro actor
    • Acting under the assumption that the player will be near the center of the level, the fleeing Destro faces and leaps towards the player
      • This is done because I have no way of knowing where the tank is at or what direction it is facing and I need to make certain that 1) the actor is seen and 2) that it doesn't hit any walls during its leap (which just looks bad)
Player start point Boss actors Waypoints Camera nodes