How it's built
The world
One procedural island. There are no terrain or texture downloads; the only models are four small Kenney props. Everything that has to agree between the terrain, the scenery, the gameplay and the scenario cameras lives in one layout file.
drone-island scenario: the island from 700 m out. The village and pier are on the south shore, the jungle hill rises to the north-west.#Layout
src/world/layout.js is hand-placed, in metres, with y up, sea level at 0 and north towards −Z.
| Feature | Values |
|---|---|
| Island | Mean shoreline radius 235 m; peak 92 m high at (−30, −45); sea floor down to −42 m |
| Village | On the south shore round (38, 168): 13 stilt houses, two market stalls, a gazebo |
| Pier | Runs south from the beach at x = 70, from z = 204 to 318 (114 m); 3.2 m wide, deck 2.25 m above the sea, lamps every 16 m; a 9 m wide head over the last 18 m |
| Boat mooring | East side of the pier head, (79.5, 309), bow pointing out to sea |
| Path | A dirt path, 2.2 m wide, from the jungle hill down through the village to the pier foot |
| Islets | Five rocky islets offshore with sandy aprons, radius 18–42 m, 16–38 m high |
| Crabs | Four spots along the south beach |
#Terrain
src/world/terrain.js defines the island height analytically: a noisy shoreline (kept calmer along the village arc), the hill, a flattened village terrace, a slightly sunken path, the lagoon shelf with reef patches (kept clear along the pier lane), the drop-off to the deep, and the islets. It's baked once into a 1024² grid covering ±640 m. After that the terrain mesh, NatureGL Water's bathymetry, the grass, the scatter layers and the gameplay all read the same bilinear grid, along with masks for grass, jungle, sand and the path.
src/world/terrainMesh.js turns it into a warped grid that is dense at the island and coarse far out (300 to 480 segments, by tier), plus a flat deep-sea skirt to the horizon. The ground shader adds the colours, wet sand and sea-floor ripples.
#Vegetation
| Module | What it builds |
|---|---|
vegetation.js | Palms and broadleaf jungle trees, instanced in 96 m chunks for frustum culling, with a lighter far LOD beyond 125 m. Palm fronds have fresh, yellowing and dead brown variants. All of it sways with NatureGL Grass's wind. |
undergrowth.js | NatureGL Grass ScatterSystem layers streamed round the camera: ferns, banana plants, bushes, rocks, flowers, and grass tufts and shells on the beach |
| NatureGL Grass | The grass field itself, on the grass mask, thinner on the trodden village terrace |
The tree and scatter density scale with the quality tier.
#Village and props
src/world/village.js builds the stilt houses, market stalls, gazebo, path stones, picket fences, yard clutter (barrels, crates, benches, flower pots, drying nets), a canoe, a picnic table, the pier, lamp posts with swinging lanterns, cloth that flaps in the wind and signs that swing. Most of it is merged into a few draw calls with the MeshBuilder in geometry.js. At night the lamps and windows light up.
src/world/props.js loads four Kenney Pirate Kit models (CC0): a barrel, a crate, a chest and a small rowing boat, from demo/public/models/pirate-kit/. If they fail to load, the game logs a warning and carries on without them.
#Under the sea
| Module | What it builds |
|---|---|
reef.js | Reef rocks and four procedural coral types (staghorn, brain, sea fan, tube sponge) in clumps, plus big coral bommies along the whale's route; instanced in 320 m chunks |
seagrass.js | About 9 000 instanced sea-grass clumps (scaled by tier) in patchy meadows between 2 and 17 m deep. The same density function tints the sand under them, so they read as dark patches from the drone |
marineSnow.js | Drifting motes round the camera, only under water |
#Wildlife
| Module | Behaviour | Count (low → ultra) |
|---|---|---|
life/birds.js | A boids flock circling the lagoon; now and then one dives into the sea with a splash and flies back up | 16 → 40 |
life/crabs.js | Idle side-steps, flee from you, burrow when cornered and reappear later | |
life/sea.js | Fish schools over the reef, and a humpback cruising the drop-off with schools keeping it company | 140 → 600 fish |
Scenarios re-seed the birds and crabs and set the sea life to a fixed time, so every run of a scenario looks the same.
#The boat
src/world/boat.js builds the fishing boat procedurally: a lofted hull, a wheelhouse with a raked three-pane windscreen and side windows, wipers, a cabin light, an instrument panel with gauges and switches, a compass binnacle, a wheel and throttle that animate, and chart-plotter and radar screens drawn to canvas textures. See The boat.