Skip to content

Behavioral specification#

Normative documentation of what Lords of the Realm 2 must do — sufficient for a clean-room reimplementation. Each page separates behavior from evidence and labels confidence.

Authoring rules#

  1. Use _template.md for new pages.
  2. Write normative rules in spec pages; keep symbol dumps in ../architecture/.
  3. Link evidence: architecture MODULE.md → structs → src/ symbols.
  4. Do not publish normative rules from speculative evidence.
  5. Update this index when adding pages.

Domains#

Domain Scope Index
Gameplay Turn system, economy, diplomacy, AI gameplay/README.md
Combat Battles, siege, figures, projectiles combat/README.md
Map Provinces, grid, movement, ownership map/README.md
UI Screens, dialogs, input, MP lobby ui/README.md
Data Config files, assets, tables data/README.md
Save Save/load, on-disk layout save/README.md
Networking Sessions, DirectPlay, app messages networking/README.md

Roadmap (write order)#

Full behavioral coverage is the goal. This order prioritizes gameplay foundations before wire-format details — understanding what messages mean requires knowing what they trigger.

Phase Focus Spec domain
1 Core loop: turn phases, screen mode machine gameplay/
2 Strategic map and economy map/, gameplay/
3 Tactical combat and siege combat/
4 AI and diplomacy gameplay/
5 UI flows and dialogs ui/
6 Data formats and saves data/, save/
7 Multiplayer and wire formats networking/, ../protocols/
flowchart LR
  P1["Phase 1: Core loop"]
  P2["Phase 2: Map + economy"]
  P3["Phase 3: Combat"]
  P4["Phase 4: AI + diplomacy"]
  P5["Phase 5: UI flows"]
  P6["Phase 6: Data + saves"]
  P7["Phase 7: Networking"]
  P1 --> P2 --> P3 --> P4 --> P5 --> P6 --> P7

Existing protocol documentation under ../protocols/ is retained and cross-linked from networking/. Networking is Phase 7 in the write order, not deprioritized for deletion.

Spec pages#

Page Domain Status
Auto-battle calculation Combat confirmed / likely
NPC battle AI Combat
Save file on-disk format Save confirmed
l2_maps.dat record layout Data
Population and peasant formulas Gameplay confirmed / likely