Add persistent destructible world structures and building kits

This commit is contained in:
dingo
2026-09-09 22:46:06 -04:00
parent c2bef2a45f
commit e80064976a
36 changed files with 932 additions and 43 deletions
+92
View File
@@ -0,0 +1,92 @@
# Milestone 8a: world building checkpoint
Milestone 8 is **in progress**. This checkpoint implements the independent world
building work. House instances, keys, invitations, storage, deletion, and recovery
are not implemented here. Their access and recovery decisions remain pending.
## Playable building
Control's **Structures** tab publishes named, reusable definitions with
server-generated IDs, dimensions, health, presentation preset, and required
crafting profession/level. Definitions are immutable; placed structures copy
their definition and retain their builder, placement time, and kit provenance.
Recipes can output a structure's kit, and administrators can grant kits through
player item controls. Existing recipes are unchanged; author kit recipes in Control.
Inventory's **Building** section lists held kits. Choose orientation, select
**Choose placement**, then click clear ground within 8m. Esc cancels placement.
Go validates the location and consumes exactly one kit on success. Failed
placement consumes nothing. Crafting kits uses the existing discovery, failure,
provenance, and Builder XP system. Placement grants no additional XP. Kits can be
crafted in hubs without XP, but public hub construction is disabled.
Default blueprints are a timber wall, camp platform, and solid fort block.
They currently render as simple timber-colored boxes with their actual physical
dimensions. The fort block is a building component, not a completed hollow fort.
The appearance preset is retained for later asset work. No new model files are
claimed. Place multiple components to assemble layouts.
Structures persist in their owning survival world's snapshot after disconnect,
chunk unload, restart, or builder death. All players can damage them. Aggressive
and guard mobs can attack nearby structures; passive/healing mobs do not.
Projectile attacks visibly travel and hit the physical structure bounds; structures
also block healing projectiles. Melee, damage spells, and area damage can destroy
structures. Destruction removes health/collision without refunding a kit or creating
loot. It grants no new weapon/spell/character XP; legacy attack-attempt combat XP
continues to follow its existing behavior.
Movement uses swept structure bounds, shared with mob collision and combat sight
checks. Players can jump onto sufficiently low components, stand/jump on their
tops, and fall off edges. Mob navigation keeps its existing bounded side steps;
this is not a new global pathfinder. Gathering, looting, and revival also respect
structure obstruction.
Placement rejects overlapping buildings, living players, mobs, corpses, resources,
keystone return locations, excessive slope, and the world boundary. The protected
arrival/portal clearing remains open. New player and mob spawn locations avoid
structure interiors. This does not promise that players cannot enclose wider areas
with several structures; siege damage provides the current way through.
Provisional tuning in `server/content/balance.yaml`: 256 structures/world, 8m
placement range, 18m protected clearing, and at most 1m ground variation (also
limited to half the component height). No repair, demolition refunds, private
structure rights, housing storage, decay, or cross-world structure transfer is
introduced. Structures belong to their destructible world and confer no survivor
passage or housing eligibility.
## Manual playtest
1. In Control, grant Timber wall kits and Camp platform kits to a living character.
Alternatively, create a Builder recipe that outputs the desired kit and craft it.
Recipe discovery stays private to characters who attempt the recipe.
2. Open Inventory → Building, choose orientation/placement, and click clear ground
beyond the arrival clearing. Check kit consumption and the visible dimensions.
3. Try overlapping a structure or resource, building too far away, and placing in
the arrival clearing or hub. Verify rejected placement preserves the kit.
4. Walk into a wall, jump onto a camp platform, jump again, and walk off its edge.
5. Target a structure and attack it with melee, projectiles, and damage spells.
Test a projectile aimed through a structure at a mob. Check structure health and
removal at zero HP; test an aggressive mob next to a wall.
6. Leave/reload the chunk and reconnect. Verify structures keep their health and
position after a server restart and after the builder's death.
7. Publish a custom structure and recipe through Control; preview invalid bounds
or a missing profession and confirm publication is rejected.
Placement currently needs a pointer. Existing keyboard/controller combat targeting
includes structures. Full controller placement and a placement preview are follow-up
UI work. Browser automation remains deferred for manual testing.
## Housing decisions pending
- Whether a replacement must survive a world before exercising the creator's
recovery right.
- Initial rights for invited co-owners and guests. Key holders remain full owners
and cannot revoke other valid keys.
- Whether access ends immediately at last-key destruction or after the three-second
countdown. Qualifying recovery must reuse the same retained contents.
- Recovery without an established destructible death world must retain data;
no arbitrary purge deadline will be invented.
The confirmed last-key count, three-second deletion, and recovery-until-death-world-
destruction rules remain unchanged. This checkpoint does not activate those rules
or claim to finish milestone 8.