# assert_worldgen.txt — Field-level assertions for the WorldGen smoke test.
#
# Each non-comment, non-blank line is a "field = expected_value" assertion.
# check_save_fields looks up the field in the dump and compares values.
#
# Why assertions instead of full-file comparison
#
# The save format is fixed-size and reserves slots/padding for content that
# isn't populated yet (unused hero slots, item slots, struct padding bytes).
# Those bytes come from whatever the OS handed back at allocation time and
# vary run-to-run.  Whole-file or whole-field comparison is therefore not a
# valid test design — it would only "work" under MSVC Debug because the
# Debug allocator deterministically fills with 0xCD; the moment you switch
# to Release, the latent non-determinism surfaces.
#
# This test instead asserts the fields the game actually reads back: world
# parameters, the five wizard identities, their starting cities and units,
# and a handful of player-banner counts.  Anything not listed here is
# deliberately left unconstrained.
#
# Inputs that produce these values:
#   --newgame  assets/test_worldgen.ini   (seed=12345, 5 wizards, etc.)
#   --scenario assets/test_worldgen_smoke.hms
#
# When wizard generation, world layout, or starting-city/unit logic
# intentionally changes, regenerate via:
#   tools/regenerate_goldens.sh
# inspect the resulting tests/golden_worldgen_seed12345.txt, and update the
# expectations below.

# =============================================================================
# Game-level state
# =============================================================================

game.num_players = 5
game.landsize = 2
game.magic = 1
game.difficulty = 2
# cities and units now include neutral cities and their garrisons from
# Generate_Neutral_Cities(); the 5 wizard capitals are only part of these totals.
# (counts move whenever world-gen changes — just regenerate, don't hand-edit)
game.cities = 33
game.units = 52
game.turn = 0
game.unit = 0

# =============================================================================
# Wizards (player[0]: human "Rjak"; players 1-4: AI; player[5]: neutral)
# =============================================================================

player[0].name = Rjak
player[0].wizard_id = 6
player[0].capital_race = 12
player[0].banner_id = 4
player[0].fame = 0

player[1].name = Kali
player[1].wizard_id = 13
player[1].capital_race = 5
player[1].banner_id = 0

player[2].name = Tauron
player[2].wizard_id = 8
player[2].capital_race = 11
player[2].banner_id = 3

player[3].name = Sss'ra
player[3].wizard_id = 7
player[3].capital_race = 2
player[3].banner_id = 1

player[4].name = Merlin
player[4].wizard_id = 0
player[4].capital_race = 7
player[4].banner_id = 2

# =============================================================================
# Wizard capital cities — one per wizard.  Generate_Neutral_Cities() also places
# neutral cities; only the 5 capitals are asserted here.
# =============================================================================

# NONDET city[0].name -- the human capital is unnamed at worldgen (the player names
# it later; cf. "Claudesville" in the continue test).  Under Release this buffer is
# uninitialized and varies run-to-run (observed: Xanten, Gotartop, Charack).  Every
# other city name IS deterministic, so this is specific to the human capital slot.
# city[0].name = Xanten
city[0].owner_idx = 0
city[0].race = 12
city[0].wx = 18
city[0].wy = 24

city[1].name = Trier
city[1].owner_idx = 1
city[1].race = 5
city[1].wx = 51
city[1].wy = 11

city[2].name = Isseme
city[2].owner_idx = 2
city[2].race = 11
city[2].wx = 36
city[2].wy = 12

city[3].name = Nightwath
city[3].owner_idx = 3
city[3].race = 2
city[3].wx = 45
city[3].wy = 14

city[4].name = Avalon
city[4].owner_idx = 4
city[4].race = 7
city[4].wx = 40
city[4].wy = 30

# =============================================================================
# Starting units — two per wizard, paired as unit[N] (first) and unit[N+5]
# (second) for player N.  unit[10..11] are the neutral (owner 5) garrison.
# Generate_Neutral_Cities() adds further neutral-city garrisons (units 12+),
# which are intentionally left unconstrained.
# =============================================================================

# Player 0 — Rjak (human)
unit[0].owner_idx = 0
unit[0].type = 137
unit[0].wx = 18
unit[0].wy = 24
unit[0].status = 0

unit[5].owner_idx = 0
unit[5].type = 138
unit[5].wx = 18
unit[5].wy = 24

# Player 1
unit[1].owner_idx = 1
unit[1].type = 83
unit[1].wx = 51
unit[1].wy = 11
unit[1].status = 0

unit[6].owner_idx = 1
unit[6].type = 84
unit[6].wx = 51
unit[6].wy = 11

# Player 2
unit[2].owner_idx = 2
unit[2].type = 127
unit[2].wx = 36
unit[2].wy = 12
unit[2].status = 0

unit[7].owner_idx = 2
unit[7].type = 128
unit[7].wx = 36
unit[7].wy = 12

# Player 3
unit[3].owner_idx = 3
unit[3].type = 57
unit[3].wx = 45
unit[3].wy = 14
unit[3].status = 0

unit[8].owner_idx = 3
unit[8].type = 58
unit[8].wx = 45
unit[8].wy = 14

# Player 4
unit[4].owner_idx = 4
unit[4].type = 95
unit[4].wx = 40
unit[4].wy = 30
unit[4].status = 0

unit[9].owner_idx = 4
unit[9].type = 96
unit[9].wx = 40
unit[9].wy = 30

# Player 5 — neutral starting garrison
unit[10].owner_idx = 5
unit[10].type = 85
unit[10].wx = 19
unit[10].wy = 33

unit[11].owner_idx = 5
unit[11].type = 85
unit[11].wx = 19
unit[11].wy = 33
