OverviewFilesCommitsIssuesDocsReleasesPeers

terrain-lookdev commits / 02810f2

gate_dc_vs_lookdev: read the BLOCK path from the map as well
It hardcoded diffusion_gully_30km.hblk while the map moved to the 122.88 km block — the two halves would have compared different terrain and reported it as an engine/lookdev disagreement. Exactly the failure this function was written to fix, one field further along.
02810f21124601d44930c1e139613afad16ecdb2
by plankatron <fleeky@gmail.com> · 2026-09-02T15:03:27.000Z

Changed files (1) +11 -0

gate_dc_vs_lookdev.py +11 -0
……@@ -47,6 +47,17 @@ def map_params():
4747 raise SystemExit(f"cannot read {name} from {MAP_GD}")
4848 return float(m.group(1))
4949
50 # The BLOCK, read from the map too. Hardcoding it here is how the two
51 # halves end up on different terrain — the same class of bug as the
52 # parameters this function exists to read.
53 m = re.search(r'^const HEIGHTFIELD\s*:=\s*"res://([^"]+)"', src, re.M)
54 if not m:
55 raise SystemExit("cannot read HEIGHTFIELD from " + MAP_GD)
56 global HBLK
57 HBLK = os.path.abspath(os.path.join(os.path.dirname(MAP_GD), "..", "..", m.group(1)))
58 if not os.path.exists(HBLK):
59 raise SystemExit("map's heightfield not on disk: " + HBLK)
60
5061 floor_y, ceil_y = const("FLOOR_Y"), const("CEILING_Y")
5162 th, cell = const("TERRAIN_HEIGHT"), const("EROSION_CELL_SCALE")
5263 gully, depth = const("EROSION_GULLY_METRES"), const("EROSION_DEPTH_METRES")