# WildlandsWorld
Owns the physical world: it generates the terrain mesh and its heightfield
collider, the lake, the desert flat, the ruined colonnade, the forest, the
resource nodes and every wild creature, all under one root entity so a reload
reclaims the lot.
It also keeps the live state of everything it spawned — each node's kind,
health and drops, each creature's record — and answers the questions the player
component asks: what is under the crosshair, what did that swing hit, where is
the nearest creature, and what station is close enough to use.
Attached to `wl_host` by the scene's `build.luau`. Fields: `seed` (change it for
a different landscape), `buildInEdit` (also generate while authoring),
`creatureBudget` and `tickEvery` (how many creatures are simulated and how often
far ones are updated).
# wl_land
The landscape, as one height function. `height(x, z)` is the authority on where
the ground is: the rendered terrain mesh, the physics heightfield, every tree,
rock and creature placement and the player's spawn all read it, so what you see
and what you stand on are the same surface by construction.
Also exposes `normalAt`, `SPAWN` and `spawnY`.
Callers: `WildlandsWorld` (terrain, placement), the scene entrypoint (spawn
point), `WildlandsPlayer` (lake and terrain references).
# wl_character
The survival explorer's kit.
The rigged body the engine ships has no material of its own and no clothing, so
this module gives it both: a skin material on the skinned mesh, and around
twenty garment pieces seated on the skeleton with `Humanoid:attach` — jacket,
collar, scarf, crossed straps, belt and pouches, backpack with straps and
bedroll, sleeves, gloves, trousers, laced boots and hair.
Sleeves and trousers are measured, not guessed: each is built by taking the two
bones at the ends of a limb and expressing the world direction between them in
the first bone's own basis, so it lies along the real arm or leg whatever the
rig's bone frames are.
`CH.hold` seats a tool in the right hand; `CH.stow` puts one on the pack.
Called by the scene entrypoint on `localPlayerReady`.
# WildlandsHUD
Every screen in the game: the HUD (health, stamina and hunger bars, the
nine-slot hotbar with counts and durability, the quest tracker, the boss bar,
notices, and the crosshair readout naming whatever is targeted and what to do
with it) and the panel that holds the inventory, crafting, the creature team,
the build menu, the map and the pause menu.
A screen is a pure function of game state and is only redrawn when a signature
of that state changes, so a still frame costs nothing.
Attached to its own `wl_hud_host` entity by the scene entrypoint. It reads
state from `wl_core` and drives actions through `WildlandsWorld`.
# WildlandsPlayer
Everything the person at the keyboard does, on top of the movement the avatar
already provides: swinging a tool at what the crosshair is on, hand-gathering
loose stone and fiber with E, throwing a Wildcore Orb and resolving the capture,
eating, and keeping the survival meters honest.
Targeting is aim-based, not proximity-based: `WildlandsWorld:aimNode` scores each
node by how directly it lies along the camera's forward, so the tree you look at
is the tree you hit.
Attached to the player's avatar body by the scene entrypoint on
`localPlayerReady`. It activates the `wildlands` input map and needs
`WildlandsWorld` to exist.
# wl_core
The one piece of shared runtime state. Components run in separate VMs, so
anything they must agree on lives here: inventory, hotbar, survival meters,
quest progress, captured companions, placed structures and the save file.
The state table comes from `modules.state()`, so a hot reload of this module
keeps everything. The save is written to `/source/local/wildlands_save.json`
and read back by the scene entrypoint on load.
Callers: `WildlandsPlayer`, `WildlandsHUD`, `WildlandsWorld`, `wl_creatures`
(loot and companion records) and the scene entrypoint.