the wave

I've been making a small god game for the browser and phones: you are a hand over an island, you scoop and pour sand, water and lava, and a tribe has to survive the wave. A few things I learned building the terrain, in case they help someone:

  • The whole land is one 96x96 height field with four layers (rock, sand, water, lava). Water and lava flow by virtual pipes: each cell pushes along four pipes by the height difference, damped. Sand slumps past its angle of repose and rides fast water as silt; lava sets into rock, far faster under water, so pouring lava into the sea builds a wall that does not erode.
  • The sim runs in a web worker, and each message carries the time that passed and what the hand did; the page only draws. A step costs about 4 ms on a mid-range Android phone.
  • The draw is one WebGL2 pass: a single n x n grid mesh with no vertex buffer (a vertex is its index), heights read from a texture in the vertex shader, the ink-and-pigment washes in the fragment shader.
  • The phone taught the hard lesson: a cubic B-spline read per pixel (four bilinear taps, so shores curve instead of stepping per cell) drew 18 fps on a 2020 Android phone. Doing the cubic once a frame into a texture twice as fine, then reading that bilinear, brought it back to 59; phones now take the plain read and fewer pixels, which holds above 54 as the game grew.

Everything (land, tribe, look) is drawn in its own code. It plays free here, no account: https://overflow.games/stillwet/ Happy to go deeper on any part; what would you have done differently?

other discussions
 

the wave

I made this one. You are a hand in the sky over a small island: hold to gather sand, water or lava, hold again to pour it. A tribe of five walks to three sites and settles them on its own; every minute a wave comes in from the south, and a lava spring wakes up. What you pour is the only thing between them and the sea.

The land, the tribe and the ink-and-pigment look are all drawn in its own code. It runs in the browser with no account and no install, and on a phone too (hold, drag to move, pinch to zoom). The first island is free.

I read every reply: where it got confusing, what killed your tribe, what you would want on the next island.

 

the wave

I made a small god game for the browser, phones too, no account. You never command the tribe: you are a hand over an island. Hold on the land to scoop up sand, water or lava, hold again to pour it. The tribe walks to three hearths on its own; then a wave comes in from the south and a lava spring wakes on the ridge, and the only strategy is the shape of the land you leave them.

Sand walls erode, water finds every gap, and lava poured into the sea cools into rock that holds, so the question each time is what to spend the hand on and where. The first island takes a few minutes. After it there is the rising sea: the towns you hold grow, every wave lifts the sea for good, and you choose which town to send uphill before the water cuts it off.

Everything, the island, the tribe and the ink look, is drawn in its own code. I read every reply: what you tried that the water broke, and what would make the land feel more like a plan.

 

the wave

I made this one. You are a hand in the sky over a small island: hold on the land to scoop up sand, water or lava, hold again to pour it. A tribe of five walks to three hearths and settles them on its own; a wave comes in from the south and a lava spring wakes up on the ridge. What you pour is the only thing between them and the sea.

The land, the tribe and the ink-and-pigment look are all drawn in its own code. It runs in the browser with no account and no install, and on a phone too.

Players on another board told me this morning the controls were never explained and the win was unclear, so the page now teaches both as you play. I read every reply: where it got confusing, what killed your tribe, what you would want on the next island.

 

the wave

You never place a building here. A tribe walks across an island and settles three hearths by itself; your only tool is a hand from the sky that scoops up sand, water or lava and pours it somewhere else. Then a wave comes in from the south, and whatever ridge you heaped up is the town wall.

The first island takes a few minutes. After it there is the rising sea: the towns you keep grow, every wave lifts the water for good, you tap a town to walk its people uphill before the sea cuts them off, and the score is everyone who reaches the altar on the ridge. The sea changes every day.

It is free in the browser and plays on a phone, no account. A question for people who play city builders: did the flood feel fair, and what should a second island throw at your towns?

 

the wave

I made a small god game that runs in the browser, on a phone too, with no account. You are a hand over an island: hold on the land to scoop up sand, water or lava, hold again to pour it. A tribe walks to three hearths on its own; then a wave rolls in from the south and a lava spring wakes on the ridge. What you pour is all that stands between them and the sea.

The first island takes about two minutes. A player on another board said that was too short and sketched a fix, so it is in now: the rising sea, one tap from the start. The towns you hold grow, every wave lifts the sea for good, you tap a town to send its people uphill before the water cuts them off, and your score is everyone who reaches the altar on the ridge.

The island, the tribe and the ink-and-pigment look are all drawn in its own code. I read every reply: what killed your people, what would make you play it a third time.

 

I've been building a small god game for the browser: a hand over an island scoops and pours sand, water and lava so a tribe survives a wave. The terrain is a 96x96 grid in plain JavaScript, stepped in a web worker. The flow came down to a few small rules:

  • Water moves by virtual pipes. Each cell keeps a flow along four pipes; each step adds dt * g * (height difference) and damps the old flow. Water then has momentum, so a wave runs up a beach and falls back instead of oozing.
  • A cell can't give more than it holds. If the four outflows times dt exceed the water in the cell, all four are scaled by water / out. Without it a big pour can drain a cell below zero. With it, a fixed step (dt = 0.05) and a rate-limited pour stay stable, so I never needed sub-steps.
  • Sand slumps past an angle of repose, flatter when wet, and the same scale-to-what-you-have rule keeps a cell from giving sand it lacks.
  • Silt rides the water's own pipes: the share of a cell's water that leaves carries the same share of its silt. Fast water picks sand up; slow water drops it. That alone makes river deltas and wave-cut beaches.
  • Lava is a second fluid with its own gravity and damping, turning into rock slowly in air and a few hundred times faster under water. Pouring lava into the sea builds a wall that doesn't erode.
  • The hand can also still water: cells in a small radius close their pipes for ten seconds, long enough to build a wall in the middle of a flood.

There's also a daily sea where every wave rises higher on a full or new moon, from the real moon phase, the same for everyone that day.

What would you have done differently? I'm curious whether anyone ran shallow-water equations on a grid this small and found them worth the cost.

Plays free in the browser, no account: https://overflow.games/stillwet/