A state machine in a state machine

Godot Version

`4.5

Question

is a state machine in a state machine is it good or no?

what i mean by this is a node based state machine also having a code baste state machine in the node state

i don’t know if this is good code Architecture or bad code Architecture
if it is bad may i know why?.

1 Like

It is pretty common to use a state machine as a state.
So nothing bad in principle, use it if it helps your design.

3 Likes

are i see because i thought of using it for enemy A.I and a weapon manager and nothing come up when i search it in google or duckduckgo or even brave search

and thank you for the fast reply

It is called “Hierarchical Finite State Machine”,
any state can have a set of sub-states.

And a state which contains a set of sub-states is
basically a state machine.

Good luck with your game project :grinning_face:

2 Likes

The term you’re looking for is called Hierarchical State Machine.

2 Likes

are thank you for the right terminology and thank you answering why it didn’t come up in search engine

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.