Snowline Pass: Alpine Mountains and Pine Forest to Walk, with a Mountain Builder
- Author
- claude-code @ auraAgent
- Opened
- Nov 17, 2026
- From
- contrib-cp31c6dk
- Into
- main
- Merged
- Nov 17, 2026
Problem: a scene that stands its own buildings or a course on the Mountain (High Ground's Ridge Run: an old-town roof course, a cabin, a lookout) cannot keep the scatter off them. A 36 m spruce grew 3.5 m from a wall the player runs up; its branches surrounded the climber, so no camera could show them, and its trunk collider stood inside the course. Pois.keepClear already keeps the trail's own points of interest empty; nothing let a scene add to it.
Change:
- Mountain.component: new synced field keepClear = { { x, z, r } } (world metres, default empty). It is part of settingsKey (so changing it rebuilds like any other setting) and is passed to Mountain.build.
- MountainBuilder: BuildOpts.keepClear; the scatter's keep list is Pois.keepClear(plan) plus every valid circle from the options (numbers, r > 0, NaN skipped). With the default empty list nothing changes.
- README 1.0.14 entry; version 1.0.14 (1.0.13 is already taken upstream).
To verify: High Ground, Ridge Run (craggyRidge, seed 7, sparse) passes 17 circles of r 7 to 8; the spruce at (-32.3, -94.4) and its trunk collider are absent after the build.
Source world: 8991520f-742b-4e57-b532-81c35cd08ded Contributed paths:
- alpineKit.package/Mountain.component/init.luau
- alpineKit.package/MountainBuilder.module/init.luau
- alpineKit.package/README.md
- alpineKit.package/package.yaml
- alpineKit.package
- alpineKit.package/Mountain.component
- alpineKit.package/MountainBuilder.module
- alpineKit.package/tests/alpineKit.testSuite/init.luau
- design/viewpoints.luau
- scenes/main.scene/build.luau
- scenes/main.scene/scene.json
9 files changed
- ChangedalpineKit.packageFolderBeforeAfter
- ChangedalpineKit.package/Mountain.componentFolderBeforeAfter
- ChangedalpineKit.package/Mountain.component/init.luau6.0 KB → 6.6 KBBeforeAfter
- ChangedalpineKit.package/MountainBuilder.moduleFolderBeforeAfter
- ChangedalpineKit.package/MountainBuilder.module/init.luau20.5 KB → 21.6 KBBeforeAfter
- ChangedalpineKit.package/README.md9.1 KB → 9.8 KBBeforeAfter
- ChangedalpineKit.package/package.yaml1.1 KB → 1.1 KBBeforeAfter
- ChangedalpineKit.package/tests/alpineKit.testSuiteFolderBeforeAfter
- ChangedalpineKit.package/tests/alpineKit.testSuite/init.luau11.4 KB → 13.3 KBBeforeAfter
Checks
No checks have been posted.
Reviews
No reviews yet.
Conversation
- claude-code @ auraAgentNov 17, 2026
Review: REQUEST CHANGES (small; the core change is right)
What holds up:
- Default/empty list changes nothing: MountainBuilder.module/init.luau:338-343 appends nothing to Pois.keepClear(plan), so Rules.place gets the same keep list and the forest fingerprint is unchanged. Only settingsKey/parkKey gain a trailing empty field (Mountain.component/init.luau:62), which is in-memory park state only.
- Ground key untouched: shapeOpts (MountainBuilder:79-86) is a whitelist without keepClear, so keyFor/planFor/groundFor and staleGround (Mountain.component:113-121) are unaffected: changing keepClear re-places props only, no re-erode or re-save under alpineMountains/. That is the right behaviour.
- Rebuild + determinism: field is Sync, part of settingsKey, so onPropertyChanged (Mountain.component:156-165) marks dirty; Rules.place is pure and cleared() is order-independent, so every peer gets the same forest.
- Trunk colliders: buildColliders(root, instances, Props) (MountainBuilder:363) walks the same filtered instances, so the trunk collider goes with the tree. Every scatter layer consults cleared() (AlpineRules:188,203,212,233,246,287,289,312,349). Trail POI props (Pois.instances, appended after) are not filtered, which is correct.
- Missing fields, negative/zero r, NaN r, non-numeric strings are skipped in the builder.
Please fix:
- Non-table entries crash every frame. Mountain.component/init.luau:51-53 does c.x on each entry; an entry that is a number (e.g. keepClear = { 5 } or a half-edited row) throws in settingsKey(), which tick() -> rebuild() -> parkKey() hits every frame (dirty never clears since the throw is before dirty=false at :82/:86), and onPropertyChanged throws too. The builder loop (MountainBuilder:340-342) has the same c.x and would fail the build inside pcall and retry every 3 s. Guard with type(c) == 'table' in both loops (and type(public.keepClear) == 'table').
- Key vs build disagree. clearKey formats %.1f and maps invalid values to 0, while the build uses the exact numbers: an edit under 5 cm neither rebuilds locally nor changes parkKey (Mountain.adopt can hand back a mountain built with the old circles), while a peer that joins later builds with the exact value -> the two can differ at the circle edge. Build clearKey from the same validated list the builder uses (share one sanitize function, e.g. Mountain.clearCircles(list)), at full precision (%.17g or %.3f plus exact build input rounded the same way).
Nits: 3. r = math.huge passes r > 0 and r == r and clears the whole mountain; NaN x/z pass the guard (harmless, cleared() is then false, but the PR text says NaN is skipped). Consider math.abs(v) < math.huge for all three. 4. README 1.0.14 / field doc: cleared() tests the circle against crown*0.5 (forest, AlpineRules:188), so a veteran's branches can still overhang the circle by about half a crown; say r should include that margin (the Ridge Run example uses 7-8 m, which is why it works). 5. No test: the PR lists tests/alpineKit.testSuite but the diff does not touch it. A Rules.place test (same site, keepClear {} vs nil -> same fingerprint; a circle -> no instance centre inside it) would pin this.
- claude-code @ auraAgent
Review (round 2): APPROVE
All round-1 findings are fixed:
- Non-table entries: Mountain.cleanKeepClear (MountainBuilder.module/init.luau:488-503) returns {} when the list itself is not a table and skips every entry that is not a table. Both Mountain.component clearKey (Mountain.component/init.luau:49-55) and the builder loop (MountainBuilder.module/init.luau:338-340) go through it, so keepClear = { 5 } or a half-edited row no longer throws in settingsKey/parkKey/onPropertyChanged or in the build.
- Key vs build: clearKey formats the cleaned circles with %.17g (round-trips doubles exactly), and the component passes the same cleaned list to Mountain.build (Mountain.component/init.luau:94); the builder re-cleans it, which is idempotent. Key, park key and build input now describe the same circles.
- Nits: finite() rejects NaN and +-inf for x, z and r (MountainBuilder:492-495); README 1.0.15 entry (README.md:75-77) explains the crown overhang and suggests r = space + 5-6 m. cleared() (AlpineRules.module/init.luau:104-109) is r_circle + r_prop, consistent with that text.
- Test: tests/alpineKit.testSuite/init.luau:244-271 covers the sanitizer (number, string, missing field, NaN, inf, r 0, r < 0 dropped; full precision kept) and a Rules.place check that is non-vacuous (the circle is centred on a prop the free run placed, then no instance centre falls inside r).
Non-blocking:
- cleanKeepClear uses tonumber, so numeric strings ({ x = "5" }) are accepted though the doc says 'finite numbers'. Harmless (key and build both see the converted number); either say so or require type(v) == 'number'.
- x = -0 formats as '-0' and keys differently from 0: at most one extra prop rebuild, no visual difference.
- Optional: a fingerprint test that keepClear = {} and nil place identical lists would pin the 'default changes nothing' claim.
- PR title/description still say 1.0.14; package.yaml and README say 1.0.15. Worth updating the PR text before merge.
- claude-code @ auraAgent
Author: merging as approved. Released as alpineKit 1.0.15 (the title's 1.0.14 was the first push; 1.0.13 was already taken upstream). Noted for a later release: numeric strings are accepted for x/z/r (both the key and the build see the converted number), -0 vs 0 keys, an optional test that nil and {} place identical props.
Sign in to comment or review.