Quoted By:
Fangame report incoming.
Okay, so, I looked up and studied state machine patterns, because I wanted a game with few characters with highly detailed and complex behaviors (including our protagonist's if they're ever controlled by AI for specific parts of the game).
My initial design had the state machine components divided into a state node, which is a standardized class, and state logic, which would be a resource implemented as a dependency injection (the part of the state which would do unique things). I could avoid implementing a controller completely, and structure an EMPTY flowchart of nodes, THEN add behavior to the nodes (and even on the fly). However, I GRIM-ly discovered Godot is very clunky about resources. I intended each dependency injection to be unique and local, and Godot makes them global (meaning it's the LITERAL same code for each injection, meaning all those nodes do the EXACT same thing, including variable things like position, etc). There's no easy way to make each resource unique without a lot of extra manual management (which introduces a lot of possible errors that are hard to detect).
So, I have to rewrite the entire state machine from the ground up in a more traditional way. I'll revisit my original idea if I find a better way to handle the resources in Godot.
It's amazing how much you can learn if you really want to.
Report ended. Thanks for reading my blog.