test(@projects/@magic-civilization): 📸 add tiered city and border tests

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-10 21:54:06 -07:00
parent 815a492fbd
commit 87b5bc287a
3 changed files with 144 additions and 0 deletions

View file

@ -264,6 +264,147 @@ func _ready() -> void:
# Final tableau — every unit in player colors visible
await _capture("25_final_tableau_wide", "fit")
# ── ACT VII: Population tier sweep (procedural city texture scales) ────
# Re-pop P1 capital across pop tiers so the procedural city silhouette
# walks through every tier (1→3→5→7→10).
_c1.set_population(1)
await _capture("26_capital_pop1", "focus", _p1_pos, 5.0)
_c1.set_population(3)
await _capture("27_capital_pop3_again", "focus", _p1_pos, 5.0)
_c1.set_population(5)
await _capture("28_capital_pop5", "focus", _p1_pos, 5.0)
_c1.set_population(7)
await _capture("29_capital_pop7_again", "focus", _p1_pos, 5.0)
_c1.set_population(10)
await _capture("30_capital_pop10", "focus", _p1_pos, 5.0)
# ── ACT VIII: Border ring sweep — claim rings 1..4 in sequence ─────────
# Fresh small city to show borders growing without other state.
if _game_map.tiles.has(_p2_pos):
var c4: CityScript = CityScript.new("clan1_eastern")
c4.owner_index = 0
c4.position = _p2_pos + Vector2i(4, 0)
c4.city_name = "Karak Var"
c4.set_population(2)
_p1.cities.append(c4)
var east_pos: Vector2i = c4.position
await _capture("31_eastern_city_founded", "focus", east_pos, 6.0)
for t: Vector2i in _hex_ring(east_pos, 1):
c4.add_tile(t.x, t.y)
await _capture("32_eastern_borders_r1", "focus", east_pos, 6.0)
for t: Vector2i in _hex_ring(east_pos, 2):
c4.add_tile(t.x, t.y)
await _capture("33_eastern_borders_r2", "focus", east_pos, 8.0)
for t: Vector2i in _hex_ring(east_pos, 3):
c4.add_tile(t.x, t.y)
await _capture("34_eastern_borders_r3", "focus", east_pos, 10.0)
for t: Vector2i in _hex_ring(east_pos, 4):
c4.add_tile(t.x, t.y)
await _capture("35_eastern_borders_r4", "focus", east_pos, 12.0)
# ── ACT IX: Unit-role variety — every procedural silhouette ───────────
# Spawn one of each canonical role near the eastern city so the
# procedural overlay paints distinct shapes per role.
var role_pos: Vector2i = _p2_pos + Vector2i(4, 2)
var roles: Array[String] = [
"dwarf_warrior", "dwarf_archer", "dwarf_scout", "dwarf_worker",
"dwarf_founder", "dwarf_wagon", "dwarf_cavalry", "dwarf_siege",
]
var role_index: int = 0
for role: String in roles:
var rpos: Vector2i = role_pos + Vector2i(role_index % 4, role_index / 4)
if _game_map.tiles.has(rpos):
var ru: UnitScript = UnitScript.new(role, 0, rpos)
ru.id = "role_%s_%d" % [role, role_index]
_p1.units.append(ru)
role_index += 1
await _capture("36_role_catalog", "focus", role_pos, 7.0)
# ── ACT X: HP-bar sweep — wounded units across damage tiers ───────────
# Damage 4 P1 army units to 100/75/50/25/5 HP and snap to show the
# unit_renderer HP-bar gradient.
var damage_units: Array = []
for u_v: Variant in _p1.units:
var uu: UnitScript = u_v as UnitScript
if uu != null and uu.id.begins_with("p1_army_"):
damage_units.append(uu)
if damage_units.size() >= 4:
break
var hp_tiers: Array[int] = [75, 50, 25, 5]
for i: int in damage_units.size():
if i < hp_tiers.size():
(damage_units[i] as UnitScript).hp = hp_tiers[i]
await _capture("37_wounded_army_hp_tiers", "focus", _p1_pos, 7.0)
# Same sweep, zoomed to a single unit so the HP bar is legible.
if damage_units.size() > 0:
var critical_unit: UnitScript = damage_units[damage_units.size() - 1] as UnitScript
await _capture("38_critical_unit_close", "focus", critical_unit.position, 3.0)
# ── ACT XI: City HP sweep (siege damage tiers) ────────────────────────
_c1.set_hp(80)
await _capture("39_capital_hp80", "focus", _p1_pos, 5.0)
_c1.set_hp(40)
await _capture("40_capital_hp40", "focus", _p1_pos, 5.0)
_c1.set_hp(10)
await _capture("41_capital_hp10_siege", "focus", _p1_pos, 5.0)
_c1.set_hp(100)
# ── ACT XII: Multi-empire — give P2 a fresh capital recovery + units ──
if _game_map.tiles.has(_p2_pos + Vector2i(0, 6)):
var p2_recovery_pos: Vector2i = _p2_pos + Vector2i(0, 6)
var c5: CityScript = CityScript.new("clan2_refuge")
c5.owner_index = 1
c5.position = p2_recovery_pos
c5.city_name = "Khazad Refuge"
c5.set_population(3)
_p2.cities.append(c5)
for t: Vector2i in _hex_ring(p2_recovery_pos, 1):
c5.add_tile(t.x, t.y)
# Spawn 3 fresh P2 warriors to show the comeback empire.
for j_def: int in range(3):
var def_pos: Vector2i = p2_recovery_pos + Vector2i(j_def + 1, 0)
if _game_map.tiles.has(def_pos):
var du: UnitScript = UnitScript.new("dwarf_warrior", 1, def_pos)
du.id = "p2_recovery_%d" % j_def
_p2.units.append(du)
await _capture("42_p2_recovery_zoomed", "focus", p2_recovery_pos, 7.0)
await _capture("43_two_empires_after_war", "fit")
# ── ACT XIII: Mega-empire — six P1 cities on a diagonal ───────────────
var mega_origin: Vector2i = _p1_pos + Vector2i(0, 6)
for k: int in range(5):
var mc_pos: Vector2i = mega_origin + Vector2i(k * 2, k)
if _game_map.tiles.has(mc_pos):
var mc: CityScript = CityScript.new("clan1_outpost_%d" % k)
mc.owner_index = 0
mc.position = mc_pos
mc.city_name = "Karak %d" % (k + 1)
mc.set_population(2 + k)
_p1.cities.append(mc)
for t: Vector2i in _hex_ring(mc_pos, 1):
mc.add_tile(t.x, t.y)
await _capture("44_mega_empire_wide", "fit")
await _capture("45_mega_empire_zoomed", "focus", mega_origin, 16.0)
# ── ACT XIV: Fortified line — fortify 6 units to show posture ─────────
var fortify_count: int = 0
for u_fv: Variant in _p1.units:
var uf: UnitScript = u_fv as UnitScript
if uf == null:
continue
uf.is_fortified = true
fortify_count += 1
if fortify_count >= 6:
break
await _capture("46_fortified_line", "fit")
# ── ACT XV: Conquest-restore — final tableau with everything visible ─
_c1.set_population(10)
_c1.set_hp(100)
await _capture("47_final_celebration_wide", "fit")
await _capture("48_final_celebration_capital", "focus", _p1_pos, 8.0)
print("gameplay_arc: %d frames captured" % _captured)
get_tree().quit()

View file

@ -39,6 +39,7 @@ func _ready() -> void:
get_viewport().size = Vector2i(1280, 720)
DisplayServer.window_set_size(Vector2i(1280, 720))
DataLoader.load_theme("age-of-dwarves")
ThemeAssets.set_theme("age-of-dwarves")
await get_tree().process_frame
_notification = TurnNotificationScene.instantiate()

View file

@ -16,6 +16,8 @@ func _ready() -> void:
RenderingServer.set_default_clear_color(Color(0.08, 0.06, 0.05))
get_viewport().size = Vector2i(1920, 1080)
DisplayServer.window_set_size(Vector2i(1920, 1080))
DataLoader.load_theme("age-of-dwarves")
ThemeAssets.set_theme("age-of-dwarves")
var env_name: String = OS.get_environment("SCREENSHOT_NAME")
if not env_name.is_empty():