How jaryjay/chess-roguelike works
Main Components
• AI Module – Located in the “ai” directory. This Python-based component contains the game logic for AI moves, configuration, game types, and rules. It is started via main.py and uses external dependencies (requirements.txt).
• Game Backend – Found in the “backend” folder. These are Godot scripts (using .gd files) that implement core game logic, board management, piece rules, rules engine, and move management.
• Game Frontend – Found in the “frontend” folder. This includes Godot scene files (.tscn) and scripts (.gd) for visual rendering of the board, pieces, and user interface (UI elements like promotion UI). It bridges user interactions with the backend game state.
• Assets & Android Build – Assets folder holds logos and UI design elements, while the “android” folder indicates platform-specific build/version data.
• Configuration & Data – Files such as config.json and pieces.json provide configurable parameters and game-piece definitions. They are used by both AI and game logic.
Relationships and Interactions
• The AI Module operates as an independent executable, possibly designed for testing or simulating game decisions. In a live game environment, it might interact with the backend through command-line triggers or API endpoints (if integrated).
• The Backend is the central part that manages game state: it uses its own AI scripts (as seen with different AI implementations in the “backend/ai” subdirectory) and leverages board management (board/*) and game rules (rules/*).
• The Frontend communicates with the Backend: user inputs (e.g., moves on board, UI interactions) are sent to the backend, while backend state changes are visualized via the frontend’s scenes in Godot.
• Assets support visual design and iconography across the UI and game interfaces.
• The configuration files enable consistency of game settings and piece definitions across the layers.
Architectural Patterns and Design Principles
• Separation of Concerns – Clear division between AI, game logic (backend), and presentation (frontend).
• Layered Architecture – The design suggests a layered approach, where the backend (game engine logic) acts as the core and independent modules (AI, UI) interact with it.
• Modularity – Multiple implementations of AI (Python and Godot implementations) hint at plug-and-play modules that could be swapped or extended independently.
• Cross-Platform Consideration – With support for Android and desktop-like components, the system seems designed for scalability across platforms.