Project structure
Tech stack
Godot 4.6
The game engine. Provides the scene tree, signals, physics, and built-in UI
nodes that everything else builds on.
GDScript
Primary language for all gameplay logic, autoloads, UI scripts, and state
machine states (390 KB of source).
C#
Used for select systems via optional .NET 8 integration (29 KB). Not required
to run the game.
GDShader
Custom shaders for visual effects in
assets/shaders/.Dialogue Manager
Third-party Godot plugin (
addons/dialogue_manager) that drives all
in-game narrative and cutscenes.Python & Shell
Tooling and automation scripts. Not part of the game runtime.
Core design patterns
Autoloads as singletons
Godot autoloads are nodes that Godot instantiates once and makes available to every other scene by name. Beast Card Clash uses six autoloads to expose global state and services without coupling scenes to each other.State machine for battle flow
The battle scene is driven by a five-phase state machine: Start → Loop → Turn → Referee → End. Each phase is a separate GDScript class that extendsBattleState, which itself extends a generic BaseState. The BattleManager node owns the active state and drives transitions.
This pattern keeps each phase’s logic isolated and easy to extend without touching the others. See Battle state machine for the full diagram and state descriptions.
Resource-based data
Game data (cards, teams, playlists, flags, scenes) is stored as GodotResource files rather than hardcoded in scripts. Autoloads load these resources at startup and expose typed accessors. This makes it straightforward to add new cards, teams, or tracks without modifying logic code.
Signal-based UI updates
UI nodes do not poll game state each frame. Instead, game logic emits Godot signals and UI nodes connect to them. This keeps the battle scene responsive and avoids tight coupling between the state machine and the HUD.How scenes connect
The game’s scene flow is linear and controlled entirely throughSceneManager:
- Start menu — the entry point. Launches character/team selection or shows credits and the tutorial.
- Character selector — the player picks a team, species, and skin. This writes to
PlayerStats. - Battle scene — the core gameplay loop, driven by the battle state machine.
BattleStartcallssetup_player(),setup_bots(),setup_ui(), andsetup_world()on theBattleManager. - End screen — shown from the
BattleEndstate after ranking is determined. The back button returns to the start menu viaSceneManager.
All scene transitions use
SceneManager.change_to_scene(name). You should never
call get_tree().change_scene_to_* directly in scene scripts.Explore further
Autoloads & singletons
Full API reference for all six globally accessible autoload nodes.
Battle state machine
How the five-phase state machine controls every match from start to finish.
Battle manager
The node that owns and drives the state machine during a battle.
Card system
How cards are defined, stored, and played.
Battle mechanics
Player-facing rules for how battles resolve.
Contributing
How to set up your dev environment and submit changes.