Architecture Overview
Relevant source files
The following files were used as context for generating this wiki page:
The ChapterMaster project is structured around a data-driven architecture that defines the attributes, behaviors, and assets of Space Marine chapters and their associated systems. The core logic relies on deeply nested JSON configurations that manage everything from individual unit statistics and equipment to complex chapter-specific organizational rules.
This architecture enables high extensibility, allowing for the definition of unique chapter traits, custom squad formations (Kill Teams), and complex equipment progression through technology forging.
Chapter Configuration System
The foundational component of the architecture is the Chapter Definition. Each chapter is defined in a standalone JSON file that dictates its starting strength, fleet composition, recruitment logic, and visual appearance (livery).
Core Chapter Data Model
Chapters are identified by unique IDs and contain several sub-structures for organizational management.
| Field | Description |
|---|---|
origin | Classification (Founding, Successor, Custom, etc.) |
fleet_type | Determines starting ships (Homeworld-based, Fleet-based, or Penitent) |
discipline | The psychic school used by the chapter's Librarians |
disposition | Numerical relationship values with other Imperial factions |
complex_livery_data | Visual hex codes and patterns for different marine ranks |
Sources: datafiles/main/chapters/37.json:4-46, datafiles/main/chapters/33.json:4-48
Organizational Logic
The architecture supports complex rules for distributing personnel across companies. Chapters can be configured to split veterans or scouts across all companies or keep them concentrated in the 1st and 10th companies respectively.
The diagram shows how the load_to_ships and equal_specialists flags determine the internal distribution of specialized units within the chapter structure.
Sources: datafiles/main/chapters/37.json:115-125, datafiles/main/chapters/36.json:117-122
Squad and Unit Systems
Units are defined by a base set of statistics which are then modified by their role, chapter advantages, and equipped gear.
Unit Statistics
Every unit type (Astartes, Skitarii, Ork, etc.) shares a common statistical schema including attributes like ballistic_skill, weapon_skill, and piety.
The relationship between base unit stats and their associated equipment and traits.
Sources: datafiles/data/unit_stats.json:1-120
Custom Squad Formations (Kill Teams)
The architecture allows for "Custom Squads," where a single squad entry can contain a heterogeneous mix of roles and specific loadout requirements. This is heavily utilized by the Deathwatch chapter to define varied "Kill Teams."
- Required Loadout: Forces specific items (e.g., 4 Marines must have Stalker Pattern Bolters).
- Optional Loadout: Provides a pool of weapons and a maximum count allowed (e.g., pick 2 from Flamer, Meltagun, or Plasma Gun).
Sources: datafiles/main/chapters/33.json:165-350
Equipment and Technology Forging
Equipment is not static; it is governed by a requirement-based forging system linked to researchable technologies.
Technology Tree
Technologies define what the chapter can produce in its forges. Some technologies act as prerequisites for others, creating a progression path.
| Technology ID | Display Name | Requirement |
|---|---|---|
armour_1 | Ceramite Bonding | None |
armour_2 | Advanced Ceramite Bonding | armour_1 |
dreadnought_1 | Sarcophagus Assembly | armour_2 |
melta_1 | Atomic Chamber Construction | flame_1 |
Sources: datafiles/data/technologies.json:1-100
Armor Mechanics
Armor provides protection through armour_value and damage_resistance_mod. High-tier armor like "Artificer Armour" or "Terminator Armour" requires specific technologies (artificer_1, terminator_1) to be forged.
Progression from technology research to the ability to produce and equip high-tier armor marks.
Sources: datafiles/data/armour.json:1-100, datafiles/data/technologies.json:5-110
Psychic Power System
The Psychic Power module manages supernatural abilities using a "Magnitude" system for power scaling and target type filtering.
- Type: Abilities are classified as
attackorbuff. - Targeting: Powers specify
target_type(e.g.,enemy_unit,enemy_vehicle). - Dynamic Flavor Text: The system can change descriptions based on chapter disadvantages (e.g., "Warp Tainted" chapters see different visual effects).
Sources: datafiles/data/psychic_powers.json:10-250
Chapter Advantages and Faction Interaction
Chapters can be further customized with "Advantages" that provide global modifiers or starting bonuses. These interact with the "Disposition" system to modify relationships with entities like the Adeptus Mechanicus or the Inquisition.
- Tech-Brothers: Increases starting disposition with the Mechanicus by +10 and applies a 1.5x multiplier to further gains.
- Ancient Armoury: Provides rare Heresy-era gear and enhances Mechanicus relations.
- Enemy Specialty: Increases damage against specific xenos races (e.g., Eldar, Tyranids).
Sources: datafiles/main/chapter_advantages.json:1-150, datafiles/main/chapters/37.json:155-165