Draw the structures, and let an operator stop the map reading (#136) - #140
Conversation
**Structures are glyphs now**, not single letters in coloured dots: a house, a chest, a stepped pyramid, a keep, a pickaxe, and a pin for anything unrecognised. SVG path data in `shared/mapIcons.ts` rather than images — a canvas builds a `Path2D` from a path string, so one definition serves the desktop canvas, both web canvases and any HTML legend, with no asset to ship and no blurring when it scales. Each is a single filled silhouette. A marker is about sixteen device pixels across, and anything with interior detail turns to mud at that size. They sit on a dark disc ringed in the kind's colour, because a bare silhouette disappears against terrain its own colour — a grey pickaxe on stone, a red chest on netherrack. `Path2D` is built once per kind and reused; constructing one per marker per frame is parsing the same string hundreds of times a second. **And loading as the view moves is now a setting**, on by default. Off, the map draws what it already holds and asks for nothing more until you press "Load this view" — so panning across a large world costs nothing at all. That is the answer for a machine where the reading itself is the problem, and it is honest about the trade: new ground stays blank until you ask for it. **The performance settings say what they are.** They persist on the server and every surface reads the same tiles, so sitting in a map toolbar they read as a preference of that window. Both the desktop and the panel now say plainly that a change there applies to the app, the panel and the public site alike. Asserted: every glyph starts with a move, closes, stays inside the box it claims (a path that leaves it will not sit where it is placed), carries a colour and a label, and an unrecognised kind still gets one. `new Path2D` throws nothing on malformed data — it renders an empty shape — so a typo would otherwise be a marker with a hole in it and no error anywhere.
…end nobody could read I wrote "a change here applies to the app, the panel and the public site alike" into the settings UI, and the public site ignored `loadOnPan` entirely. The feed carries it now, so a visitor cannot spend more of the server's budget than the operator allowed — and the sentence is true. `MAP.loadOnPan` was also never initialised, so the fetch guard worked by `undefined !== false` happening to be true. That is a coincidence, not a default. `iconSvg` was exported and used by nothing but its own test. It builds the map's icon key now, because glyphs nobody can name are decoration — and that turned up the real defect: it called `iconFor`, which is the stringified-helper trap from #116. Embedded into a page, a function that calls another throws a `ReferenceError` the moment the bundler renames the callee, with nothing wrong in the source. It is self-contained, both pages define the table under the exact identifier it reads, and the embedded-copy check in the smoke now covers it alongside `avatarUrl` and `itemIconUrl`. Two backticks in comments inside template literals, again. The gate run before this one was against a stale build and told me nothing; the green above is a fresh one.
|
Self-review: the setting I said applies everywhere did not, and a legend nobody could read I wrote "a change here applies to the app, the panel and the public site alike"
Two backticks in comments inside template literals, again. The gate run before |
Draw the structures, and let an operator stop the map reading (#136)
Structures are glyphs now, not single letters in coloured dots: a house, a
chest, a stepped pyramid, a keep, a pickaxe, and a pin for anything
unrecognised. SVG path data in
shared/mapIcons.tsrather than images — acanvas builds a
Path2Dfrom a path string, so one definition serves thedesktop canvas, both web canvases and any HTML legend, with no asset to ship
and no blurring when it scales.
Each is a single filled silhouette. A marker is about sixteen device pixels
across, and anything with interior detail turns to mud at that size. They sit on
a dark disc ringed in the kind's colour, because a bare silhouette disappears
against terrain its own colour — a grey pickaxe on stone, a red chest on
netherrack.
Path2Dis built once per kind and reused; constructing one per marker perframe is parsing the same string hundreds of times a second.
And loading as the view moves is now a setting, on by default. Off, the map
draws what it already holds and asks for nothing more until you press "Load this
view" — so panning across a large world costs nothing at all. That is the answer
for a machine where the reading itself is the problem, and it is honest about
the trade: new ground stays blank until you ask for it.
The performance settings say what they are. They persist on the server and
every surface reads the same tiles, so sitting in a map toolbar they read as a
preference of that window. Both the desktop and the panel now say plainly that
a change there applies to the app, the panel and the public site alike.
Asserted: every glyph starts with a move, closes, stays inside the box it claims
(a path that leaves it will not sit where it is placed), carries a colour and a
label, and an unrecognised kind still gets one.
new Path2Dthrows nothing onmalformed data — it renders an empty shape — so a typo would otherwise be a
marker with a hole in it and no error anywhere.