Finished refactoring for now. My player script went from 2339 LOC to 446, everything is nicely isolated and much easier to work with 🙌 #indiedev #gamedev #godot #godotengine
16
29
0
293
I created a state machine that supports black-box states—they can operate without knowing of the others. Instead of specifying the next state, they can simply flag for the StateManager to figure out what the next state should be. This way I can maintain really loose coupling.
3
0
0
20
Augmentations are what I call similarily isolated features, but that aren't dependent on state. However, a state can disable an augmentation if desired, so that interaction is suspended while climbing or something.
1
0
0
17
As states are Spatials I can also place nodes relating to each state under it in the hierarchy and keep it visually isolated as well. Feeling pretty confident this will scale well for this game project.

10:55 AM · Nov 22, 2021

2
0
0
16
Replying to @nsrosenqvist
Just WOW ! Very very nice !
0
0
0
1
Replying to @nsrosenqvist
Very similar to how I have my enemy states. I don't use nodes though and very much miss the visual aspect of this approach.
1
0
0
1
Nice! As I come from a programming background I usually just prefer working with code rather than using the visual representations, but it really helps cognitively with having the visual hierarchy of things
0
0
0
0