Split The code is public; the app answers only to the crew.

The map names its own rooms: `places` on `MapDef` and `placeAt`, and no table of hand-typed coordinates #167

shipped merged opened this
opened this

Give a world point a name a person would use for it, so anything that wants to say where has one vocabulary and it is the map's.

The first half of #111 (now closed and split in two). Today nothing can name a place: MapDef is grid, boxes, spawns and sites, and the only named things on it are the two sites. Closed pull #164 built this part and it read well — places labelled once at build time, placeAt(map, pos) resolving last-painted-first so it agrees with the cells buildGrid actually painted — and then died on an unrelated test timeout. This issue is that half on its own, with nothing reading it yet.

Done looks like

  • [ ] MapDef gains places: the layout's own areas, labelled once when the map is built. The label is derived from the area name the layout already carries (a site reads A site, ct mid reads CT mid) — not a second table of strings, and never a table of coordinates.
  • [ ] placeAt(map, pos) returns the place a world point stands in, resolved the way the grid was painted, so it can never name a room you cannot be standing in.
  • [ ] A structural test in map.test.ts, over every map in MAPS the way the existing structural tests run: every walkable cell has a name. A layout with an unnamed corner is a red test the moment it is added, which is the same promise map.test.ts already makes about sites and doorways.
  • [ ] Nothing reads it yet — no bots.ts, no world.ts, no HUD. This issue is the vocabulary.
  • [ ] Built once with the map and allocation-free per call: placeAt is about to be asked on a tick path, and src/rl/arena.ts steps that path millions of times.
  • [ ] The map bullet in README's Shape says what a place is and where the names come from.
  • [ ] bun run check green.

Files I expect to change: src/client/map.ts, src/client/map.test.ts, README.md.

Risks: the names become player-facing the moment #111's other half lands, so a cryptic area name is fixed by renaming the area, not by bolting a lookup beside it. Keep MapDef a plain value — a third map must still be a third table of numbers and nothing else.

Brief that fits: scout.

commented

In flight already — do not start this from scratch. Pull #172 (vesper, branch vesper/111-teammates-who-call-it-out-what-a-bot-see) is open against main at 6b43481, its check is green, and its diff contains exactly this: places on MapDef, placeAt, and the map.test.ts walk over every walkable cell (map.ts +46, map.test.ts +50). It was written for #111 before #111 was split.

So: if #172 merges, this issue is done and should be closed against it rather than built twice. If it is closed instead, the body above is the half to build first, on its own. Anyone picking this up should read #172 first.

commented

Done: pull #172 merged at 75febb4. MapDef carries places, placeAt(map, pos) resolves a point last-painted-first, and map.test.ts walks every walkable cell of every map in MAPS to prove each one has a name. Closing against it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs