Download

Proper ways to organize complex playing character (many states) ?

Hey,

Since time i develop my game The Last Hope Of Dragons, and i want know yours opinions about ways to organize character moves (states)

Let me explain, i want manage severals states/part of char with BP (idle, walk, grap, ledge, climb, talk, etc) like for animation blueprint but in Blueprint Character (In logic).
But when character will have many states, BP will be unreadable and too cumbersome.

I was thinking to make a blueprint component named “State management” and have state function (idleFunc, moveFunc, grapFunc, ledgeFunc, etc), will reference character.

Note: I use BP for prototype and i not sure this way are proper, however i wonder if should to directly going to C++ (especially that this state management are one important basic functionality).

What do you recommend to me ?

In a nutshell - complex stuff is complex.

Some people might tend to spread stuff across several blueprints or instances, but i like to have it all in one blueprint because that way i know where to find it. But it’s a matter of taste i guess.

You can group blocks in blueprints, put fancy labels on them. There’s a reason why you can zoom and pan in blueprints - they get big after a while.

I would NOT stuff state management into C++. C++ is powerful and you’ll need it sometimes, but especially for animations and states i find blueprints much more convenient, easier to overlook and easier to debug.

Blueprint or C++ does’nt make a difference in the end product since when you compile there’s an option to convert blueprints to C++ anyways, so in the end you can do that to gain performance in the final release.

But after all is said and done it is your game, you will have to “live” with it and whatever is most convenient for you should be your way.

Hi !

@**Fronzelneekburm : **Sorry for late anwser !

I agree ! For many states visualization and events/callback it’s better to use the Blueprint part, and use C++ for logical core part !
Personnaly i develop core part in C++ and implementation/callback/event in BP :slight_smile:

With many try and research i finally found a (temporary) solution.

For some game actions (Hit Junctions, Spell, Combos, Special Moves, etc…) i developed in C++ the core part of an Action Class.
Action have struct with paramaters and can spawn some custom Actor class from boolean parameter (custom subclass who have the character as possessor and the action data) which you can do anything.

I store action parameters in DataTable.

As i can (more) segment several complex functionality in each actions and lighten the class of the characters.

I can schematize like this :

Here I just wanted to share my proposal and my tests ! Hoping that this may interest people ^^,

Best regards

Sometimes I think I should make free my FSM Component plugin :confused:
I think it would really benefit everyone, but support requests would skyrocket and make my schedule difficult…

Interresting !

So you use the Finite State Machine Pattern ! I 'm just see your FSM plugin in marketplace, good job ^^