Game Development

Blog 609: The Anatomy of a Character

Owing to my background in modding strategy games, I call them Units, but they’re already so much more than that. They’re more complicated in some ways than what I worked with throughout ten long years of modding Warcraft III, while in others, they are only a mess of undeveloped potential. Do you think they are deep enough to call them Characters instead? Hmm.

However we choose to call them, they are the most important parts of No Excuses — without them, there is nothing but a static scene, for even the player is in command of a Unit like any other. Maybe gameplay will demand that it has more or less capabilities than those around it, but it’s still “just” a Unit.

The Anatomy of a Character

It begins with an invisible, animated skeleton. I’ve completely decoupled the meshes from the motions, like I always wanted to do. Now, though, I’ve taken it a step further — I’ve also decoupled every part of the mesh. (Well, I managed it in WC3 with the Dress Your Own Golem framework, but it had its own flaws and was never a fundamental part of the engine.)

The Delta, my sweet baseline, is a pair of legs. The complete Delta contains something I can only think of calling a “sub-unit” — its turret. The turret isn’t part of the main skeleton because it can rotate independently, programmatically, to follow a different target. (I’m sure you can do this sort of thing to a solid skeleton but I don’t know how and this method suits me just fine.)

The turret isn’t much. It’s an unanimated skeleton, still invisible, but mechanically it’s only an unsightly clump of attachment points. No, turrets will get much more exciting when the likes of the AP-AM start to emerge, with their melee-attacking arms and mortars.

He's got a bone to pick with you.
He’s got a bone to pick with you.

The unit doesn’t start to look like much until the actual meshes are draped on it like so many pairs of curtains. A left thigh there, a right thigh there, calves, ankles, feet…

The important thing to note here is that the chunks are defined by handy template files. I can throw a unit together from any selection of pieces that I want, even define random selections — plus their camouflage paint-jobs. A parenting system means that making a new unit that deviates in only a minor way is an extra two-line template; for example, the alternative cabins of the demo videos so far, which only replace the parent’s Cabin attachment.

Okay, so the major players, the company mechs, will be fairly visually consistent. But throw in mercenaries with cobbled-together vehicles, mixtures of damaged, repaired, replaced, non-standard, painted and unpainted parts…

Kind of loses its effect without the shields.
Kind of loses its effect without the shields.

There is, of course, more to life than inert chunks of decoration. Once the main parts of the mesh are in place, it’s time to add the equipment.

It’s okay to attach any old chunk of decoration to any old bone, because these pieces are only there to look pretty. It’s not okay to attach items anywhere you like, because items have to be dealt with in special ways — the primary weapons, for example, have to be noted and activated when the player presses the “Attack” button. Maybe the Shields have to be queried for damage reduction, the undercarriage slot for activating ability 4…

No, that's not my collision being broken, that's the shell flying so fast it was already beyond the unit and he's walking through its trail. Totes.
No, that’s not my collision being broken, that’s the shell flying so fast it was already beyond the unit and he’s walking through its trail. Totes.

Items are also special because they can exist independently of other actors. The chunks can’t — when the unit dies, its chunks are truly destroyed and replaced with generic wrecked versions, possibly spawning an explosion in the process. Items however, have to fall off, ready for somebody else to pick them up.

I made life much more difficult for myself by having symmetrical units. The Delta has two cannons, about two metres apart to scale, and that’s why I’ve had to expend so much effort on targeting — and item acquisition. When you pick up an item, you have to automatically acquire its mirror, if it has one. That’s it for the pairs of weapons, because the weapons are identical regardless of which side they appear on — but the shields are not. The shields curve inwards, are attached off-centre; they are true reflections.

Mirrored items, then, means mirrored equipment slots too. I’m sure basing all this on magic string bone names will come back to haunt me later, but it’s not like I can automate Milkshape… At least, not without writing my own plugins.

I guess, at this point, my framework is stable enough that I can start adding other units. At least, other units that only have guns and shields — I think the frightening suite of capabilities that powers the AP-AM is still a little way off, behind the likes of ammunition, slightly inaccurate projectiles, impact force pushing and AI behaviour development.

All in good time!

And you tell me...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.