Scatter trees, rocks, wrecks and crates by biome, using MultiMesh on the client and lightweight collision and health on the server.
Acceptance
Placement is deterministic and agrees between client and server.
Props have health and can be destroyed.
Thousands of props stay within the frame budget.
**Depends on:** W3
Scatter trees, rocks, wrecks and crates by biome, using MultiMesh on the client and lightweight collision and health on the server.
**Acceptance**
- Placement is deterministic and agrees between client and server.
- Props have health and can be destroyed.
- Thousands of props stay within the frame budget.
claude
added this to the v0.2 Movement and Island milestone 2026-11-09 05:26:06 +00:00
PropSet (src/sim/prop_set.gd) places pines, scrub, boulders, wrecks and crates from the seed on a jittered 4 m grid. Density is set per elevation band in Tuning.PROP_DENSITY, and grove noise thins or thickens the forest. Every square draws the same number of random values, so one square's outcome never shifts the next. Props keep PROP_POI_CLEARANCE from POI solids, loot markers and walking routes, and stay off spots too steep for their kind. That gives about 2,900 to 3,400 props per island.
Each prop is one collision box in SimGround, with health and a harvest material from Tuning.PROP_KINDS. Simulation.damage_prop() destroys a prop at zero health and removes its box at once through the new SimGround.remove_solid(), which never reuses IDs. Prop health is part of state_hash().
PropView (src/client/props/prop_view.gd) draws one MultiMesh per kind per 128 m square: about 150 instanced draws for 3,200 props. Each kind has its own visibility range (scrub and crates drop out first). The meshes are procedural, low-poly and flat-shaded, coloured per vertex in the palette, and fitted to the collision boxes. sync() hides felled props by reading only the new destruction records.
Tests (make check: 133 passed, plus self-check and smoke, p95 tick 0.51 ms with 24 bots)
Client and server agree on layout (a hash of every box and yaw), and different seeds give different layouts.
Six seeds each get at least 2,000 props and every kind. Props sit on land, aren't buried and keep clear of POIs.
A player walking into a pine is stopped at the trunk. After the pine takes enough hits to fall, the same walk passes through where it stood.
Damage is deterministic and hashed. Invalid, zero and negative damage is ignored.
24 players sprinting through the forest: mean sim tick about 0.4 ms.
View: one instance per prop, instances fit their boxes, mesh normals face outward, felled props vanish, and draws stay at most squares × kinds. Headless, the build took 7 ms and syncing 54 felled props took 26 µs.
Captures (Forward+ on Lavapipe): props_forest, props_felled, props_overview, props_beach, props_crate and props_highland in test/capture/. I looked at each one. While doing that I found and fixed vertex colours being read as linear (washed out) and a pale specular on needle tips that read as snow.
Not verified: GPU frame time. "Within the frame budget" is supported by the draw count, the per-kind culling and the sim and main-thread costs above, but software rendering can't time a real GPU. That needs Eric's playtest (R6).
Follow-ups for later milestones: hooking harvesting into tools and materials (building, v0.3), and the art pass on prop meshes (v0.6).
Done in 5db53de.
**What changed**
- `PropSet` (`src/sim/prop_set.gd`) places pines, scrub, boulders, wrecks and crates from the seed on a jittered 4 m grid. Density is set per elevation band in `Tuning.PROP_DENSITY`, and grove noise thins or thickens the forest. Every square draws the same number of random values, so one square's outcome never shifts the next. Props keep `PROP_POI_CLEARANCE` from POI solids, loot markers and walking routes, and stay off spots too steep for their kind. That gives about 2,900 to 3,400 props per island.
- Each prop is one collision box in `SimGround`, with health and a harvest material from `Tuning.PROP_KINDS`. `Simulation.damage_prop()` destroys a prop at zero health and removes its box at once through the new `SimGround.remove_solid()`, which never reuses IDs. Prop health is part of `state_hash()`.
- `PropView` (`src/client/props/prop_view.gd`) draws one MultiMesh per kind per 128 m square: about 150 instanced draws for 3,200 props. Each kind has its own visibility range (scrub and crates drop out first). The meshes are procedural, low-poly and flat-shaded, coloured per vertex in the palette, and fitted to the collision boxes. `sync()` hides felled props by reading only the new destruction records.
**Tests** (`make check`: 133 passed, plus self-check and smoke, p95 tick 0.51 ms with 24 bots)
- Client and server agree on layout (a hash of every box and yaw), and different seeds give different layouts.
- Six seeds each get at least 2,000 props and every kind. Props sit on land, aren't buried and keep clear of POIs.
- A player walking into a pine is stopped at the trunk. After the pine takes enough hits to fall, the same walk passes through where it stood.
- Damage is deterministic and hashed. Invalid, zero and negative damage is ignored.
- 24 players sprinting through the forest: mean sim tick about 0.4 ms.
- View: one instance per prop, instances fit their boxes, mesh normals face outward, felled props vanish, and draws stay at most squares × kinds. Headless, the build took 7 ms and syncing 54 felled props took 26 µs.
**Captures** (Forward+ on Lavapipe): `props_forest`, `props_felled`, `props_overview`, `props_beach`, `props_crate` and `props_highland` in `test/capture/`. I looked at each one. While doing that I found and fixed vertex colours being read as linear (washed out) and a pale specular on needle tips that read as snow.
**Not verified:** GPU frame time. "Within the frame budget" is supported by the draw count, the per-kind culling and the sim and main-thread costs above, but software rendering can't time a real GPU. That needs Eric's playtest (R6).
**Follow-ups for later milestones:** hooking harvesting into tools and materials (building, v0.3), and the art pass on prop meshes (v0.6).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Depends on: W3
Scatter trees, rocks, wrecks and crates by biome, using MultiMesh on the client and lightweight collision and health on the server.
Acceptance
Done in
5db53de.What changed
PropSet(src/sim/prop_set.gd) places pines, scrub, boulders, wrecks and crates from the seed on a jittered 4 m grid. Density is set per elevation band inTuning.PROP_DENSITY, and grove noise thins or thickens the forest. Every square draws the same number of random values, so one square's outcome never shifts the next. Props keepPROP_POI_CLEARANCEfrom POI solids, loot markers and walking routes, and stay off spots too steep for their kind. That gives about 2,900 to 3,400 props per island.SimGround, with health and a harvest material fromTuning.PROP_KINDS.Simulation.damage_prop()destroys a prop at zero health and removes its box at once through the newSimGround.remove_solid(), which never reuses IDs. Prop health is part ofstate_hash().PropView(src/client/props/prop_view.gd) draws one MultiMesh per kind per 128 m square: about 150 instanced draws for 3,200 props. Each kind has its own visibility range (scrub and crates drop out first). The meshes are procedural, low-poly and flat-shaded, coloured per vertex in the palette, and fitted to the collision boxes.sync()hides felled props by reading only the new destruction records.Tests (
make check: 133 passed, plus self-check and smoke, p95 tick 0.51 ms with 24 bots)Captures (Forward+ on Lavapipe):
props_forest,props_felled,props_overview,props_beach,props_crateandprops_highlandintest/capture/. I looked at each one. While doing that I found and fixed vertex colours being read as linear (washed out) and a pale specular on needle tips that read as snow.Not verified: GPU frame time. "Within the frame budget" is supported by the draw count, the per-kind culling and the sim and main-thread costs above, but software rendering can't time a real GPU. That needs Eric's playtest (R6).
Follow-ups for later milestones: hooking harvesting into tools and materials (building, v0.3), and the art pass on prop meshes (v0.6).