
Building a multiplayer terrain sandbox that stores 8x less data than Minecraft
VELD is my one-person indie open-world sandbox adventure prototype. Its procedural terrain is built to extend as you explore, and I’m using browser and server tech to test approaches to terrain, networking and multiplay…
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
VELD is my one-person indie open-world sandbox adventure prototype. Its procedural terrain is built to extend as you explore, and I’m using browser and server tech to test approaches to terrain, networking and multiplayer performance.
A smooth hillside becomes a tunnel and a building site. Here is the state that makes that possible.
Try the cave diagrams ↓ Dig sideways into a cliff, then see which heightmap samples turn block-shaped.
I want a hillside you can cross, dig into and build on, with another ridge waiting beyond it. VELD starts with generated terrain and layers player changes on top: excavation for caves and separate geometry for construction.
A generated heightfield describes the untouched landscape. A separate edit layer records where players excavate, allowing tunnels beneath the surface; placed geometry handles player-built walls and roofs.
Start at zero: the cliff is one continuous generated surface. Drag to excavate sideways. Only the opening and exposed cave faces become cell-shaped; the high roof still follows the heightmap. Switch to a surface pit to see the different effect.
Schematic side view: one excavation cell = one metre. The generated solid is queried against a sparse set of removed cells. Outlines show exposed cell boundaries, not a dense stored world. The roof is the untouched solid above the hole. This is geometry, not a structural-collapse simulation.
Click a column to position a dig. Adjust its height to see how nearby terrain can become block-shaped while higher ground stays smooth. The side view connects the excavation to the generated surface.
Side view of the selected row; horizontal spacing is enlarged for readability. The buttons below are height samples, not a voxel rendering of the world.
The displayed heights are illustrative. The local effect depends on both the dig and the generated surface; the diagram is not a copy of the production rule.
When a dig meets a slope, nearby exposed terrain becomes block-shaped while the hillside above stays smooth. The rendered surface, shovel target and collision use the same result. Inside a cave, ground queries find the floor below the player instead of stopping at the hill overhead. The diagrams show both effects.
The browser, worker and server share terrain rules for edits and surface queries. Saved changes are tied to the world generator so a later terrain revision cannot silently move the ground around old holes.
The first version kept several indexes for each edit. The current store adapts its representation as edits accumulate, reducing duplicate bookkeeping while keeping cave-floor and surface queries local.
For a synthetic 32 × 32 × 128 sample region with 1,000 spread edits, VELD stores about 8 KiB of typed terrain data plus its height cache. These are representation-level estimates, not whole-engine or server-memory comparisons.
Minecraft estimates use 32 mixed 16³ sections at 4–8 bits per sample; uniform sections differ. The Roblox estimate follows its published 2017 row-packed model including mip levels; current storage may differ. Roblox supports runtime excavation. Payload excludes meshes, lighting, construction, networking and other engine state. Minecraft section constants · palette implementation · Roblox storage model · Roblox Terrain reference.
The adaptive store reduced retained excavation memory in both same-workload tests:
Median retained JavaScript heap plus ArrayBuffers across five isolated Node processes on Apple M4. Other game systems are excluded; this does not establish whole-server memory, FPS or player capacity.
A single edit can carry more fixed setup overhead than the previous store; that is a memory result, not evidence that digging is slower. Repeated collision and aiming queries improved in these runs, while general key lookup, enumeration and large chunk replies regressed.
The server verifies and owns excavation. Nearby clients receive edits and rebuild affected terrain; returning players can catch up on changes they missed. Saves preserve excavations and ore discoveries across a restart.
Workers build terrain geometry as needed. The browser keeps the current mesh visible until its replacement is ready, and raises detail around nearby digs so a coarse hillside does not hide a cave mouth.
Generated terrain can continue as you travel, though the current world coordinates have finite bounds. A heightfield suits landscapes; caves and buildings use separate layers.
Choose the world representation around the edits players make. Measure the cost where those edits accumulate.
You can test this mechanic in my game, VELD, free in your browser. Click below to play, and shoot me a few feedback notes — always appreciated.
Dig, build, explore — and tell me how it feels.
Big company interested in trying VELD and donating to support a Nordic woman dealing with a special-needs case? Email me.
Want bants? DM me on Twitter at @craftfortress.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。