DEV Community

Cover image for Farther Shore: a live WebGL2 demo where the whole planet is one seed
Tomas Grasl
Tomas Grasl

Posted on Edited on

Farther Shore: a live WebGL2 demo where the whole planet is one seed

Everything in this demo comes from one number.

Farther Shore is a live demo on a stylised low-poly planet. It is not rendered offline and it is not edited footage. It is played live, in the browser, from a shot list, in my own engine, Wallhammer Web.

The planet, the islands, the mountains, the sea, the clouds, the villages, the travellers walking through them: none of it is a file. There are no models, no textures, no images. There is a seed, and there is code.

One seed, the same world, every time

The rule of the engine is simple: the same seed gives the same world. Not a similar world. The same one, down to the last tree.

That works because everything is built by generator functions, and each generator is seeded by name. The terrain asks for its own seed, the clouds ask for theirs, a village asks for its own, and every one of them is derived from the one seed at the top. Change the top seed and you get a different planet. Keep it and you get exactly this demo again.

Under the hood:

  • Rendering is plain WebGL2. No three.js, no graphics library. The only runtime dependency is earcut.
  • The world is a sphere, streamed in quadtree cells around the camera, generated in workers.
  • The sea, the sky and volumetric clouds are drawn by the engine; the sun follows the hour and the date.
  • The simulation is deterministic: fixed-step ticks in integer millimetres, driven by a command log, so the same commands give the same result in the browser and in plain Node.

Why a shot list

A deterministic world means a camera path is enough to reproduce a scene. The demo is just a list of shots: where the camera is, where it looks, how long it stays. Play the list against the same seed and you get the same demo. Nothing is recorded as data except the seed and the shots.

That is also how I test the engine. The engine has golden recipes: known seeds whose results are hashed, and the engine checks that they still come out the same.

Where this is going

The direction is to push this all the way: everything in the world is a hash or a seed. A place is a seed. A building is a seed. A scene is a seed plus a list of commands. If you have the numbers, you have the world; you do not need the files.

There is a lot left to do, and the demo shows the rough edges too. But every frame of it already comes from one seed.

Try it

If you are building something similar, or you think a seed cannot hold a whole world, I would like to hear from you.

Top comments (0)