Range Edition

Lars Rocha's Indexin land laws, as a Rust engine, running in a browser. A whole landscape is decided by a ruler sequence — the number of trailing zeros in a coordinate — and nothing is stored: no heightmap, no seed table, no chunk files. Ask the law where the ground is and it tells you, anywhere, in any order.

Seven games, one download. Every page here loads the same module and asks it which game it is, so the second one you open is already in the browser's cache. All seven together cost 1.66 MB gzipped, against 1.39 for the pod race on its own — the engine under them is the same engine, and it is only paid for once.

Play

Running at a few frames a second? Try the light version. Chrome on Windows sometimes falls back to drawing on the processor instead of the graphics card — open chrome://gpu and look at Command Line near the top: a --use-gl flag there is the usual cause, and the page will say Software rendering when that is what it found.

A range from a word

Type anything. The word is the address — the law reads a range out of it and builds the ground on demand, the same way a car here is three numbers rather than a row in a table. Nothing is stored, nothing is downloaded, and the same word always gives the same range, on any machine, for ever. Your name is a mountain range, and it is the same one tomorrow.

Someone has to go first: try sunset lars indexin deepwater ashfall

Two hundred and seven words were held to the same bar the named ranges are: the shortest of them still stands 1,218 blocks above its own water line, and the plainest still shows five colours. One word in four comes back drowned — a range with the sea a fifth of the way up it, so the summits stand out of the water as their own archipelago — and one in eight comes back as a rift, ash at the water's edge and lava in the gorges. The rest are mountains.

And ten chosen rather than rolled

The same law, but with their knobs picked one at a time and measured before they were named — how tall, how much of it is land, how many separate islands it breaks into, how many colours its own palette shows on it. Four of them were thrown away and rebuilt when the measurement said they were plains. A word cannot reach these: the Prime Isles and the Stepped Range need a land law, a base and a stature chosen together, and rolling those is how you get a plain.

Nine races, nine laws

Three of the ranges draw a closed circuit of their own; on a range with none, sixteen gates are laid in a ring the world's own word places. Same pod, same rules, nine different pieces of arithmetic under the wheels — all nine on one page.

And the five sports, eight ways

Two a side with one big ball — and the same pitch with two balls on it, and a third whose floor is a lake. Then the ring, the derby, two ovals and the gate rush — all of them with their own words.

And the cars are addresses, not a list. The ruler sequence picks a car's class — half of all addresses are a saloon and one in 128 is a wedge, because that is what the sequence is — a hash picks its proportions, and two more addresses pick its paint and its trim. The shape then decides how it drives: a long car is heavy and turns worse, a tall narrow one rolls. Nothing is stored, and the same address always gives the same car.

Anything the native build takes on the command line, a link takes in its query string: ?world=glasswind&race&laps=5&rivals=7&hour=0.35&go. Tab opens the menu, which lists the rest — and its GAME row hands you straight over to any of the other six, on the range you are looking at.

What you are looking at

GraphicsWebGPU where the browser has it, WebGL2 where it does not
Download1.66 MB gzipped, once, for all seven games
Threadsnone — the ground is built in a worker, which is a second instance rather than a second thread, so no SharedArrayBuffer and no special headers
Stored datanone; the law is asked afresh every time

The ground is built in a second copy of the engine. A browser gives a page one thread, and the ground under you is tens of megabytes of arithmetic that has to be rebuilt whenever you have moved far enough — which used to stop the picture for as long as it took. It is now built in a worker: the same compiled module, loaded a second time, handed the few words it takes to describe a region and handing back the finished ground. The old picture keeps drawing the whole time, which is exactly what the native build does with its second thread.

That needed no special headers and no SharedArrayBuffer — a worker is a second instance, not a second thread. The only build you still wait for is the first, and it is deliberately coarse so that something is on screen quickly and sharpens a moment later. You will see it sharpen. That is the trade.

Everything else is the same arithmetic: the laws are checked against the JavaScript original's own fixtures, bit for bit, and the Rust compiled here is the Rust that passes them. The tower defence's whole balance table is held against 423 complete games and 52 table rows with no tolerance at all, and the ground a worker builds is held against the ground the page would have built, vertex for vertex.

And the original, beside it

This is a port. Wander — the original, in JavaScript — is Lars Rocha's, and it is still the authority: every law here was checked against its fixtures rather than against a judgement of what the law ought to be, and where the two disagree the original is what gets believed. It carries a great deal this one does not yet: more ranges, the island and volcano laws, the dogfight, the other six tank battles, the courtyard interiors.

What this one has instead is a compiled engine: a native build with a second thread for the ground, a hundred-odd ranges reachable from one menu, and a set of libraries any other program can import. Both stay up, so the difference can be judged rather than claimed.