The Importance of Staying Grounded

As I am sure your aware, when it comes to game development, there are so many things that can break immersion for the player that it can make your head spin. They can range from a small, unrealistic twitch in a looping animation to the character being able to survive things that we know no person every could. These and many more things can ruin all of our hard work in trying to bring the player into the worlds that we create. But, there are few things that will break immersion quicker, and mark a developer as supremely lazy, as characters that float in midair as they stand on the ground.

This was the problem that I decided to tackle in the last week. After combing over various videos on Youtube showing how to do this in Blueprint, and coding everything in the editor, I had something that was reasonably good. I felt pretty good about what I had, even though I wasn’t sure of how performant the code was. With all of the foliage in Capuchin Capers, I don’t have a single CPU cycle to spare. I didn’t see any real difference in FPS on the first level of the game, so I felt things were headed in the right direction with the IK system that was implemented.

I watched one of the video streams from Epic on the Paragon characters animations and how they were achieved. In that video, speed warping was mentioned as a way to blend two animations together even if their frame rates were completely different. I thought that would be a great way to adjust Suzy’s IdleWalkRun blend space so that her run animation could be stretched a bit at higher speeds to reduce foot slide. I knew I didn’t want to take the time to learn exactly what had to be done to implement this, let alone code it. So off I went, on a search of the marketplace to see if there were any plugins that would do that.

Imagine my surprise when I found that not only was there a plugin that could do speed warping, but that I already owned it! Not only could it do speed warping, called stride scaling in the plugin, but it was a full IK solution. I am embarrassed to admit this, but it never even occurred to me to look at all the assets I have from the marketplace. I didn’t remember seeing anything like this in my asset packs, so I just assumed that we had to implement this ourselves. About that plugin…

PowerIK is a plugin that Epic acquired late in 2020 and made it free for everyone. It has several very powerful IK solvers already built as graph nodes that we can use in our animation blueprints. While it doesn’t have speed warping as a stand-alone graph node, the source code is included with the plugin. I don’t have a ton of experience coding plugins for Unreal, but this isn’t a situation where I’m starting from scratch either. So I should be able to make a graph node from the code base that is already there.

This was great news because PowerIK is really powerful (no pun intended), and I was able to replace most of the Blueprint code that I had with the PowerIK Ground node. The foot-to-ground alignment seemed broken, so I used the solution that I had from my previous work. But you may note that I replaced most of what I had done over the previous week with that single node. That is a feel bad moment. I could have had everything setup in a single day if I had just slowed down and checked all the assets that I already possessed.

This is a journey. There are going to be mistakes along the way…quite a lot of them, to be honest. The lesson here is that I shouldn’t have flown off to develop my own IK system to align the character’s legs and feet. I learned a lot, but ultimately the time wasn’t well spent. You live and you learn.