September ‘23

Okay, I'll be honest, we're a few days into October. But I've been working on this post for a while so we can just pretend that I posted it a week ago. I think it's my longest post yet...don't say I didn't warn you.

Let's talk about animation! It's hard. The script that controls the animation/location of each NPC has been reworked so many times over the past year, and so I thought it would be fun to look back on how that stuff has evolved in my game as I've learned more and more.

August 2022

Holy shit, I was so proud of myself for making it to this point. Most of the building still didn't even have walls. But prototyping your systems early is important, especially when those systems are going to send you down a rabbit hole for a year or so.

The character was designed to move from cube to cube, then either wait for a set amount of time or continue moving to the next cube. The animation was just a simple walk-in-place that I recorded using mocap, and there was an additional "idle" animation for waiting. All locations and rotations were determined by the cubes, and I could manually adjust movement speed from cube to cube. I figured I could add in more animations easily, as well as tweak the speed depending on if the character was walking or running.

This is also one of the very few clips I have of this project before I started messing around with shader scripting, so you'll get to see how the visuals of the game have evolved as well, starting with this very next gif.

December 2022

Four months have passed since the last clip and I spent nearly all that time pulling out my hair over shaders and visuals. The character controller itself hasn't changed too much: characters are still controlled by a bunch of cubes plotted all throughout the building, you just can't see them right now because they're invisible. The one major improvement you can see here is that I figured out how to open and close a door automatically for an approaching NPC.

I found some more footage since originally writing this post and updated the gif above. The one it replaced didn’t have much animation footage, but it’s still cool to look at the scenery, so I just moved it down here.

February 2023

At this point I was finally brave enough to try modeling an actual human. The model wasn't perfect, and I've edited it a LOT over the past few months since this gif was captured, but seeing my animation on a proper body was major progress. Also damn, isn't it crazy how much of a difference lights can make?

One more clip from February. I expected to see the guy floating through the floor but I had fully forgotten there was a still a shadowy cube man still programmed to walk around. I yelped when this happened. The game isn't supposed to be scary, but its design definitely allows players to scare themselves with moments like this.

April 2023

I spent these next couple months primarily working on the system that controls the lights all throughout the building. I wasn't really putting any work into the characters, but I was still thinking about the system I had made for the animations and what potential issues I may run into in the future, so I knew the NPC script was long overdue for some work by now.

I copied the character that I was working with and decided to experiment with synchronizing the tracks (cubes) of multiple characters at once. The conclusion I quickly came to was: I couldn't sync them, at all, with the system I had built. So I had to scrap virtually the entire script and start over from scratch. And that brings us to...

The Hard Times 2023

May...June...July...the days started to blur together as the weeks slipped past. It was not a great time for me. Most days I was dumping hours into this problem and failing time after time, but I felt like every failure was bringing me just a bit closer to a solution, so I kept persevering.

The goal was to have a system that allows me to play multiple animations in a pre-determined sequence, where each animation starts at the same location/rotation as the end of the previous animation. No cubes, just wherever the last animation left our character facing.

There's a thing called "root motion" which basically does exactly that, and Godot has built-in support for it, but only within a very specific type of animation controller that I can't use for my purposes. So I started to build my own tool, and it resulted in some goofy mistakes being captured along the way. Enjoy!

July 2023

So now we're in, like, mid-July. Light cues successfully trigger based on NPC location, and the player now has the ability to control the camera, as well as the flow of time, which is what you're seeing here.

On the surface, the character controller is doing what I want: starting the next animation where the previous one left off. But if you look closely, within in the first few seconds of the gif above, you'll see the character blink out of existence for just a moment in between animations. That's because the best solution I had at the time was to set the NPC to invisible at the end of each animation, update the location of the entire node, and then set the NPC to visible again to play the next animation.

I hated this, and I also hate how it's not very noticeable in clips 90% of the time because of video compression, but I SWEAR!!! that it was extremely noticeable and jumpy while I was playing the game live. It was awful.

Also I started messing around with manually changing the values of animation tracks. For example, this next clip was recorded by a friend crawling around on the floor. Not perfect, but a great first step for me learning how to fine-tune animations.

This moment marked the beginning of a beautiful relationship between the Blender graph editor and myself.

September 2023

Look at this! It works!!! Both characters are transitioning through three different animations, and their positions are accurate in relation to each other despite not starting in those positions. Incredible! And all it cost me was a year of my life!

It turns out the key was taking advantage of some features in the latest version of the game engine I'm using. I was developing my game in Godot 3.5, and I was aware of the new releases, but I saw no reason to upgrade to Godot 4 when it came out, because my project is already pretty far along, and there would be dozens of problems that I'd have to go through and fix because of minor changes to the source code. So I didn't do it for months, and was planning to finish out the project in Godot 3.5.

However, around the end of August, I learned that animation support was a little more fleshed out in this shiny new version of Godot. I thought maybe this could be the solution I was looking for. So I bit the bullet and brought my game over into the latest version, cleaned up most of the compatibility issues, and spent another month partially tearing down and rebuilding the NPC script again. And it finally, FINALLY, resulted in success.

With that working properly at last--in a way that I know I won't be tearing down again--I can finally make the NPC animations, ambient (background) light, and ceiling lights all communicate and run cues from a spreadsheet that I can easily edit. As you can see in the clip below, the overhead lights change depending on the character's position, and the ambient light changes depending both the character's position AND the player's position.

I wish I could've been recording animations for the actual final product all this time, but I started this upgrade process around when I got my suit gloves back from Rokoko, so I decided to hold off on doing anything major until I had all my game systems shaking hands. And they finally are!

I think my goal now is to create a little demo starring just the handful of characters I've made so far. It'll only be a fraction of the actual story, but it'll be a good place to start as I move from designing/optimizing these systems to actually implementing them on a larger scale.

If you read through all of that, thank you. I really appreciate your support! Now for that extra emotional oomph, go back and read it all again while the Star Trek Enterprise theme plays in the background.

I'm gonna try to get another post out before the end of October, but no promises. Until next time!!

Previous
Previous

January ‘24

Next
Next

August ‘23