I'm a software engineer who works on game development part time. I teach game development (on gamedev.stackexchange.com and lynda.com). I'm always working on something, and I'll post updates here. Let me know if there's a game development topic you want to know more about, I probably know the answer, or at least where to get one.

Monday, November 26, 2012

The latest changes

Animation System - After getting animation working, I needed to implement a system for displaying animations. That's now in place. The animation system simply uses an event system to pass messages for animation changes. The animations have a few parameters defined, like delayed start amount, maximum play time and whether they should loop or not. It also includes an idle animation pool for each model. When defining animations in the data file I can add "IDLE_ANIMATION" to the name and it will be added to the idle pool. Additionally I define a weighted chance value for that animation. Then, when a entity is idle, it will choose randomly from the idle pool, the animations with a higher weighted chance will be chosen more often. These animation pools can be used for other animation types too! So any animation can have a animation pool. This makes it possible to have multiple animations per action. This way, things don't look so robotic, allowing for subtle changes for the same action. Animation really brings the game to life. It makes the goblins walking around and performing tasks look so much better. I'll show it off in the next video. Along with a few animations (so far I have walking, mining, picking up and dropping. Plus five idle animations).

Thursday, November 1, 2012

Implementing animation was like pulling my own teeth

These are the latest things to be checked off my to-do list:

  • Model Animation - This one took a while and had me pulling my hair out. Most of this went quickly and easily. Turning each bone's translation, rotation and scale into a transform matrix for the bone's vertices took a while. I just kept running into problems. I'd just look at the mangled mess of triangles that was a goblin just a moment ago before I applied the animation. Was my order of operations wrong? It's so close now, but the rotations are backwards. It's nearly working now but the rotations are around where it was before it translated. This is all wrong, redo. Redo, redo, redo. Finally, a clean working implementation. In the end it was just a collection of small issues that had to be solved in the correct order. But that's no matter now, it's working. Now that it's out of the way, it opens up some other tasks on the to-do list:
    • Creating animations: Yes, I need to get all artsy and make animations for my models.
    • Animation system: Creating a system that decides which animation to apply and when. I have the framework for this already in place from implementing the model animation, I just need to flesh it out.