Dev Diary The Animation System (Matt "AdeptStrain" Boudreaux)
Hey all, Matt "AdeptStrain" Boudreaux here. I'm one of the programmers for Star Wars Galaxies. This dev diary covers our animation system that we use to create and play all those great moves you see in game.
Before I was a developer for SWG, I was a player. I remember when I first created my character -- a professional campfire-making Wookiee if you were curious -- how great the animations looked. Every gesture, every attack animation, and every dance looked incredibly life-like and natural, despite being applied to an 8 foot walking ball of hair, so it was quite a treat when I was hired by SOE to get more acquainted with the animation system and learn how it works.
The animation system in SWG is based on skeletal animation. This means the artists set up a series of bones, create animations using those bones (using motion capture or crafting them by hand), and those bones then affect the various character meshes they are actually assigned to.
This is what we all look like inside. Gross, huh?
Once the artists have created the various bone animations, we need a way to assign those assets to objects in our world. This is where our designers come in. Our designers actually have a great toolset to decide which animation should be played, depending on the type of weapon the player is using, the skill they are using, and many other factors. This means that if I use a skill with a sword and then do the same skill with a blaster, I get two completely different animations. This allows for a greater variety in the world and makes things more interesting for the player even if you are the same species and profession as another player, as long as your weapon is different, you will have your own set of animations. Neat, huh?
Skill
Animation_Pistol
Animation_Lightsaber
Animation_Polearm
Assassinate
Fire_1_hit
4_hit_combo
2_hit_combo
Sure Shot
Fire_2_hit
2_hit_combo
2_hit_combo_b_med
So, after our art assets have been created, and our designers have created the necessary animation tables, it becomes the programmer's responsibility to load those resources and play them correctly. Every time the player takes an action, we check the table created by the designers, find the appropriate animation we are supposed to used based on the player's current state, and then load and play that animation. Our system actually blends between various animations and we typically have somewhere between 2 7 animations being blended together on a player at any single time. Even when you are idle, we are playing an animation (your idle animation go figure).
Every object that animates has a skeleton.
Animation is one of those few systems that actually involves all departments of game development; art, design, and programming. We all have a part in the system and it takes a monumental effort to have that pipeline as efficient as SWG has it.
Animation arguably has one of the largest impacts on the look and feel of the game, and it's been a very interesting and rewarding experience to work on this system the last few weeks. I look forward to continuing to improve on this system and I hope you, the players, enjoy our collective efforts.
Matt "AdeptStrain" Boudreaux Programmer, Star Wars Galaxies