holy shit what a critically underrated video. this is easily the most digestible state-machine tutorial I've found, and I've been looking at a ton of them to figure it all out. The total overlap of abstraction to in-engine implementation with examples is perfect - and very specifically, natural-language examples rather than abstracted examples. This is so, so useful. Thank you.
You can take the state transition logic out of the states to make them more reusable and less coupled to each other. For example, you could reuse the same walking state on different characters even though one jumps when it sees an enemy and the other attacks. Have the states emit signals when certain events have happened and let the owning node decide how to respond. Each state becomes its own self-contained little thing which is completely agnostic about the existence of other states.
I don't know how many tutorials I watched and I many thing I had read. Every time I was thinking that were incredible but then by "copying" them I was realizing that I wasn't familiar with that. Having a 2d Node as state manager helped me to visualize better things and how scripts interacts between them Really thank you for this tutorial! I hope I will find it better for my way to code
I've been trying to understand this stuff for a while and your videos on it have finally made it click for me. Thanks and great videos!
Ive watched this video so many times to understand how to implement this pattern into my games and now its saved me so many headaches because of how useful it is. Thanks a lot for this video :)
Thank you for this video! I was struggling with the Godot official documentation on State Machines, that gets too much into a specific implementation. As many people have mentioned, this is the best, and cleanest explanation. I am able to code now my variation and finally also make sense of the official documentation. Again thank you! Subbed!
just wanted to say thank you for this tutorial series, and your help. i have successfully implemented the state machine, and also added a slide and a speed boosted slide-jump to my game!
Amazing 2-part tutorial, thanks for taking the time to put it together! State machines have been my white whale for a while now, but this has really cleared things up
Comment for the algorithm, awesome video! Never thought of using nodes for the states! I always saw them as a code only type of thing!
Good stuff, commenting for The Algorithm. I'd actually be interested in the 'more complex' examples, something I find most tutorials don't go into much depth on.
The way you explain these things so good and professional is awesome!! Your tutorials always help me a lot! One question tho: is the base_state just a script, or is it attached to a node in the scene tree?
Immensely helpful! Cheers! 👍
Great video! Would love to see more example usages in various situations...
Amazing! Now I want a parallex bg tutorial (easy one)
No more spaghetti code. Thanks man!
Keep up the good work. Your tutorial are really good!
extremely useful ! thanks a lot
Thank you very much
Great video, made me finally understand the State Machine better. I like your solution more than other tutorials I saw about it. Have you tried reproducing this in Godot 4? It seems there are no dot functions anymore so I wonder how would one do the .enter() in Godot 4. Thanks in advance!
@bladesofresilience5153