3
\$\begingroup\$

I would like some industry advice. I feel like the starting part to every game I create is the character controller. My goal is to create a solid base character controller that I can expand upon for any type of game that I create. That way I'm not recreating the same system over and over again and start focusing on what makes my game unique. I was wondering what system design principles are used to create character controllers that are modular and can easily interact with numerous gameplay features. Here are the features that I think pretty much 90% of character controllers need:

  • process Input
  • movement
  • Animations
  • Abilities/ways to interact with the world.
  • Reaction/modifiers: how the game world affects the controller/player.
  • Some way of dynamically adding and removing abilities and modifiers and allowing and disallowing the ability to use them.
  • (optional) replicate and reconcile in a multiplayer context

The most common way I see to achieve this in tutorial land is with a finite state machine. The problem with that approach is as your character controller rises in complexity you come across these issues:

  • State explosion
  • difficulty to debug and test
  • lack of ability to add dynamic behavior

My gut tells me that there is a better way than just state machines.

A new approach that I have seen is Unreal 5 Gameplay ability system (GAS) the problem I hear with that is that it is overly complex and limited to Unreal.

Are there any examples of greatly designed character controllers on the internet? Perhaps if you worked on your own character controller you could share some insight on how it was designed?

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$

It sounds to me like you are trying to accomplish the impossible. There are limitations to how flexible and reusable you can make a system. Remember that a system with infinite flexibility will also be infinitely complex. It's also incredibly difficult to anticipate and solve problems for potential future projects that haven't even reached the drawing board yet.

You should start by answering some basic questions:

1. What kind of games am I making?

Obviously your character controller needs will be drastically different between a 2D platformer, first-person shooter, or third-person brawler. Are all of the games you create in the same genre, or do you change it up each time? Are there a standard set of features you use in every game that you develop?

2. How often do I create a new game?

It can take years to develop a complex game. If you're only starting on a new game once every few years, the overhead of creating a new character controller for each game is probably less than the effort you'd spend trying to create a perfect all-in-one character controller.

If you're cranking out simple games on a constant basis, you might benefit from creating a starter template - an unfinished character controller with the infrastructure in place for you to quickly build what you need. It's also perfectly acceptable to start with the completed character controller from a previous game and modify it to suit the needs of your new game. Even AAA studios do this all the time.

If you're frequently starting on new games because you never finish the games that you are developing - you're focused on the wrong problem here. Identify why you aren't finishing the games that you start and what you can do differently to help you see through your projects until the end.

3. Is this a problem that someone else has already solved?

There are many commercial character controllers on the Unity Asset Store already, as well as various free open-source options on GitHub. Is there a package/library that already meets your needs? (Keep in mind this is not a place to get recommendations for specific packages).


Essentially, you should do a cost-benefit analysis. Is the cost (time spent developing your all-in-one system now) outweighed by the benefit (time that you'll save in the future)?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ This is a good answer. And it applies to most engineering situation, not just game making. Just the fact that with so many game engines, and after so many years, nobody has done what the OP wants (each of them have solutions specific to their own paradigm) should be an indication that there is something there. \$\endgroup\$ Sep 7 at 2:44
  • \$\begingroup\$ Thanks for the answer it was very insightful. I just don't agree with this statement: "Remember that a system with infinite flexibility will also be infinitely complex." I think there are many examples of simple composable systems that can create very flexible use cases. Take for example the Turing Machine it is a very simple mechanism that can implement any computer algorithm. I do agree that there is a cost benefit analysis to be had with trying to create a flexible character controller. The Turing machine wasn't formulated easily. \$\endgroup\$
    – Jacob Edie
    Sep 7 at 19:21
  • 2
    \$\begingroup\$ A Turing Machine is not a mechanism; it's a mathematical model of an abstract computer. I don't think it's a good analogy for an implementation of a character controller. Also keep in mind that implementations of the Turing Machine concept often are quite complex. \$\endgroup\$
    – Kevin
    Sep 7 at 21:53
  • \$\begingroup\$ I think I should rephrase my question on how to make an extendable character controller rather than a flexible one. Would that circumvent the infinite complexity? \$\endgroup\$
    – Jacob Edie
    Sep 9 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .