The Character Controller

Let’s start today’s article with a bad word?

Hey, everyone!

This time we’re taking a small detour before posting the second part of the article I started last time on our Art Direction (click here to read it), and we’re talking about the fundamental aspect of a platform game: the character controller. But first of all maybe we should explain what a platform game is! “Platform” is how we describe a rather old-school kind of game, where the characters that could move up, down, left and right, could literally jump on platforms and explore the levels. If you’ve ever played the classic 1985 Super Mario Bros, you know what I’m talking about. For the rest of you, go and play it right now because you’re missing out!

Done? Ok, back to us, the character controller. And yes, it is a bad word. The character controller is that part of code that allows the player to move the character. You don’t need me to tell you how important this part of programming is for a platform game; without a good character controller, the game become frustrating, it’s not fun and can sometimes be unplayable (you can find loads of examples gathered over the years online!).

Indie developers today have two different alternatives: do things as they did in the good old days like the big studios do even today, i.e. “do it all yourself”, or buy “pieces” of ready-made code and insert (more technically speaking “implement”) them in their own game.

Since we never chose the easy way, we opted to write everything from scratch. It took quite a while to develop a character controller that could allow you to control the character without frustrations, and allowing you to control it as you want, when you want. Now if you’re thinking that programming a simple jump is easy… well, you’re dead wrong. And we found out the hard way too! Jumping, a platform game’s very essence, is really the most delicate (a complex) part to write in a character controller, because there’s so much more to it than moving an object up and down. The character must be lightly controlled during the aerial phase of the jump. And that’s not all. How long must the jump last? How much does a character accelerate in the air?How long does it take for them to land? How do they behave if they jump from an “idle” state (when they’re standing still) or if they jump while running? And what if the character’s sliding and then jumps? Also, a jump can be divided in at least three phases: jump high, jump in the air and jump down. But there must be even more stages than these, depending on the kind of implementation chosen. And finally, all of this must be perfectly synchronized with jump animations! So it’s a real mess.

The character controller, aside from moving an object in the game that’s invisible, that is the “true” character read by the code, must also synchronize the commands of another nasty thing called “state machine” that sees to animating the 3D model that represents the character.

So the character controller basically does two jobs at the same time: 1. It moves a mathematical object, that represents the player’s character and that can’t be seen on-screen; 2. Controls the state machine that animates the 3D model of the character in the right way at the right time (you just need one wrong frame for the character to notice the commands and the animations are out of synch!).

It’s really important to write your own character controller, because it allows you to have the maximum flexibility and adaptability for your game, and you can have complete control over all the parameters that are needed so the character will behave as you want it to.

Our character controller allows us to work on whichever small variation we want to make on the parameters to calibrate the movement speed, the height of the jump, how gravity behaves in different situations, and extra actions like sliding etc.

On a final note, I’d like to tell you tried to get as close as possible to the level of the best games out there, by thoroughly studying their components. We preferred the immediacy of gameplay rather than the fluidity and physicality of beautiful products like Dark Souls, all because of the basic nature of our product, an arcade platform game. Up to now, the players who have tried the new character controller at the Milan Games Week 2018 were really pleased with how they were able to move the character. Let’s hope we’ve managed to reach a level of gameplay that you’ll enjoy, because we’ve really given it our all.

See you next time!

Andrea

Leave a Comment

Latest Posts
Stum!
  • February 25, 2019
The Character Controller
  • February 19, 2019
Art direction (part 1)
  • February 12, 2019
Vogan and Selius
  • January 25, 2019
The Xenostain
  • January 10, 2019
Newsletter
Login
Loading...
Sign Up

New membership are not allowed.

Loading...