30c level design: three walkable example levels built from the kits (+ kit references, spawn point) - #247
Merged
Conversation
…e load that ends the run
- packRefs.js (new leaf): a piece placed from a pack carries userData.packRef
{pack, item, path, hash, kids}; a save (buildSessionPayload / buildSelectionPayload),
a session-load broadcast, a late joiner's sync and a live placement write a PRISTINE
piece as a hollow STUB; the loader and every peer refill it from PACKS_BASE/<path>,
parsed once per piece, textures shared across every copy (and across pieces whose
images are byte-identical). Pristine is MEASURED: a fingerprint of the descendants
(structure, local matrices, geometry checksums, material params, an 8x8 sample of every
texture) against the parsed file; an edited piece saves in full as before. An
unreachable pack keeps the stub and saves it back (never silently dropped).
- Measured: one kit wall was 7,859,921 B as a toJSON element (PNG data URLs, one
toJSON per top-level child) and is 555 B as a stub; a level of ~180 pieces is ~25 KB.
- Placement stamps the reference (Explorer double-click + viewport drop -> importFile
opts.packRef, before addImported replicates); the wire sends the stub (sendObjects
null-peer branch + sendObject; countObjects does not count refilled children).
- scenePhysics play.spawn {pos, yaw} (OMITTED at default, so saves are byte-identical);
PointerLockControls puts the player there on entering play (no dungeon);
Configure Scene > Physics > Play mode > Spawn point: Set to the view's focus / Clear.
- applySession stops a running LOCAL simulation before it wipes the scene (quietly, the
yielded way): the old world kept bodies for the wiped objects and none for the new
ones, and sim-on-play skipped the start because a sim was "already running" — so the
second level played in a session was walked THROUGH (levels-run2.log).
- App.svelte debug hook tails 215/215/215 (+packRefs); startPackRefs beside
startShadowDefaults.
Suites: pack-refs (NEW) 30/30 (single page + a late joiner + a live placement to a
second peer + a real kit wall when the build serves the kit). Unit scenePhysicsSpawn
3/3; vitest 233/233 (base 222).
Counterfactuals: sameFingerprint -> always true: 3 red (colour, in-place vertex, moved
child all saved as stubs); spawnOf spread removed: unit red; the scene-load stop removed:
the second level's walls/stairs walked through (level suite, 3 red).
svelte-check 335/47 = base (list identical); build green (server stopped).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e kits - scripts/level-templates.cjs: Castle Courtyard (curtain walls, a gate between pillars, two three-storey round towers, a rampart terrace reached by stairs through an archway, a paved avenue to a well, a market stall, trees; a lit afternoon sky), Forest Clearing (a stone path, a footbridge over a pond neck kitbashed with sandstone ramps, a 4 x 4 m plaster hut from the architecture kit, a walkable mound, a cliff, two rings of trees; late-morning sky, fog that closes in past the tree line), Tavern Interior (a double-height hall with a balcony, a kitchen behind a partition doorway with a loft above it, oak stairs, a bar, furniture; warm lamps + a warm hemisphere). Every level: a spawn point, sim-on-play, ONE walk-mode Character Controller node, dynamic props, and colliders that match the pieces — custom compound shapes for the archway/doorways (jambs + lintel), stairs and ramps (wedges), trees (trunks, MEASURED off-centre), the footbridge (deck + rails) and the mound (a measured hull that runs out past its 0.37 m lip); grass, flowers, rugs, water are sensors. - author-templates.cjs: a `kit` object type (a pack item as a REFERENCE stub, resolved through the pack's own default.json on PACKS_BASE, refilled and awaited before the card renders — the run refuses a level whose pack is unreachable), `seed: false` (kit levels stay out of the offline seed), and a kit level's card CLONES the scene instead of the toJSON round trip (which is the 7.9 MB-per-wall cost). Every other def is unchanged. - Measurements that shaped the layouts: the Arch opening is +/-0.408 m (the collider's jambs sit 6 cm inside the stone: a grazing walk stopped 1 run in 2); the Footbridge walks along its LOCAL Z with a flat 0.85 m deck and no approach. Suites: level-templates (NEW) ALL PASS 42 (all three levels: loads from the Templates modal, every piece refilled, spawn + sim-on-play, centre luminance castle 0.47 / forest 0.36 / tavern 0.33 >= 0.25, no black quarter, walls hold, archway/stairs/rampart, footbridge, hut doorway, balcony stairs, kitchen doorway pass); castle x2 green after the arch fix. Unit levelTemplates 8/8. Counterfactuals: CF=arch (the arch's custom collider removed): the archway walk red; CF=spawn (the spawn cleared): the spawn check red. svelte-check 335/47 = base; build green. Staged content: /home/deck/.code/theprototype-app/cloud-lane-30-staging/30c-levels. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three walkable General-tab levels built from the round-3 kits — Castle Courtyard, Forest Clearing, Tavern Interior — plus the core they needed.
Commits
Scene ▸ Physics ▸ Play mode ▸ Spawn point), and a scene load that ends the running simulation.
kitobjecttype +
seed: false.Staged content
/home/deck/.code/theprototype-app/cloud-lane-30-staging/30c-levels (index.json + templates//{scene.tpscene,thumb.webp}
Suites (final battery, fresh server, content re-authored from the committed defs)
Findings / deviations
applySession. NOT fixed (outside the lane):
/clear all(the Blank template) mid-run has the same shape.sandstone Ramps). The Arch opening is only 0.82 m (collider jambs sit 6 cm inside the stone).
Owed (hardware / people)
kit pieces from the pack CDN — needs internet on both).
For the integrator
packs@format-1retagged. Publish the rows (staging folder above) into the scenes repotemplatesin that release.built from the new kits." · "Kit pieces are saved as references to their pack: a level of 150 pieces is ~25 KB, and
every copy shares its textures." · "Configure Scene ▸ Physics ▸ Play mode ▸ Spawn point." · "Fix: loading a scene
while the simulation runs no longer leaves the old physics world behind."
src/lib/packRefs.js(the stub/refill/pristine-fingerprint contract; the fourpaths: save + wire use stubs, autosave GLTF and undo stay full) and a gotcha: "a template's toJSON of a GLB import
writes PNG data URLs, one per top-level child — 7.9 MB per kit wall".
save/reopen); an older build reading a stub gets an empty group.
🤖 Generated with Claude Code