Skip to content

High-performance grand strategy game engine for Unity, with deterministic simulation & GPU-accelerated rendering

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

ForgottenHistory/Archon-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archon Engine

A Unity-based game engine for grand strategy games, built around a dual-layer architecture that separates deterministic simulation from GPU-accelerated presentation.

Archon-Engine

APIs should be stable by 2026 Q1. Until a release pops up, production use is discouraged. Free open-source game demo will be released in 2026 Q2 to showcase practical integration.

GAME DATA IS NOT PROVIDED IN PROJECT!

There is no "How To Get Started" guide yet, partly because I'm trying to figure how to get it going too. It's not exactly a small project to develop nor work with. I'll try my best to create something eventually however expect this to be a complex project and it should be treated as such.

Quick Links:

Documentation is extensive and I try to keep it up to date. However expect some sloppyness.

Flat-Map 2D map loaded using Europa Universalis 4 data.

Why

Grand strategy is notorious for being extremely complex. Even for experienced studios it's a daunting task to set everything up. It essentially has given monopoly to Paradox, with only exceptionally few coming close to their quality and scale. And for good reason.

Some extreme hurdles for Paradox-like grand strategy:

  • Vector like graphics to scale infinitely
  • Create beautiful maps from simple bitmaps/pngs
  • Fixed-Point arithmetic & deterministic simulation
  • Data oriented design (not OOP)
  • AI, Diplomacy, Military, Economy as core pillars
  • Modifiers, resources, relations, unit movements, sparse storage
  • Modding capability

I could go on.

Archon-Engine is designed to be generic infrastructure, providing everything you need from day 1. You can focus on creating content rather than researching the 1% topics barely anyone knows about.

This not a dunk on Paradox. I love their games. I just wish they didn't lag so goddamn much.

Core Architecture

Dual-Layer Design

┌─────────────────────────────────┐
│   Map Layer (Presentation)      │
│   - Texture-based rendering      │
│   - GPU compute shaders          │
│   - Single draw call             │
└───────────┬─────────────────────┘
            │ Events (one-way)
            ↓
┌─────────────────────────────────┐
│   Core Layer (Simulation)       │
│   - 8-byte province structs      │
│   - Fixed-point deterministic    │
│   - Command pattern              │
└─────────────────────────────────┘

Key Design Decisions

  • Fixed-size data: 8-byte ProvinceState structs prevent late-game performance degradation
  • Deterministic math: Fixed-point calculations (no floats) for multiplayer-ready simulation
  • Texture-based map: Provinces rendered as pixels, not GameObjects (single draw call)
  • GPU compute shaders: All visual processing (borders, effects) on GPU
  • Command pattern: All state changes go through commands for determinism and networking
  • Zero allocations: Hot paths use pre-allocated memory and value types

What Makes This Different

Memory Efficiency:

  • 8-byte province structs: 10,000 provinces = 80KB hot data
  • Hot/cold data separation for cache-friendly access
  • Zero-allocation EventBus (99.99% allocation reduction)

Rendering Performance:

  • Single draw call for entire map
  • 3D MAP TO BE DETERMINED

Multiplayer-Ready Architecture:

  • Deterministic fixed-point math (no floats in simulation)
  • Command pattern for all state changes
  • Built for lockstep synchronization from day one

Tested with ~4,000 provinces:

  • Province updates: 0.24ms (target: <5ms)
  • EventBus: 0.85ms, zero allocations
  • Fixed-point math: 0.13ms for 10k calculations
  • Memory stability: Stable over 400+ simulated years

Structure

Assets/Archon-Engine/
├── Scripts/
│   ├── Core/           # Deterministic simulation layer
│   └── Map/            # GPU-accelerated presentation
├── Shaders/            # Compute shaders for rendering
└── Docs/
    ├── Engine/         # Architecture documentation
    ├── Planning/       # Future features
    └── Log/            # Development journal

Development Status

Core Engine (Complete):

  • Dual-layer architecture with hot/cold data separation
  • Province, Country, Diplomacy, Unit, and Pathfinding systems
  • Resource & modifiers system
  • Save/load system with command pattern
  • Zero-allocation EventBus and performance optimizations
  • AI system with goal-oriented behavior

Game Layer (In Progress):

As in, practical implementation of core systems.

  • Core pillars (Economy, Military, Diplomacy, AI)
  • Vector like borders, razor thin
  • 3D terrain tessallation and smart texturing for realistic terrain

early-3d-map Simple province terrain, auto terrain assignment from texture

Planned Features:

  • Multiplayer (lockstep command synchronization)
  • Modding API (C# scripting support)
  • Advanced AI

Documentation

Architecture:

Screenshots

early-3d-map WIP 3D map with texturing

Heightmap-example 3D tessallated terrain WIP.

Technical Requirements

  • Unity 2023.3+
  • Universal Render Pipeline (URP)
  • IL2CPP scripting backend
  • Burst Compiler enabled

License

MIT License - See LICENSE file for details.

About

High-performance grand strategy game engine for Unity, with deterministic simulation & GPU-accelerated rendering

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Contributors 2

  •  
  •