Exported builds load no town maps (.tscn.remap skipped); Calwen becomes a 1x1 wall and the player is stuck after paying the gate #29

Closed
opened 2026-11-07 18:11:18 +00:00 by Grok · 1 comment
Member

Summary

In an exported build, MapBook._load_towns() loads no town maps. Every town falls back to a 1×1 all-wall layout. After paying the Calwen gate fee, the player is placed in that stub town and cannot move, leave, or interact with anything.

Environment

  • main @ ffcc88c, VERSION 0.4.4, Godot 4.7
  • Verified on: the "Windows Desktop" export preset exported as a pack on Linux (godot4 --headless --export-pack "Windows Desktop" animrpg.pck). No export templates were available, so no .exe was built or run.
  • User-reported on: Brandon's Windows executable. The commit it was built from is unknown.

Cause

scripts/world/map_book.gd, _load_towns():

var dir := DirAccess.open(TOWN_DIR)   # res://scenes/maps/towns
for name in dir.get_files():
    if not name.ends_with(".tscn"):
        continue

On export, Godot converts text scenes to binary and lists them as <name>.tscn.remap. Every file fails the .tscn check, so _towns stays empty. town_layout() then returns its fallback (map_book.gd ~190–202): width 1, height 1, cells ["wall"], no doors, spawn and gate at (0,0).

Verified repro (export pack)

Probe script printing DirAccess.get_files_at("res://scenes/maps/towns") and MapBook.town_layout(calwen):

Source (--path .) Exported pack (--main-pack animrpg.pck)
Files listed calwen.tscn, … (17) calwen.tscn.remap, … (17)
Calwen layout 28×28, 9 doors, spawn (14,26), landings south/east 1×1, 0 doors, spawn (0,0), no landings

Effect in play (follows from the code above)

  • _enter_town succeeds and charges the 24-gold fee (tier 1), leaving a new character at Gold 0. The hero is placed at (0,0) of the stub town.
  • _cell treats every out-of-bounds tile as wall, so _walkable refuses every step.
  • _town_interact: the tile is not gate and there are no doors, so it prints _say("The street is quiet.") (game_manager.gd:726). The player cannot leave.

User report (Windows exe, not independently run)

Brandon: when he enters the first town he cannot move anywhere, leave, progress, or interact; nothing allows northward movement; "I get stuck at the guard". His screenshot shows:

  • HUD: Calwen, Day 07:02, Gold 0, Ren F 17/18
  • the whole viewport tiled with one repeated gray wall graphic, and two character sprites near the center
  • the bottom message box showing only The street is quiet., with no dialogue or advance indicator

This matches the stub-town behavior above.

Expected

An exported build loads the same town maps as a source run. Entering Calwen places the hero at the south or east landing of the 28×28 map with working doors and gate.

Why the automated playtester missed it

tools/playtest/run.sh runs the project from source (--path .), where the .tscn files exist under their own names. The playtester never runs an exported build, so it never hits the remap listing.

## Summary In an exported build, `MapBook._load_towns()` loads no town maps. Every town falls back to a 1×1 all-wall layout. After paying the Calwen gate fee, the player is placed in that stub town and cannot move, leave, or interact with anything. ## Environment - `main` @ `ffcc88c`, VERSION `0.4.4`, Godot 4.7 - Verified on: the "Windows Desktop" export preset exported as a pack on Linux (`godot4 --headless --export-pack "Windows Desktop" animrpg.pck`). No export templates were available, so no `.exe` was built or run. - User-reported on: Brandon's Windows executable. The commit it was built from is unknown. ## Cause `scripts/world/map_book.gd`, `_load_towns()`: ```gdscript var dir := DirAccess.open(TOWN_DIR) # res://scenes/maps/towns for name in dir.get_files(): if not name.ends_with(".tscn"): continue ``` On export, Godot converts text scenes to binary and lists them as `<name>.tscn.remap`. Every file fails the `.tscn` check, so `_towns` stays empty. `town_layout()` then returns its fallback (`map_book.gd` ~190–202): width 1, height 1, cells `["wall"]`, no doors, spawn and gate at (0,0). ## Verified repro (export pack) Probe script printing `DirAccess.get_files_at("res://scenes/maps/towns")` and `MapBook.town_layout(calwen)`: | | Source (`--path .`) | Exported pack (`--main-pack animrpg.pck`) | |---|---|---| | Files listed | `calwen.tscn`, … (17) | `calwen.tscn.remap`, … (17) | | Calwen layout | 28×28, 9 doors, spawn (14,26), landings south/east | 1×1, 0 doors, spawn (0,0), no landings | ## Effect in play (follows from the code above) - `_enter_town` succeeds and charges the 24-gold fee (tier 1), leaving a new character at Gold 0. The hero is placed at (0,0) of the stub town. - `_cell` treats every out-of-bounds tile as `wall`, so `_walkable` refuses every step. - `_town_interact`: the tile is not `gate` and there are no doors, so it prints `_say("The street is quiet.")` (`game_manager.gd:726`). The player cannot leave. ## User report (Windows exe, not independently run) Brandon: when he enters the first town he cannot move anywhere, leave, progress, or interact; nothing allows northward movement; "I get stuck at the guard". His screenshot shows: - HUD: `Calwen`, `Day 07:02`, `Gold 0`, `Ren F 17/18` - the whole viewport tiled with one repeated gray wall graphic, and two character sprites near the center - the bottom message box showing only `The street is quiet.`, with no dialogue or advance indicator This matches the stub-town behavior above. ## Expected An exported build loads the same town maps as a source run. Entering Calwen places the hero at the south or east landing of the 28×28 map with working doors and gate. ## Why the automated playtester missed it `tools/playtest/run.sh` runs the project from source (`--path .`), where the `.tscn` files exist under their own names. The playtester never runs an exported build, so it never hits the remap listing.
Author
Member

Corrected on branch 0.4.4/city-gate-court (commit b54b8fa), pull request #30.

MapBook kept a town file only when the name ended in .tscn. The Windows export pack lists each town as <id>.tscn.remap (17 files, and no plain .tscn). Those names were skipped, so every town fell back to a 1×1 wall and the street read as quiet.

The loader strips .remap and loads scenes/maps/towns/<id>.tscn. A repeated name loads once.

Verified with godot4 --headless --export-pack "Windows Desktop" and tools/probes/town_pack.gd on that pack: plain=0, remap=17, Calwen 30×30 with 9 doors, spawn (14, 26), south gate (14, 29), east gate (29, 14). Malrec is 46×54. Pelden is 20×20. The source tree lists 17 .tscn files and the same layouts.

Calwen is 30×30 on this branch because the south and east courts are part of the map. The 28×28 figure in the report is the walled interior.

This pull request uses Fixes #29, so the issue closes when the pull request merges.

Corrected on branch `0.4.4/city-gate-court` (commit b54b8fa), pull request #30. `MapBook` kept a town file only when the name ended in `.tscn`. The Windows export pack lists each town as `<id>.tscn.remap` (17 files, and no plain `.tscn`). Those names were skipped, so every town fell back to a 1×1 wall and the street read as quiet. The loader strips `.remap` and loads `scenes/maps/towns/<id>.tscn`. A repeated name loads once. Verified with `godot4 --headless --export-pack "Windows Desktop"` and `tools/probes/town_pack.gd` on that pack: plain=0, remap=17, Calwen 30×30 with 9 doors, spawn (14, 26), south gate (14, 29), east gate (29, 14). Malrec is 46×54. Pelden is 20×20. The source tree lists 17 `.tscn` files and the same layouts. Calwen is 30×30 on this branch because the south and east courts are part of the map. The 28×28 figure in the report is the walled interior. This pull request uses Fixes #29, so the issue closes when the pull request merges.
Sign in to join this conversation.
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
ai-collab/animrpg202610#29
No description provided.