Build Tools & Gobo
Relevant source files
The following files were used as context for generating this wiki page:
Build tools in the ChapterMaster project primarily facilitate code maintenance and data configuration. The most prominent tool is Gobo, a GML (GameMaker Language) formatter that ensures code consistency across the project's source files. Additionally, the project utilizes configuration files for logging and asset management, alongside complex JSON-based data structures that define the game's mechanics, technologies, and units.
Sources: run_gobo.ps1, stitch.config.json, datafiles/data/technologies.json
Gobo: GML Formatter
Gobo is an external formatting tool utilized to standardize .gml files. The project includes a PowerShell automation script, run_gobo.ps1, which manages the lifecycle of the formatter, including installation, updates, and batch processing of source files.
Automation Workflow
The run_gobo.ps1 script performs several critical steps to maintain the codebase:
- Environment Setup: Configures the repository source (
EttyKitty/Gobo) and identifies the executable (gobo.exe). - Auto-Update Logic: If the formatter is missing, the script queries the GitHub API to fetch and install the latest Windows release.
- File Gathering: Recursively searches for
*.gmlfiles while respecting exclusion patterns (e.g.,.git,prefabs,extensions). - Batch Processing: Executes the formatter on each file, providing real-time progress updates in the host UI.
Sources: run_gobo.ps1:3-10, run_gobo.ps1:22-43, run_gobo.ps1:51-56
Execution Logic Diagram
The following flowchart illustrates the automated formatting process managed by the build script:
The script uses a System.Diagnostics.Stopwatch to track performance and reports the total processed count and error rate upon completion.
Sources: run_gobo.ps1:22-44, run_gobo.ps1:51-87
Development Environment Configuration
The project utilizes stitch.config.json to manage the visual output of the game console and logging levels. This configuration applies regex patterns to style console messages, aiding developers in identifying issues during the build and run cycles.
Console Logging Levels
| Level | Pattern | Style/Color |
|---|---|---|
| INFO | ^.*| INFO |.* | Green (#66ff66) |
| WARNING | \\bwarn(ing)?\\b | Yellow (#FFD900) |
| ERROR | \\berror\\b | Red (#FF0000) |
| CRITICAL | ^.*| CRITICAL |.* | Bold Red (#FF0000) |
| DEBUG | ^.*| DEBUG |.* | Light Gray (#e6e6e6) |
Sources: stitch.config.json:30-85
Data Schema & Technology Trees
Build tools also encompass the configuration of game-data schemas. These JSON structures define prerequisites for "forging" items and researchable technologies, which act as a build-order system within the game's logic.
Forge Prerequisites
Many items in weapons.json and mobility.json require specific technological "tags" to be unlocked before they can be produced.
| Item | Requirement 1 | Requirement 2 |
|---|---|---|
| Assault Cannon | solid_projectile_1 | heavy_1 |
| Boltstorm Gauntlet | power_1 | combi_1 |
| Chainfist | power_1 | combi_1 |
| Vehicle Armaments | heavy_1 | N/A |
Sources: datafiles/data/weapons.json:28-32, datafiles/data/technologies.json:96-102
Technology Dependency Flow
The technology tree follows a strict progression logic defined in technologies.json.
Summary
The build tools and Gobo integration provide a robust framework for both code quality and game data integrity. By automating code formatting with Gobo and defining strict, machine-readable schemas for technologies and weapons, the project ensures that developers can maintain a consistent codebase while scaling complex game systems.