How ligameacademy/projectsx works
Project type and purpose
• This is a full-game project built on the Godot engine (“card_roguelike”), inspired by Slay the Spire.
• Core features (from README): turn-based card combat, deck building, data-driven CSV configs, extendable Ability/Buff/Attribute systems, predictable monster AI (behavior tree).
File structure
• Top-level:
• addons/li_framework: custom UI framework, auto managers, and state-machine base classes
• datatables/: CSV files + imports for cards, buffs, stats, monsters, abilities
• source/: all GDScript code subdivided into:
– UI (forms + widgets)
– auto (audio_manager, game_instance, scene_manager)
– entities (player, enemies, Damage, models + scenes)
– scenes (combat_scene, map_scene + base class)
– system (buff_system, card_system, effect_system, intent_system)
– utility (asset_utility, plus docs/xls2csv scripts for CSV→Godot imports)
• main.gd / main.tscn + project.godot: entry point
Key insights from README
• There are two high-level flows (game procedure & combat procedure) already documented in docs/ as PNGs.
• Data is driven via CSVs → datatable_manager (in li_framework/auto & source/auto).
• Systems: buff, card, effect, intent each have “C_*System.gd” controllers and models/data classes.
• UI is entirely modular (forms + widgets) and managed by a UIManager in the addon.
a. Main components
1) Godot Engine Core (scene tree, signal/event loop)
2) Addon Frameworks
– UI framework (UIBase, UIForm, UIManager, UIPopup)
– Auto managers (scene_manager, audio_manager, datatable_manager, event_bus)
– State-machine base classes (for AI and other stateful systems)
3) Game Flow Controller (main.gd → game_instance)
4) Scenes Layer
– MapScene, CombatScene (inherit SceneBase)
5) UI Layer
– Forms (menu, map_form, combat_form)
– Widgets (cards, health bars, intents, tooltips, turn indicators)
6) Game Logic Systems
– CardSystem: draws, plays, discards, deck management
– BuffSystem: applies abstract buffs, attribute updates
– EffectSystem: damage, shield, vulnerable, custom effects
– IntentSystem: AI intent generation from behavior trees/state machine
7) Entities / Models
– Player, Enemy (with their .gd models + .tscn)
– CharacterModel, EnemyModel, PlayerModel, Damage entity
8) Data Layer
– CSV datatables → loaded by datatable_manager → model classes
9) Utility & Assets
– asset_utility, xls2csv scripts (off-line), plus all assets (audio/texture/font)
b. Relationships & interactions
• On startup, main.gd initializes GameInstance → loads datatables via DatatableManager.
• SceneManager loads the initial MapScene (game flow).
• Scenes subscribe to EventBus for global events (e.g., “card_played”, “turn_start”).
• UIManager renders UIForms/Widgets on top of the active Scene.
• Player/Enemy Entities reside in the Scene tree; their Models feed into Systems.
• When a card is played: UI widget → EventBus → CardSystem → updates Entity and triggers EffectSystem/BuffSystem → EventBus → UI & Scene update.
• AudioManager plays SFX/Music in response to system events.
Architectural patterns & design principles
• Layered MVC-style:
• Model (Entities + Data)
• View (Scenes + UI + Assets)
• Controller (Systems + Managers)
• Data-driven configuration: CSV → datatables → models
• Event-driven communication: EventBus decouples UI, Scenes, Systems
• State machine for AI & other stateful logic (via base_state classes)
• Modular UI via a plugin (li_framework/UIframework)
Technologies & frameworks
• Godot Engine (v3.x or 4.x)
• GDScript for all code
• li_framework (custom Godot plugin for UI, auto managers, state machine)
• CSV import pipeline (via docs/xls2csv.py & plugin)
• Behavior trees/state machines for AI
• Data files: .tscn scenes, .tres resources, .csv configs