Table of Contents

Namespace StarterKit

Classes

AISystem

Simple AI for StarterKit. Non-player countries colonize and build farms on monthly tick. AI countries use the shared EconomySystem for gold (same as player). Priority: Colonize first (expand), then build farms (develop).

Demonstrates: ProvinceQueryBuilder for fluent province filtering.

BuildingInfoUI

STARTERKIT - Building information panel Shows buildings in the selected province with option to construct new buildings. Pattern: UI Presenter Pattern - View Component

BuildingSystem

Simple building system. Allows constructing buildings that provide bonuses. Uses ModifierSystem for province-local and country-wide effects.

BuildingType

Simple building definition.

CountrySelectionUI

STARTERKIT - Simple country selection UI. Click map to select country, click Start to begin. Emits PlayerCountrySelectedEvent when started.

DiplomacyPanel

STARTERKIT - Diplomacy panel showing relations with a selected country.

Demonstrates ENGINE diplomacy system:

  • Opinion display with color gradient
  • War/peace status
  • Treaty status (alliance, NAP, etc.)
  • Declare War / Make Peace actions

Architecture:

  • ENGINE: DiplomacySystem provides mechanism (war state, opinion calc)
  • GAME: StarterKit provides policy (UI, when to allow actions)
EconomySystem

Simple economy for StarterKit. 1 gold per province + modifier bonuses, collected monthly. Tracks gold for ALL countries (for ledger display).

Uses FixedPoint64 for deterministic calculations across all platforms. This ensures multiplayer sync - float operations produce different results on different CPUs, but FixedPoint64 is identical everywhere.

Income Formula (per province): baseIncome = 1 gold localModified = baseIncome * (1 + LocalIncomeModifier) finalIncome = localModified * (1 + CountryIncomeModifier)

Initializer

GAME layer initializer for StarterKit. Waits for ArchonEngine to initialize, then creates game-specific systems.

Access via Initializer.Instance for commands and other systems. Access ENGINE via ArchonEngine.Instance.

LandUnitCostCalculator

STARTERKIT: Movement cost calculator for land units.

Wraps TerrainMovementCostCalculator and adds GAME policy:

  • Land units cannot traverse water provinces
  • Uses terrain movement costs from terrain.json5

For naval units, create NavalUnitCostCalculator that blocks land instead.

LedgerUI

STARTERKIT - Ledger panel showing data for all countries. Displays country name, provinces, units, gold in a sortable table. Toggle with L key or button.

LobbyUI

STARTERKIT - Lobby UI for multiplayer mode selection. Shows connected players and allows host to start the game. Players can click the map to select their country.

ModifierTypeHelper

Helper methods for modifier types

NetworkInitializer

STARTERKIT - Initializes multiplayer networking. Wires up transport, manager, and bridge to CommandProcessor. Handles lobby flow: mode selection → lobby → game start.

PlayerState

Simple player state storage for StarterKit. Tracks which country the player controls.

ProvinceHistoryData

Cold data storage for a single province's history. Uses CircularBuffer to prevent unbounded memory growth.

Access pattern: Loaded on-demand when player clicks province. NOT accessed every frame - this is the key distinction from hot data.

ProvinceHistorySystem

STARTERKIT: Tracks province ownership history. Demonstrates Pattern 4: Hot/Cold Data Separation.

  • Hot data: ProvinceState.ownerID (accessed every frame, 2 bytes)
  • Cold data: ProvinceHistoryData (accessed on-demand when viewing province)

This system:

  • Subscribes to ProvinceOwnershipChangedEvent
  • Records ownership changes to cold storage
  • Provides on-demand access to history when UI needs it

Memory is bounded via CircularBuffer (last N changes per province).

ProvinceInfoPresenter

STARTERKIT - Province info presenter (stateless data formatting) Pattern: UI Presenter Pattern - Presenter Component

Responsibilities:

  • Query GameState for province data
  • Format data for display
  • Update UI element contents
ProvinceInfoUI

STARTERKIT - Province information panel (Pure View) Pattern: UI Presenter Pattern - View Component

Architecture:

  • ProvinceInfoUI (this file) - Pure view (UI creation, show/hide)
  • ProvinceInfoPresenter - Presentation logic (data formatting)
ResourceBarUI

STARTERKIT - Simple resource bar. Shows gold at top of screen, hidden until country selected.

StarterKitPanel

STARTERKIT - Base class for StarterKit UI panels. Extends ENGINE's BasePanel with:

  • GameState reference
  • EventBus subscription management (CompositeDisposable)
  • USS stylesheet loading
  • Common styling constants

Usage:

  1. Inherit from StarterKitPanel
  2. Override CreateUI() to build your panel
  3. Call base.Initialize(gameState) to set up
  4. Use Subscribe() for event subscriptions (auto-disposed)
TimeUI

STARTERKIT - Simple time control UI. Shows date/time, pause button, and speed buttons. Positioned in top-left corner.

In multiplayer: Only the host can pause/unpause and change speed. Clients see the display but controls are disabled.

ToolbarUI

STARTERKIT - Simple toolbar with common actions. Positioned in top right corner. Shows: Ledger, Map Mode, Save, Load buttons. Hidden until player selects a country.

Demonstrates: UI integration with map mode system (ENGINE mechanism, GAME policy)

UnitInfoUI

STARTERKIT - Unit information panel Shows units in the selected province with option to create new units. Movement logic is handled by UnitMoveHandler.

UnitMoveHandler

STARTERKIT - Handles unit movement mode for UnitInfoUI. Extracted to keep UnitInfoUI focused on display concerns.

UnitSystem

Simple military unit system. Wraps Core.Units.UnitSystem and provides unit type loading.

UnitType

Simple unit type definition. Lighter weight than GAME layer's UnitDefinition.

UnitVisualization

Unit visualization. Renders unit count badges at province centers using GPU instancing. Uses BillboardAtlasGenerator for number display (0-99).

Structs

BuildingConstructedEvent

Emitted when a building is constructed. UI subscribes to refresh building lists, income displays, etc.

BuildingModifier

Building modifier definition (loaded from JSON5).

GoldChangedEvent

STARTERKIT - Events for UI updates and cross-system communication. Uses EventBus pattern (zero-allocation structs).

OwnershipRecord

STARTERKIT: Province ownership history record. Demonstrates Pattern 4: Hot/Cold Data Separation.

This is COLD DATA - only accessed when viewing province details, not every frame like ProvinceState (hot data).

PlayerCountrySelectedEvent

Fired when player selects a country and clicks Start. Game layer can subscribe to this to initialize game-specific systems.

ProvinceBuildingData

Tracks buildings in a province.

Enums

LobbyState

Lobby UI states.

ModifierType

STARTERKIT: Modifier type IDs for the modifier system. Maps string keys from JSON5 data files to ushort IDs for the Engine ModifierSystem.

Convention:

  • Keys ending in "_modifier" are multiplicative (percentage bonus)
  • Keys ending in "additive" or "monthly" are additive (flat bonus)

Usage: modifierSystem.AddProvinceModifier(provinceId, ModifierSource.CreatePermanent( ModifierSource.SourceType.Building, buildingId, (ushort)ModifierType.LocalIncomeModifier, value, isMultiplicative: true ));