
Godot State Machine Advanced
You're past the point where a flat switch statement can handle your AI logic. This covers hierarchical state machines and pushdown automata for Godot, with proper state stacks for interruptions like pause menus, context passing to avoid singleton hell, and transition guards to prevent illegal state changes. The included scripts handle animation syncing, concurrent state orchestration, and resource-driven state definitions. The "never" list is blunt but necessary: propagate physics to child states, always pair enter with exit, and don't push states without a pop plan or you'll leak resources. If you're building layered character behaviors or need states that can pause and resume cleanly, this is the architecture you want.
- skills.sh installs
- 291
- GitHub stars
- 464
- last updated
- Aug 21, 2026
Install
$ npx -y skills add thedivergentai/gd-agentic-skills --skill godot-state-machine-advanced --agent claude-codeInstalls into .claude/skills of the current project.
Files
Available Scripts
hsm_hierarchical_base.gd
Advanced HSM base delegator for propagating physics and input to sub-states.
hsm_pushdown_stack.gd
Professional Pushdown Automata for interruptive state (Pause/Menu) stacking.
hsm_state_context.gd
Decoupled context object pattern for passing persistent data between states.
hsm_transition_guard.gd
Expert transition validation logic to prevent illegal state changes.
hsm_animation_syncer.gd
Automated Logic-to-AnimationTree syncing with state-based travel logic.
hsm_concurrent_logic.gd
Orchestration for parallel state machines (e.g., Move + Attack).
hsm_resource_state_loader.gd
Data-driven state definition using custom Godot Resources (.tres).
hsm_reentry_aware_state.gd
Handling resume-from-stack logic vs fresh entry events.
Sponsors
Details
- Repository
- github.com/thedivergentai/gd-agentic-skills
- Categories
- AI & Agent Building, Game Development
- First seen
- Jun 3, 2026
More from thedivergentai/gd-agentic-skills
All 51- Godot Rpg Stats287
- Godot Genre Roguelike285
- Godot Combat System281
- Godot Dialogue System281
- Godot Ui Containers279
- Godot Tilemap Mastery277
- Godot Scene Management276
- Godot Project Foundations273
- Godot Resource Data Patterns272
- Godot Animation Player271
- Godot Economy System271
- Godot Autoload Architecture268
- Godot 3d Lighting266
- Godot 3d Materials260
- Godot Animation Tree Mastery260
- Godot Tweening256
- Godot Physics 3d255
- Godot Ability System253
- Godot Performance Optimization253
- Godot Ui Rich Text251
- Godot Platform Mobile248
- Godot Export Builds246
- Godot Navigation Pathfinding245
- Godot Multiplayer Networking243