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/

[–] [S] 1 point 2 weeks ago

No sub-step so far, and the 4 ms does not move with a big pour: the step loops over every cell of the 96x96 grid whatever they hold, so a flood costs the same as a dry island.

What keeps a big pour stable at a fixed step (0.05 s of sim per tick):

  • The hand pours at a set rate, spread over a disc about 3.5 cells wide, so no single tick drops a tall column on one cell.
  • When a cell's four outflows together would take more than it holds, all four are scaled down by the same factor, so no cell goes negative.
  • The pipes are damped, which eats most of the sloshing.
  • The worker runs at most three ticks per message, so a late frame slows the game down instead of growing the step.

If I ever let the hand drop a whole lake in one go, a sub-step on the fluids alone (not sand or heat) is where I'd start.

  • source
  • parent
  • context
  •  

    Yesterday: 38 people faced Sea 2; the best kept 35 of the salt people dry, the middle 21.

    Today's rising sea: the waves come at the same times and sizes for everyone, and every wave lifts the sea for good. Hold on the land to gather sand, hold again to pour it; walls keep a town dry and growing, a tap sends its people up to the altar before the water cuts the way.

    Post your line here (the share button gives "Sea 3: ..."). I read every reply.

    [–] [S] 1 point 2 weeks ago

    Three people start, each walking to a town of its own. A town grows by one every 8 seconds while it stays dry, up to 20, so yes, 30 and more is possible. Losing none but sending them up early keeps the count low; the higher scores held the towns with sand walls through more waves and sent them up just before the water cut the path. No instructions page yet; that is my fault and it is coming.

  • source
  • parent
  • context
  • [–] [S] 1 point 2 weeks ago

    The sea has no win or lose, only a score: everyone still dry when it ends, in a town or at the altar. It ends when only the altar stands above the water. People who walk up early are safe but stop growing, so the game is how long you dare keep each town below with sand.

  • source
  • parent
  • context
  • [–] [S] 4 points 2 weeks ago (1 child)

    There is no instructions page yet, and that is on me; one is coming. The short version: hold on the land to gather sand, hold again while your hand is full to pour it. Each town grows by one person every 8 seconds while it stays dry (up to 20), and each of the 7 waves lifts the sea for good. Sand walls keep a town dry longer, so it grows longer. Tap a town to send its people up to the altar on the ridge before the water cuts their way. Your score is everyone still dry at the end.

  • source
  • parent
  • context
  • [–] [S] 1 point 2 weeks ago

    @How_do_I_computah@lemmy.world (your comment never reached our instance, so here): Fair, and well put. The free part ends exactly where the arrows end, so it plays as "do what I say, now pay". The next build moves the gate later: real free play on the island after the guided part, before any price shows up.

  • source
  • [–] [S] 1 point 2 weeks ago

    Thanks, this is the useful kind of feedback, and you're right on each point. The hand gives no sign that it holds sand, so it looks like the sand vanishes. The hearths (the camps the tribe walks to and has to keep dry) are never explained. And the stats are a wall of text. The next build fixes those three: the hand shows what it carries and how much, a hearth gets one plain line the first time you see one, and the stats become icons.

  • source
  • parent
  • context
  •  

    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?

     

    Today's rising sea: the waves come at the same times and sizes for everyone, and every wave lifts the sea for good. Pile sand, cool lava into rock, and send each town up to the altar before the water cuts it off.

    So far today: 10 people finished Sea 2; the best kept 31 of the salt people dry, the middle 24.

    Post your line here (the share button gives "Sea 2: ..."). I read every reply.

     

    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

    A daily god game, in the browser or on a phone, no account. You are a hand over an island: hold on the land to scoop sand, water or lava, hold again to pour it. A tribe settles three towns; seven waves roll in from the south, and every wave lifts the sea for good. Build walls, and tap a town to send its people up to the altar on the ridge before the water cuts them off.

    Each UTC day has one sea: the waves come at the same times and sizes for everyone, so scores compare. Your score is everyone who reaches the altar or still stands when the last wave ends; the share button gives a line like "Sea 2: 14 of the salt people safe". The best so far is 35.

    A round takes a few minutes. The island, the people and the ink look are drawn in its own code. Post your sea here; I read every reply, and what drowned your town tells me what to fix.

     

    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.

    [–] [S] 2 points 3 weeks ago (1 child)

    Fair, all of it. It is one island of about two minutes, the tribe walks a fixed path, and once you know the answer it plays the same every time. Your sketch fixes exactly that: towns that grow while you hold them, an evacuation you choose, a sea that rises with every wave, and the altar count as the score. I am building it as an endless mode on the same island and will post here when it plays. The price waits until there is something worth paying for.

  • source
  • parent
  • context
  • [–] [S] 1 point 3 weeks ago (1 child)

    Thanks for sticking with it. What the hand holds shows as a fill bar inside the sand, water or lava button you picked at the foot of the screen; since yesterday the page also says, as you play, where to scoop and when to pour. If the bar was still too easy to miss on your Pixel, I'll make the hand itself show its load.

  • source
  • parent
  • context
  •  

    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.

    [–] [S] 2 points 3 weeks ago (3 children)

    It is meant to play on a phone: hold a finger on the land to scoop, hold again to pour, drag to look around (the page now says so). If something broke on yours, which phone and browser was it? I would like to fix it.

  • source
  • parent
  • context
  •  

    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.

    view more: next ›