Save Files & Data Management
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Chapter Master project utilizes a decentralized data management system primarily driven by JSON configuration files. These files define the core entities of the game, including Space Marine Chapters, equipment, psychic powers, and unit statistics. This architecture allows for high extensibility, enabling the modification of game mechanics and the addition of custom content without altering the core executable.
Save files and application logs are managed within the local application data directory of the host operating system. This separation ensures that core game data (contained in the datafiles directory) remains read-only during standard gameplay, while user-specific progress and diagnostic information are persisted in a user-writable location.
Sources: datafiles/README.md, datafiles/main/readme.md
Data Storage Locations
The system categorizes data into two primary locations: the project's internal datafiles directory for static game content and the user's AppData for dynamic persistence.
User Data & Logs
On Windows systems, save files, custom icons, and logs are stored in the local AppData path.
| Data Type | Path |
|---|---|
| Save Files | C:\Users\<UserName>\AppData\Local\ChapterMaster\ |
| Custom Icons | ...\ChapterMaster\Custom Files\Custom Icons\custom*.png |
| Error Logs | ...\ChapterMaster\Logs\ |
| Message Logs | ...\ChapterMaster\Logs\last_messages.log |
Sources: datafiles/README.md:12-25
Core Game Content
Static game content is organized within the datafiles folder, partitioned into main and data subdirectories. The main folder generally contains high-level chapter definitions, while the data folder contains granular definitions for items and powers.
Sources: datafiles/main/readme.md
Chapter Definition Schema
Chapters are defined using a comprehensive JSON structure that dictates starting conditions, aesthetics, and organization.
Chapter Configuration Structure
The schema includes metadata for identification, gameplay points, and physical attributes like homeworld type and recruiting worlds.
Organization and Logistics
Chapters can define specific organizational rules, such as split_scouts or split_vets, which determine how specialist units are distributed across companies at initialization. They also define extra_ships, extra_specialists, and extra_marines to modify the default starting strength.
Sources: datafiles/main/chapters/33.json:115-180, datafiles/main/chapters/37.json:135-190
Equipment and Unit Statistics
The game data management system defines units and weapons through structured JSON dictionaries, allowing for detailed mechanical variations.
Unit Statistics
Unit types (e.g., marine, dreadnought, chapter_master) are defined by arrays containing a base value and a modifier/growth value.
| Statistic | Type | Purpose |
|---|---|---|
ballistic_skill | Array [Base, Mod] | Ranged combat proficiency |
weapon_skill | Array [Base, Mod] | Melee combat proficiency |
constitution | Array [Base, Mod] | Physical resilience/HP scaling |
religion | String | Faction-specific belief system |
Sources: datafiles/data/unit_stats.json:1-120
Weapon Data Model
Weapons are categorized by tags and hands required for use. They support multiple profiles (e.g., integrated weapons) and artifact scaling.
Sources: datafiles/data/weapons.json:10-200
Advantage and Disadvantage Systems
The data management layer handles Chapter traits through a point-based system. Each advantage or disadvantage modifies Chapter attributes or faction dispositions.
Disposition Modifiers
Many traits include faction_disp_mods, which apply multipliers or integer offsets to the starting relationship with various galactic factions.
- Example: Tech-Brothers
faction: 3(Adeptus Mechanicus)mult: 1.5start_disp: 10
- Example: Suspicious
faction: 4(Inquisition)start_disp: -15int_mod: -2
Sources: datafiles/main/chapter_advantages.json:115-125, datafiles/main/chapter_disadvantages.json:65-75
Psychic Power Management
Psychic powers are managed as a flat dictionary where each key represents a unique power. Each power defines target types, ranges, and "magnitude" (intensity/damage).
Power Structure
Powers often include flavour_text blocks that conditionally change based on chapter disadvantages, such as Warp Tainted.
"minor_smite": {
"magnitude": 160,
"range": 5,
"target_type": "enemy_unit",
"type": "attack",
"flavour_text": {
"binders_adv": {
"conditions": [{"type": "disadvantage", "value": "Warp Tainted"}],
"text": ["- a green, sickly coil of energy lashes out at the enemy."]
}
}
}
Sources: datafiles/data/psychic_powers.json:340-360
Summary
The "Save Files & Data Management" system in Chapter Master is built on a flexible JSON-centric architecture. By separating user-generated content (saves, logs, custom icons) into the local AppData directory and core game logic into the datafiles directory, the project maintains a clear distinction between game state and game definition. This allows for deep customization of chapter organization, equipment stats, and psychic abilities through simple text modification.