Complete combat and AI overhaul for XCOM 2: War of the Chosen.
Transforms XCOM 2 into a tactical chess match with predictable calculations, adaptive AI, and zero performance impact.
ChronoCOM implements the WASP (Workload-Aware Sufficient Placement) framework for real-time tactical AI decision-making.
Dataset & Workload
- D (Dataset): Set of all possible tactical game states — unit positions, health, cover, abilities, influence fields
- W (Workload):
- Q1: "Given a unit's tactical situation, choose the best ability and target"
- Q2: "Given a world position, evaluate its tactical value (cover, threat, influence)"
- Q3: "Given a turn boundary, update influence fields and invalidate stale caches"
Encoding Tuple (k, E, I, T, {F_q}):
| Symbol | ChronoCOM Mapping |
|---|---|
| k = 4 | Spatial state, Unit state, Influence fields, Temporal state |
| E(r) | (32×32 grids + tile class, TacticalSituation hash + hit cache, 4 influence grids [1024 floats], turn/frame/AdaptiveMemory) |
| I(c) | InfluenceField grids, TileScoringCache, VisibilityCache, AIDecisionCache, TacticalPrecalculation |
| T(q) | BT_InitGenericAbilities (Q1), SampleInfluence + GetTacticalGradient (Q2), UpdateInfluenceField (Q3) |
| {F_q} | Confidence threshold >=70, grid bounds check, cache age filter (MAX_CACHE_AGE=5), dirty flags |
WASP Guarantees:
- Sufficiency: Ans(q) ⊆ Cand(q) — 4 dimensions capture all tactical AI decision inputs; no game-state aspect is unrepresented
- Exactness: F_q(Cand(q)) = Ans(q) — confidence thresholds + cache invalidation ensure current-state decisions
- Bounded Work: Work(q) <= gamma * |Ans(q)| + beta — all spatial queries O(1) via 32×32 grid; decision cache O(1) via hash
- Minimality: Each dimension carries unique tactical information; removing any loses capability
ChronoCOM AI must answer three query classes:
- Q1 (Ability Selection): Given a unit's TacticalSituation, select the optimal ability and target
- Q2 (Position Evaluation): Given world coordinates, compute tactical gradient (threat, danger, control, interest)
- Q3 (State Maintenance): Given a turn/frame boundary, propagate dirty flags and rebuild stale caches
Four dimensions encode the tactical game state:
- Spatial (positions, cover, elevation): 32×32 influence grids (GRID_CELL_SIZE=384 world units), tile classifications from TacticalPrecalculation
- Unit (HP, abilities, action points): TacticalSituation struct hashed to int for cache keying
- Influence (threat, danger, control, interest): 4 InfluenceField grids with decay rates, each 1024 floats
- Temporal (turn number, cache validity, adaptive memory): AdaptiveMemory pattern buckets, frame-based cache ages
Pre-computed and cached data structures:
InfluenceField.GridValues[1024]: Flattened 32×32 grid, O(1) spatial read viaSampleInfluenceVisibilityCache: (ShooterID, TargetID) → LoS result, frame-validatedAIDecisionCache: TacticalSituation hash → (ability, target, confidence)TacticalPrecalculation: Mission-start tile classification and zone distances (Phase 3 front-loaded at load screen)TileScoringCache: Pre-evaluated tile tactical values
- T(q):
BT_InitGenericAbilitieschecks decision cache first (O(1)), falls back to full BT evaluation only on cache miss.SampleInfluencereads grid at quantized position.GetTacticalGradientsamples 4 neighbors for directional gradient. - {F_q}:
CONFIDENCE_THRESHOLD=70filters low-quality cached decisions. Grid bounds check returns 0.0 for out-of-bounds.MAX_CACHE_AGE=5filters stale LoS data. Dirty flags (bNeedsUpdate) filter stale unit data.
The AI's tactical decisions are fully determined by:
- Spatial state (where everything is and what's visible)
- Unit state (capabilities and condition)
- Influence fields (accumulated tactical intelligence)
- Temporal state (adaptation and cache validity)
This is the MSS for tactical AI: the smallest state that can answer any query about what the AI should do.
| # | Claim | Category | Enforcement |
|---|---|---|---|
| D1 | Spatial state = positions + cover + elevation | Definition | — |
| D2 | Unit state = HP + abilities + AP + ammo | Definition | — |
| D3 | Influence field = 32×32 float grid with decay | Definition | — |
| D4 | Temporal state = turn counter + cache frame + AdaptiveMemory | Definition | — |
| G1 | All spatial queries O(1) via grid quantization | Guarantee | Fixed 32×32 grid; SampleInfluence is array index |
| G2 | Decision cache O(1) lookup via hash | Guarantee | Hash-based GetCachedDecision |
| G3 | Influence field update O(1024) = O(1) constant | Guarantee | Fixed grid size iteration |
| G4 | Cyclomatic complexity <= 4 per function | Guarantee | Documented per function; code review enforced |
| G5 | Cache invalidation on unit movement | Guarantee | MarkUnitDirty called on state changes |
| G6 | Overwatch zone test is O(1) (dot product) | Guarantee | Geometric cone test |
| A1 | 4 dimensions sufficient for emergent AI behavior | Assumption | Demonstrated by gameplay; no formal proof |
| A2 | Confidence threshold of 70 filters bad decisions | Assumption | Tuned empirically |
| A3 | Grid cell size of 384 (4 tiles) is optimal | Assumption | Chosen for balance |
| A4 | Perceptual O(1) via time-reordered computation | Assumption | Camera-based priority; depends on viewing angle |
| A5 | Adaptive memory detects player patterns | Assumption | Bucket-based heuristic; accuracy not formally measured |
| U1 | Actual gamma, beta bounds for Q1 | Unknown | Need profiling under real gameplay |
| U2 | Optimal influence decay rates | Unknown | Current values tuned by feel |
- XCOM 2: War of the Chosen
- X2WOTCCommunityHighlander v1.30.4+
- Subscribe via Steam Workshop or extract to
XCOM 2\XComGame\Mods\ChronoCOM\ - Enable in XCOM 2 Mod Launcher
- Start new campaign or continue existing saves
- Compatible with most AI mods (uses ModClassOverride)
- Works with existing saves
- Incompatible with other accuracy overhaul mods
ChronoCOM uses a hybrid ModClassOverride + template replacement approach for maximum compatibility and performance.
Technical Approach:
- ModClassOverride for AI behavior (engine-level compatibility)
- Template replacement for combat systems (selective modification)
- 32×32 influence grids for spatial reasoning
- Comprehensive caching system for constant-time operations
See docs/README.md for complete documentation index.
Report issues via GitHub Issues. Check logs in Launch.log for ChronoCOM: entries.
Apache-2.0 © 2026 Jacob Coleman — See LICENSE for details.