W5: Vegetation and harvestable props
PropSet places about 3,000 pines, scrub, boulders, wrecks and crates per island from the seed, by elevation band with grove noise, clear of points of interest. Each prop is one collision box in SimGround with health from Tuning.PROP_KINDS; destroying it removes the box at once (SimGround.remove_solid). Prop health is part of the state hash. PropView draws them as one MultiMesh per kind per 128 m square (about 150 instanced draws), with per-kind visibility ranges, procedural flat-shaded meshes fitted to the collision boxes, and cheap sync of felled props. Closes #12 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,27 @@ const POI_MAX_TOTAL: int = 16
|
||||
## No two points of interest are closer than this, centre to centre.
|
||||
const POI_SPACING_METRES: float = 85.0
|
||||
|
||||
# Props: trees, scrub, boulders, wrecks and crates scattered over the island. Each kind
|
||||
# has health, the material it gives when harvested, and a collision footprint range in
|
||||
# metres (`width` x `height`; wrecks are `length` long). Density is props per hectare
|
||||
# in each elevation band; groves and clearings modulate it.
|
||||
const PROP_KINDS: Dictionary = {
|
||||
"pine": {"health": 200, "material": "driftwood", "width": [0.5, 0.7], "height": [7.0, 12.0]},
|
||||
"scrub": {"health": 60, "material": "driftwood", "width": [1.1, 1.8], "height": [0.8, 1.3]},
|
||||
"boulder": {"health": 400, "material": "stone", "width": [1.6, 3.4], "height": [1.0, 2.4]},
|
||||
"wreck": {"health": 500, "material": "salvage_iron", "width": [2.2, 2.8], "height": [1.4, 2.0], "length": [5.5, 8.0]},
|
||||
"crate": {"health": 80, "material": "driftwood", "width": [0.9, 1.2], "height": [0.9, 1.2]},
|
||||
}
|
||||
const PROP_DENSITY: Dictionary = {
|
||||
"beach": {"wreck": 5.0, "crate": 6.0, "scrub": 2.0},
|
||||
"marsh": {"scrub": 30.0, "crate": 1.0, "boulder": 1.0},
|
||||
"forest": {"pine": 70.0, "scrub": 16.0, "boulder": 4.0, "crate": 0.3},
|
||||
"highland": {"pine": 14.0, "boulder": 16.0, "scrub": 10.0},
|
||||
"summit": {"boulder": 10.0, "scrub": 3.0},
|
||||
}
|
||||
## Props keep this far from any point-of-interest solid, loot marker or walking route.
|
||||
const PROP_POI_CLEARANCE: float = 3.0
|
||||
|
||||
# The tide. `hold` and `rise` are seconds, `level` is metres above the starting sea,
|
||||
# `drown_dps` is damage per second underwater once breath runs out. The last level
|
||||
# must exceed ISLAND_MAX_HEIGHT, so that every match ends.
|
||||
|
||||
Reference in New Issue
Block a user