Animated Fireball and Camera
Evan Ovadia

Background

I've always been fascinated by Roguelike games, such as Nethack and Rogue, and especially ADOM. The lack of character and enemy graphics lets the developer focus on gameplay and depth, and lets the user use his imagination in a way that realistic games just can't achieve. Through the years I've done my share of roguelike projects, though nothing came to completion for various reasons.

I also love cool effects like lightning spells and fireballs, such as in Warcraft 3. So during this class, my love for graphics and my love for the lack of graphics had an illegitimate child, and thus was born my 3D animated roguelike game.

What I Did

I created a slashing animation, and a fireball animation. The fireball animation involves the hero (the '@') leaning back to take in a breath, shaking, leaning forward and shaking some more to make it seem like he was blowing out fire. The camera does very nice cinematic-style angles during the casting of the fireball. The fireball itself was a mass of triangles with random rotations, angles, and speeds flying out from the hero, and a sphere of fire slowly approaching the target.

Even though the fireball animation was really cool, it only took 5-10% of my time on the project. All of my time was spent making my custom animation engine. Take a look at this code, it defined the motion of the hero while he was casting the fireball:

  objectTransform =
    new StepFunction(
      new Rotator(.3, yAxis, new PolyDeceleratorf(0, -20, 4)), // Lean back till .3
        new Composition(
        new StepFunction(
          new Rotator(1.2, yAxis, new Constantf(-20)), // Stay leaned back till 1.5
            new Rotator(.2, yAxis, new Linearf(-20, 20)), // Lean forward till 1.7
              new Rotator(2.8, yAxis, new Constantf(20)), // Stay leaned forward till 4.5
                new Rotator(.5, yAxis, new Linearf(20, 0)),
                  NULL),
        new Rotator(4.2, yAxis, new Sinef(.01, 40)), // Start shaking at .3, until 4.5
        NULL),
          NULL);

As you can see, all I have to do is worry about the raw math behind the movement, and all of the animation and interpolation is handled for me. Most of my time on this projct was spent making my animation engine as elegant as possible.

I know animation engines are already out there, but I have a philosophy on reinventing the wheel. If I don't know how to do something but I have a fuzzy idea on how to do it, I will make my own system before going out and using someone else's. There's a very slight chance that the ideas I come up with on my own will actually be better than theirs, and I wouldn't have been able to come up with those ideas if my creativity had been tainted with theirs. So I designed my animation engine, and in the coming weeks I'll be learning about animation engines that are already out there, to see how mine compares with theirs.

If I had more time, I would have used transparency with the triangles (I'd make them slowly fade out instead of disappear), and I would have made the sphere semi-transparent and textured to look more like a fireball. I also might have added another slash animation, where the hero jumps up and thrusts his sword into the ground, with a little lightning coming out of it.