Public: anyone can read this; the crew can change it.
forked from trevato/cs
See the map before you play it: a plan of the layout on the menu, drawn from the level itself #218
Check · Review · Land · Live done — Landed and live in production.
The menu now shows a plan of the map **Play** would start: the rooms, the two bombsites lettered A and B, and the two spawns in the sides' own colours, on a small canvas beside the map's name. It is the radar's drawing used a second time, not a second drawing — `drawPlan` comes out of `src/client/minimap.ts` (the projection, the merged floor rectangles, the sites and their letters, which is the ha…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
The menu now shows a plan of the map Play would start: the rooms, the two bombsites lettered A and B, and the two spawns in the sides' own colours, on a small canvas beside the map's name. It is the radar's drawing used a second time, not a second drawing —
drawPlancomes out ofsrc/client/minimap.ts(the projection, the merged floor rectangles, the sites and their letters, which is the half of the radar that is about a level rather than a round) and hands back the projection it used, so the radar puts its dots andsrc/client/preview.tsputs the spawns exactly where it put the rooms. Pickingde_forgeshows de_forge, picking generated shows the map this match's id carves — the same id the line above already named, so no second id is drawn — and typing a name shows that exact layout.It is drawn once per choice, never per frame and never while a match is running. Rather than carve a level on every keystroke, a choice has to stand still for 200 ms on the frame clock before anything is generated (
PLAN_WAITinsrc/client/main.ts); a debounce and not a blur handler, because the choice is three controls and a person moves between them. Measured here:generateLevel6.3 ms,drawPreview0.03 ms, so a name typed a character at a time costs one map and not ten.previewTextis the text alternative —40×40 cells · bombsite A north-east, B south-west · spawns south and north, all of it read off the level — and the canvas carriesaria-hidden="true". The first paint renders a sentence of about the same length saying the plan arrives when the game has booted, because a server that described a named map would have to carve one per request;#planalthas a two-linemin-heightso the swap moves nothing.Worth a look: at 360px the square is 96px and the text column beside it 222px inside the overlay's padding, so the row does not wrap and nothing scrolls sideways — but the menu overlay was already taller than the stage and already scrolled to reach Play before this change, and the plan adds about 60px above it. I could not open a browser from here, so that part is arithmetic off the CSS, not a screenshot. Nothing about the simulation changed and no digest moved;
bun testis 966 passing, and the app bundle grew 1,368 raw / 536 gzipped bytes (97,956 / 44,073) against the 100,000 / 45,000 ceiling, which is logged insrc/games.tswith the rest.🤖 Generated with Claude Code
Closes #149