REDCODE / DOCS

Materials in the sector view

Draft 0.1, 2026-11-21, agreed with the owner the same day: M1 first, then M2, then M3 with (a) before (b). The owner asked for it on 2026-11-21: pick a thing in the sector view, see its real material there, open it in EDGEmat to choose or make another game material, see that on the mesh, add it to the project, and see it in the game.

What there is today

The steps

Step What Where Waits on
M1 Picked materials Colours by the real material names; the picked thing drawn with its materials in place; a picked panel REDcode and the drawing package Nothing
M2 Live from EDGEmat The sector view redraws the picked thing while EDGEmat changes its material on the Desk REDcode, with an EDGEmat request EDGEmat saying which Desk item a change is for, and rendering it
M3a Every copy EDGEmat’s Add to Project writes the mesh at its game path, then Pack and Play. Every place in the game that uses the mesh changes EDGEmat and REDcode, as today M2 for the preview; works without it
M3b This node only The changed mesh under a new path, and the bake points the node at it through an ArchiveXL mutation REDbridge (sector.build mutations), EDGEbuilder (a world edit and its bake), REDcode (the button) A probe in the game first, then requests to REDbridge and EDGEbuilder

M1 as planned

The page half’s additions (setMaterials, restoreMesh, replaceMesh’s optional prepare, Placement.appearance) and the host half’s meshMaterials are additive. EDGEbuilder hears of them in EDGEbuilder #8 before the package is published.

M1 as built

Built 2026-11-21; hand test passed by the owner the same day, all 10 steps, with one fix: Add to Project now asks before it writes over a file already in the project (testing). Two things changed from the plan, after a check in Chrome over the real bridge:

Found: the world’s multilayered materials come out a flat grey from EDGEmat’s renderer (edgemat-core 0.3.2). These are multilayered.mt with an .mlsetup and an ..._masksset.mlmask, such as the corporate plaza buildings and the sidewalks. Plain textured materials render properly; the cardboard trash got its 1.6 MB colour map. Better world materials are EDGEmat’s, asked with M2’s needs in EDGEmat #17 (2026-11-21). The package’s additions are noted on EDGEbuilder #8.

EDGEmat #17 done (2026-11-22): its hand test “The Desk’s edits in the 3D view” passed (the owner, all 8 steps, with REDcode main). A Desk entry’s change names that entry’s copy of its mesh in onDidChangeMaterials; edgemat.openMesh answers { desk, mesh }; renderMaterials without the library draws layered materials. It shipped in EDGEmat 0.3.4 (released 2026-11-22, #17 closed). M2 can start.

Timings, with the game running:

M2 as built

Built 2026-11-30, hand test pending (testing). Not run in VS Code yet.

Part Where
Open in EDGEmat’s answer { desk, mesh } is kept: mesh is the game mesh’s copy on the Desk openInEdgemat in src/edgemat.ts, deskCopies in src/cr2wEditor.ts
A change EDGEmat names by a Desk copy is kept the same way, so a mesh put on the Desk from EDGEmat’s side is known from its first change deskCopyGamePath (the copy’s path ends in the game path, after desk\items\<id>\source\archive\), noteDeskCopy
The picked thing’s materials are rendered from the Desk copy when there is one, and the material each part names is read from the copy too sectorRender
The note says “Materials by EDGEmat, from its Desk” webview/sectorViewer.ts

As it differs from the plan, and what is left:

Not in this design