Skip to content

Skirmish — state and globals#

Summary#

Skirmish mode is a parallel game state layered on the campaign engine. The primary discriminator is DAT_0057a0f0 (proposed lotr2_skirmish_active). Secondary flags select wizard routing, battle type, and MP behavior.

Confidence: likely for state machine; globals confirmed at listed VAs (GoG export).


State machine#

stateDiagram-v2
  [*] --> Gateway: intro complete
  Gateway --> SetupSP: step 0xc DAT_00553030=0
  Gateway --> SetupMP: step 0xb DAT_00553030=1
  SetupSP --> BattleReady: FUN_004329ec
  SetupMP --> BattleReady: all ready FUN_004329ec
  BattleReady --> InBattle: combat screen DAT_0057a0f0=1
  InBattle --> ScoreInterim: battle end screen 0x2e
  ScoreInterim --> Score1: screen .
  Score1 --> Score2: screen /
  Score2 --> SetupSP: rematch FUN_0042b780
  Score2 --> GatewayShell: DAT_0053f0c4 in 10,11 screen 0x1c
  GatewayShell --> Gateway: FUN_004329ec map rot
  Gateway --> [*]: map_index ge 8

Core globals#

Proposed name GoG global Type Role
lotr2_skirmish_active DAT_0057a0f0 int 1 = skirmish session (not campaign map)
lotr2_skirmish_game_type DAT_0057cb38 int 1 = SIGS GameType Skirmish
lotr2_skirmish_battle_type DAT_0053e91c int 0/1 field, 2 siege, 3 custom
lotr2_skirmish_scenario_index DAT_0056d590 int Selected scenario 0..n-1
lotr2_skirmish_scenario_scroll DAT_0053f64c int List scroll offset
lotr2_skirmish_scenario_count DAT_0053f0d4 int 10 / 10 / 15 / 20 by type
lotr2_skirmish_map_index DAT_0053f258 int Map table slot 0–7 (+wrap)
lotr2_skirmish_custom_map DAT_0056899c int Custom map UI + skircust.pl8
lotr2_skirmish_attacker_slot DAT_0053ef5c int Player slot of attacker
lotr2_skirmish_post_battle_tag DAT_0053f0c4 int 0 / 10 / 11 gateway return
lotr2_skirmish_siege_active DAT_0053e8fc int 1 during siege type
lotr2_skirmish_army_tier_left DAT_00553da4 byte Army size tier 1–3
lotr2_skirmish_army_tier_right DAT_00553dd0 byte Opponent tier 1–3

Wizard / session globals#

Global Role
DAT_005530f0 Wizard step (0xb / 0xc skirmish)
DAT_0055302c Game kind: 3 = skirmish branch
DAT_00553030 0 SP, 1 MP
DAT_00553248 SIGS MP connected
DAT_00568464 SIGS initialized
DAT_005533e0[slot] MP ready per player
DAT_0056d5cc Opponent player slot
DAT_00553114 Selected menu row
DAT_0053f648 Confirmed menu row
DAT_0057d320 Quick-load flag (bypass skirmish when 1)

Screen modes (skirmish-relevant)#

Char Hex Name
' ' 0x00 Game shell / map (unused in skirmish)
'+' 0x29 In battle
'.' 0x2e Score page 1
'/' 0x2f Score page 2
'\\x1c' 0x1c Gateway return
'\\x1f' 0x1f Wizard

Interim post-battle: 0x2e (46 decimal) before '.'.


Army / battle globals#

Global Role
DAT_00568210 Attacker army record index
DAT_00568218 Defender army record index
DAT_00553efc Attacker player index for UI
DAT_00553f34 Defender player index for UI
DAT_00516ac0 Parsed unit count cube from TROOPS*.ENG
DAT_0053f640 Custom map table selector (0=preset, 1=custom rows)
DAT_0057c910 Active siege map id
lotr2_game_active_view 2 = battle view

Transitions that clear skirmish#

DAT_0057a0f0 = 0 when:

  • Wizard cancel to main menu (FUN_00433155 turn_phase 1)
  • Campaign load path in lotr2_game_sim_tick (non-skirmish init)
  • Explicit teardown in gateway handlers

Rename status#

Globals remain DAT_* in src/Lords2-gog.exe.c. Proposed names above should be applied in a future Ghidra rename pass; until then cite both in evidence docs.


Evidence#

See evidence.md for function cross-reference.