Add pawn scene and rescale map to 2m tiles, 0.5m steps #24

Merged
liamjd merged 7 commits from 22-add-pawn-scene into main 2026-08-18 20:25:33 +01:00
Owner

Summary

  • Adds a scripted-instantiation pawn (capsule stub) spawned via map.random_walkable_position() in game.gd, replacing a hardcoded scene transform that only worked for one seed at one tile size.
  • Rescales the map from 1m tiles / 0.25m height steps to 2m tiles / 0.5m height steps. The old defaults put the terrace step below human stride length (max_step_levels = 1 at 0.25m meant a pawn couldn't climb a 25cm kerb), and the 64m map was too small for the manual-haulage gameplay loop described in CLAUDE.md. Full rationale recorded on #22.
  • Fixes a walkability bug found while retuning: is_walkable() compared a tile's level against the datum directly instead of asking _kind_for(), which left 61-85% of a plains map (depending on seed) undrawn-but-unreachable.
  • Widens the camera's zoom range (min_zoom/max_zoom) so the larger 128m map can still be framed at all three yaw/pitch presets.
  • Fixes terrain shape-preset cycling, which had broken due to a reordered enum and shape resources missing a shape value.
  • Updates CLAUDE.md: Godot bumped to 4.7.2 (non-Mono build, now on PATH on both dev machines), and hardcoded desktop-only paths generalised so the doc works on the laptop too.

Test plan

  • addons/gut/gut_cmdln.gd full suite: 10/10 passing.
  • All four terrain presets (plains, island, crater, canyon) verified headed at the new tile scale.
  • Camera zoom verified headed at min/default/max levels against the 128m map.
  • No manual playtest of pawn pathfinding/movement yet — this only adds the stub capsule and spawn point, no controls.

Closes #22

🤖 Generated with Claude Code

## Summary - Adds a scripted-instantiation pawn (capsule stub) spawned via `map.random_walkable_position()` in `game.gd`, replacing a hardcoded scene transform that only worked for one seed at one tile size. - Rescales the map from 1m tiles / 0.25m height steps to **2m tiles / 0.5m height steps**. The old defaults put the terrace step below human stride length (`max_step_levels = 1` at 0.25m meant a pawn couldn't climb a 25cm kerb), and the 64m map was too small for the manual-haulage gameplay loop described in `CLAUDE.md`. Full rationale recorded on #22. - Fixes a walkability bug found while retuning: `is_walkable()` compared a tile's level against the datum directly instead of asking `_kind_for()`, which left 61-85% of a plains map (depending on seed) undrawn-but-unreachable. - Widens the camera's zoom range (`min_zoom`/`max_zoom`) so the larger 128m map can still be framed at all three yaw/pitch presets. - Fixes terrain shape-preset cycling, which had broken due to a reordered enum and shape resources missing a `shape` value. - Updates `CLAUDE.md`: Godot bumped to 4.7.2 (non-Mono build, now on `PATH` on both dev machines), and hardcoded desktop-only paths generalised so the doc works on the laptop too. ## Test plan - [x] `addons/gut/gut_cmdln.gd` full suite: 10/10 passing. - [x] All four terrain presets (plains, island, crater, canyon) verified headed at the new tile scale. - [x] Camera zoom verified headed at min/default/max levels against the 128m map. - [ ] No manual playtest of pawn pathfinding/movement yet — this only adds the stub capsule and spawn point, no controls. Closes #22 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A 1m tile put the height quantum below human stride length: level_height
0.25 with max_step_levels 1 meant a pawn could not step up 25cm, so the
pathfinder treated a kerb as a cliff. Doubling both the tile and the
terrace step makes the step rule honest and gives buildings plausible
footprints without a nine-tile minimum. Full rationale on #22.

Fixes walkability along the way. is_walkable() compared the tile's level
against the datum, but only _kind_for() knows about preset.has_water, so
on a plains map the entire below-datum half was unreachable while still
drawing as perfectly ordinary ground - between 61% and 85% of the map
depending on seed. It now asks _kind_for(), the single definition of
water. Verified against all four presets: island unchanged at 32%
walkable, canyon correctly splits into regions at its walls.

Retunes plains.tres to height_scale 10.0, measured to reproduce the same
15-level spread and sand/grass split the 0.25m step gave.

Also restores the Map node's preset to reference plains.tres - it had
been replaced by a blank embedded sub-resource, so tuning plains.tres
had no effect on the starting map - and drops the node's stale
tile_size/level_height/cell_size overrides, which were pinning the old
1m values and stopping the new script defaults from applying at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
max_zoom 70 could not frame the whole map at any angle once tiles went to
2m. The demanding case is a 45 degree yaw, where the 128m square presents
its 181m diagonal; tilted 40 degrees that needs ~117 units of vertical
orthographic span, so max_zoom is now 120.

min_zoom 10 shows 5 tiles vertically, close enough for a building and its
surroundings without the view ceasing to read as a map. The default moves
to 60, framing roughly half the map - 46 now showed only a third.

Verified headed at all three levels.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The engine moved to a non-Mono 4.7.2 build that is on PATH on both
machines this project is developed on, so the Godot invocation no longer
needs a hardcoded, machine-specific install path. Generalises the
OrthographicGame POC references the same way, since they hardcoded the
desktop-only C:\Development root and broke on the laptop.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
liamjd merged commit 7391564715 into main 2026-08-18 20:25:33 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder!24
No description provided.