State machines in godot 4.5

Because this is a new poster asking the kind of question that people new to Godot ask.

Maybe but this person asked how to do something that is a very common design pattern for making a game. And all your potential propositions are rather overcomplicated for a new user.

Well that’s why I designed a pull state machine. Because I liked it better than the traditional push model and I thought state charts were not helpful either. So far I have found it to be adequate to model everything I need.

And actually, this idea came from a game, Dash and His Ghost Girlfriend, where I had combo attacks as push states and they could be added as new powers. I was learning Godot using C# and liked the node-based state machine which I had previously poo-pooed myself.

The only thing I propose is thinking about the problem. “Design patterns” do not exist in the problem domain. We force them upon the problems in hope their abstractions will help us in conceptualizing and implementing a solution. Forcing an ill-fitting design pattern has been a bane of many a beginner. And I’ve seen this happening a lot with character control state machines in Godot context.

2 Likes

Man, you’re missing out :smiley:
Always have this bookmarked:

3 Likes

Fair enough. I will note that as far as I can tell, the OP never came back.

I will remember to quote it in the future.

I was thinking about it last night after I went to bed. I also admit after reflection that I dig in a lot less to the root of the problem lately. Partly, because I have started adopting your style of terser responses more often. Mostly because I’m tired of arguing with people who think they know better because they have programming experience, but don’t know how to use Godot - or are trying to hide their ignorance because they got to the solution by using an LLM and don’t want to admit it.

1 Like

Where would you recommend I go to learn more about state machines?

1 Like

I’d recommend an older book on game development or game design TBH. It’s not about the language you use to make it - it is about understanding the concept. The Gang of Four’s book Design Patterns is also a good place to start IMO.

Alternately, just do a few different YouTube tutorials on state machines in Godot and see what you like.

1 Like

I have a tutorial series breaking down all this. Enjoy.

Thanks for the help.

Thanks as well, I’ll be sure to watch it.

That video did not appear to have anything to do with state machines.

Its in the series of videos. I guide you through how to do states.

1 Like