Skip to content

Combat System

Edoardo BAROLO edited this page Jun 16, 2026 · 3 revisions

Combat System

Full documentation (part of 3,193-line technical analysis) in docs/TECHNICAL_ANALYSIS.md.

Overview

Turn-based tactical combat on a 12×24 grid with:

  • 24 unit slots: 4 player mechs + 8 enemy infantry + 12 enemy mechs
  • 8-direction movement: Tile cost-based, skill-gated LoS
  • 2D6 to-hit: Modified by skill, terrain, heat, story state
  • Line of Sight: Ray-cast using 8-direction vectors
  • Fog of War: Twin 12×24 grids with LoS clearing
  • Heat system: Pool-based, cap 30, penalty at threshold
  • Ammo: 10 bins per mech, per-missile for LRM/SRM

Combat Flow

  1. Init: Populate enemies, zero fog grid, set mode flag
  2. Turn loop: Iterate 24 unit slots
  3. AI target selection: Scan story state properties for valid targets
  4. Movement: Pathfind toward target
  5. Fire phase: LoS check → to-hit roll → hit location → damage → cleanup
  6. Post-combat: Story state update, mode transition

To-Hit Formula

TN = 4 + terrain_mod + heat_penalty + skill_mod + range_mod + cover_mod

Roll 2D6 ≥ TN to hit. Damage grouped for cluster weapons. Hit location via lookup table.

AI System

  • Preference table for target selection
  • Stage counter dispatch
  • Validates story state bytes for engagement logic

Rebuild Status

The combat system is Phase 4 in the Godot rebuild — implemented (June 2026). See BattleTechCHI/Scripts/Combat/ for the C# implementation, and Rebuild-Progress for details.

Clone this wiki locally