Namespace Core
Classes
- EngineInitializer
ENGINE LAYER: Master coordinator for engine initialization and data loading Orchestrates the complete loading pipeline from files to ready-to-play state Performance: Target <5 seconds for 10k provinces, <100MB memory during loading
- EventBus
High-performance event bus for decoupled system communication Features: Type-safe events, zero-allocation processing, frame-coherent batching Performance: ZERO allocations during gameplay (no boxing), batch event processing
Architecture: Uses typed EventQueue{T} wrapper to avoid boxing and reflection See: Assets/Archon-Engine/Docs/Engine/data-flow-architecture.md
- GameSettings
ScriptableObject configuration for game initialization and data loading. Access via GameSettings.Instance after initialization.
- GameState
Central hub for all game data access - follows hub-and-spoke architecture Provides unified access to all game systems without owning the data Performance: All queries should be <0.01ms, zero allocations during gameplay
ARCHITECTURE: Engine-Game Separation
- Core systems (Provinces, Countries, Time) are owned by Engine
- Game layer systems (Economy, Buildings, etc.) register themselves via RegisterGameSystem
- Engine provides mechanism (registration), Game provides policy (specific systems)
- GameStateSnapshot
ENGINE - Double-buffer pattern for zero-blocking UI reads
Problem: UI needs province data without blocking simulation Victoria 3 uses locks → "waiting" bars in profiler
Solution: Double-buffer (two NativeArrays)
- Simulation writes to buffer A
- UI reads from buffer B
- After tick: swap pointers (O(1), not memcpy!)
Memory: 2x hot data (~160KB for 10k provinces at 8 bytes) Performance: O(1) pointer swap (no copying!) Staleness: Zero (UI reads completed tick)
Pattern from Paradox analysis:
- Victoria 3 locks = bad (waiting bars)
- Snapshots = good (zero blocking)
- Double-buffer = optimal (no memcpy overhead)
- ReadOnlyAttribute
ReadOnly attribute for inspector display
Structs
- GameSettings.ValidationResult
Result of path validation
- GameStateInitializedEvent
Core events for GameState lifecycle
- SimulationDataReadyEvent
Emitted when all simulation data is loaded and ready for presentation Allows presentation layer (MapGenerator, UI) to initialize without creating dependencies
Interfaces
- IGameEvent
Base interface for all game events. Events MUST be structs (not classes) to avoid heap allocations during gameplay. The EventBus uses generic EventQueue<T> which keeps events as value types throughout, ensuring zero boxing and zero GC pressure.
Enums
- LogLevel
Logging verbosity level for all engine and game systems.