Devlog #1: Procedural Madness


Here we are with a brand new project, but we've got past experience in something similar.

So it’s going to be a cakewalk, right? Hell no.

Procedural animation is hard! Really hard!

But let me back up for a moment. Because if you’re also a game dev, you either 1) already know that procedural stuff is difficult, or 2) you’re a natural-born genius and already scoffing at how incompetent we are.

So here’s the 2D version of what we want to accomplish now in 3D:

The basic idea is that we’re assembling a creature from a variety of different parts. Players will “evolve” their creature during gameplay, and every creature has its own, unique part set, animation, stats and so forth.

Most people in game dev know of this idea from Spore, the giant Electronic Arts game that completely bombed in 2008 but has a small cult following now. Older folks might recognize another game called E.V.O.: The Search for Eden.

E.V.O. was pretty simple, but Spore was not. It took 8 years to develop and had a team of 80 at launch — most of whom were technical. They published scientific papers on how to procedurally generate creatures. These were really, really smart people who decided to go all-in on a single concept: procedural everything. Besides generating creatures, they also had procedural animations, procedural landscape, procedural music… you get the idea.

We’re actually not interested in the procedural creature generation — it’s not that unique of a selling point in 2023, and we’ve got our own method that we like, which involves making real, fully modeled 3d creatures and then letting you swap parts between them. Here’s the first test creature our artist came up with, a handsome (but still eyeless) tiger:

On the other hand, we are interested in procedural animation — walking, running, attacking, flying, etc — because for now we’ve just got the one artist, and modeling, rigging and animating nice-looking 3D models is very time consuming. Cutting down the animation time would help a lot!

The method we settled on is called CCD IK, which stands for: cyclical coordinate descent inverse kinematics. The basic idea is that you’ve got a part of your character and a point that you want that part to touch. So far, this is just describing the IK part. The CCD part is code that iteratively moves the joints. If our tiger has a hip (1), a knee (2) and an ankle (3), then CCD is cycling through these: 1, 2, 3, 1, 2, 3… each time it shifts the joint just a bit to get the effector (the tiger paw) closer to the target. (If you want to know a lot more, go watch Unity’s video about it.)

In theory, the result will look really smooth. But the first couple attempts have the tiger's limbs flipping around crazily... 🤦🤦😢

Gah! Well, subsequent attempts got the tiger a lot closer to an actual walk; he kind of stomped along in an adorably robotic way. I did have faith that he’d get there eventually, we’d save the animation time, all would be well.

Yet, we still decided to cancel CCD IK...

Honestly, while the CCD method sounds easy, getting it right involves a ton of vector math. It's annoying and tricky and, by the way, it has been a long time since school so our engineer had to relearn it. Another problem is that we’re a game about evolving different creatures. That means tons of different joint arrangements. 

As an indie with time and money constraints, it's important to cut your losses early. I'm really impressed with Spore (and other people making Spore-like games) but we decided that for us, the fastest, most efficient way forward is to stick with vanilla IK animation. Which is still pretty good compared to old-school keyframe animation.

So what else did we get done this month? Besides the tiger, we also finished the algorithm that actually puts the tiger together — that handsome guy starts off as a cut up jumble of body parts.

Personally, I started working on identifying a visual style, putting together the shaders that could achieve it, and doing some exploratory work on terrain and environment. I’ve used Unity Terrain years ago, and since then used terrain tools on another platform. Coming back to Unity Terrain in 2023, I don’t really love it, but I haven’t figured out whether I’ll use some alternative like Gaia yet.

That’s pretty much it. The first month is always slow — especially when it’s coming out of holiday vacations! — so I’m not worried about where we ended up. On to February!

Leave a comment

Log in with itch.io to leave a comment.