Animations and Swappable Parts

Hey Folks! We've finally finished moving from Canada to Seattle! Still plenty of unpacking and furniture-arranging to do, but the last of our stuff and pets is safely here with us. Yes! We've just started transferring our accounts, driver's licenses, and this is going to be a long process. So likely lots of errands to run in town. But at least no more 500-mile road trips for the foreseeable future!

Now that I'm back, I took stock of my current situation to see what needs attention next. I've finally got my characters walking around and interacting based on their data, which is good. But I think it's going to be necessary soon to improve the visual feedback of what's going on. And that means two things: UI and animations.

UI might actually be pretty simple. After cobbling together my data editor, I think I've got the hang of that. I've got some ideas for portraits, and I have plenty of NEO Scavenger encounter icons to use for activity icons. So a lot of work is already done (if only placeholder).

Animations, on the other hand, are virgin territory. At least in Unity. Fortunately, I was a tech artist at BioWare in a previous life, so I know at least a few things about rigging and animations :)

One of NEO Scavenger's cool features was to see what a character was wearing/holding from the sprite. I'd like to do this for ship crew, as well. To save myself the trouble of hand-animating a million different sprites for each combo of equipment/clothes, I'm working on a top-down, sprite rig that I hinted at in an earlier blog post:


Hybrid 2D/3D sprite rig.

The idea isn't too much different than any other game's 2D sprite. Just some GameObjects in a humanoid-style hierarchy with sprites attached to each. However, most games have all their sprites facing the camera, and I've decided to make some face perpendicular to the camera direction.

The thinking here is that the player will always see the tops of the head, shoulders, and feet in an animation, and things like the legs and arms only appear when they bend forward or backward in an animation. E.g. if the knee comes forward, the camera will see the upper leg peek out from under the shoulders, along with the foot. Ditto for the hands/arms.

Another benefit of this rig style is that it's still a pretty normal 3D humanoid rig, stretched out along the Z-axis. Even though the camera doesn't care about the z-dimension much, I can create poses and animations in 3D more intuitively just by mimicking actual human poses. E.g. rotate the leg forward and bend the knee, rather than trying to guesstimate how far forward the knee should be vs. the foot if they were just sliding forward/backward.

My hope is that this will allow me to take advantage of simple sprites for faster art asset production (and easier modding), while still allowing for animations and swappable items/clothes. One question remaining is whether the normal-mapped shader will work in this configuration. The shadows may not look right since each part is flat.

But we'll have time to test the visuals once there's a sample animation. For now, I've barely got the rig and parts done. I need to start keyframing tomorrow. See you then!


ra1's picture

If a face isn't visible to the camera (because it is perpendicular to it), is it even rendered? Perhaps you could ever-so-slightly angle all of the (vertical) faces toward the camera.

dcfedor's picture

Right. A face perpendicular to the camera is invisible (or at least razor thin enough to be hidden).

The idea is that animating the skeleton causes legs and arms to angle slightly towards the camera as they swing forward, and disappear back under the shoulders when hanging straight down. Meanwhile, the head, shoulders, and feet pretty much always render, since they rarely point perpendicular to the camera.

This should work for any animation that doesn't require a side-view of the body. I think there's a way for me to swap sprites in certain animations, but maybe I'll try to avoid that as much as I can. Keep the sprite count per item to a minimum.

Dan Fedor - Founder, Blue Bottle Games