W4: Points of interest
PoiSet.generate(island) places 10 to 16 points of interest per island from the seed's "poi" stream: hilltop shrines, lighthouses, docks, salt works, quarries and fishing hamlets, at least 85 m apart. Each kind has a siting rule (height band, flatness, coast or summit) that loosens step by step until its minimum is placed. Piers are sited so their deck clears the ground all the way out to water 1.5 m deep. Poi assembles each from modular parts in a local frame turned in quarter turns, so every solid stays an axis-aligned box: walls with a door and lintel, plinths, steps down to the ground, roofs, a stair to a loft. Each POI carries loot spawn markers, exposed through PoiSet.loot_markers(), and walking routes from open ground into its interiors. - Simulation adds every POI solid to its ground and never spawns players inside one. - SimGround indexes solids in 8 m cells, so collision queries only test nearby boxes. Smoke p95 tick is 0.47 ms with about 300 solids. - Movement tests the body where it will stand after stepping up, so stairs with treads narrower than the body can be climbed. The traversal test found the lighthouse stair impassable without it. - PoiView draws parts as one MultiMesh per look, in the seafaring palette. Capture scenarios poi_<kind> frame each kind. - Summit stone is darker so it no longer reads as snow. Tests: 30 seeds get every kind within its limits, 10 to 16 in total, spaced and sited; placement is deterministic; loot markers stand on floors and are not inside solids; a player walks every route of every POI on 4 seeds through doors, up steps and the lighthouse stair; stairs with 0.45 m treads are climbed and a step doesn't carry the body into a wall; the solid index matches a full scan on 500 queries. Closes #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,9 @@ var rng: SimRng
|
||||
var ground: SimGround
|
||||
## The generated island, or null when a test supplied its own ground.
|
||||
var island: Island
|
||||
## The island's points of interest, whose solids are part of `ground`. Empty when a
|
||||
## test supplied its own ground.
|
||||
var pois: PoiSet = PoiSet.new()
|
||||
|
||||
## Player entity ID -> { command tick -> PlayerCommand }
|
||||
var _pending: Dictionary = {}
|
||||
@@ -29,6 +32,8 @@ func _init(match_seed: int, world: SimGround = null) -> void:
|
||||
if world == null:
|
||||
island = Island.generate(match_seed)
|
||||
world = island.ground
|
||||
pois = PoiSet.generate(island)
|
||||
pois.add_solids_to(world)
|
||||
ground = world
|
||||
|
||||
|
||||
@@ -41,7 +46,8 @@ func add_player() -> int:
|
||||
var z: float = spawn.randf() * size
|
||||
# Until the drop arrives (W7), spawn on dry land above the beach when there is any.
|
||||
for _attempt: int in SPAWN_ATTEMPTS:
|
||||
if ground.terrain_height(x, z) > Tuning.ISLAND_BEACH_TOP:
|
||||
var feet: Vector3 = Vector3(x, ground.terrain_height(x, z), z)
|
||||
if feet.y > Tuning.ISLAND_BEACH_TOP and not ground.body_blocked(feet, 2.0, Tuning.PLAYER_HEIGHT, 0.0):
|
||||
break
|
||||
x = spawn.randf() * size
|
||||
z = spawn.randf() * size
|
||||
|
||||
Reference in New Issue
Block a user