Demo
One game, two windows, one server
Two players of an invented garden game, each in a window of their own, share a room, a trade and a chat through a realtime server that checks what they ask. Below them runs the first version: a garden on a pretend clock, a drink stand and an admin console.
This is a simulation. Both windows are on this page, and the realtime server is a small program in this page too: nothing goes over a network, no AI model runs, and the third player is scripted. The game, the players, the items and every number are invented. Nothing you type leaves your browser or is kept, and reloading the page starts again.
The rebuild: realtime
Each window stands for a player on a device of their own. A window only asks the server; the server checks, then sends what changed to every window that should see it, at once. Try it: create a room in Sparrow’s window, join it from Lark’s with the code, start the round and answer in both.
Mini-game room
No room yet. Create one and share its code.
In the room
Question 1 of 3
A bed has 3 rows of 4 sprouts. How many sprouts is that?
Scores, sent to everyone in the room
Items and trades
Coins: 20
Your items
- golden pear
- striped watering can
- pet snailPets are never sold
Offer for you
Chat
No messages yet.
Mini-game room
No room yet. Create one and share its code.
In the room
Question 1 of 3
A bed has 3 rows of 4 sprouts. How many sprouts is that?
Scores, sent to everyone in the room
Items and trades
Coins: 20
Your items
- silver berry
- blue clay pot
- pet beetlePets are never sold
Offer for you
Chat
No messages yet.
Finch plays on a third device with no window here. Finch’s moves are scripted: Finch answers a moment after the first answer to each question.
Finch can join once there is a room.
What the server sent
Every message the server broadcasts is listed here with the windows it reached. A refused request is never broadcast.
The first version: one garden
Pretend clock: Day 1, hour 6
A plant grows from the hour it was planted to the hour it is ready, worked out from those two times whenever the garden is drawn, so nothing has to run while nobody plays.
Plot 1
Pear, ready to harvest
Plot 2
Mint, 1 hour left
Plot 3
Empty
Basket
- mint
- mint
- berry
Customer queue
- Otter wants a pear spritz
- Heron wants a mint fizz
- Badger wants a berry cooler
- Newt wants a mint fizz
Nobody is waiting.
Coins earned: 0
What the demo shows
- The server checks, the windows only ask. Every sale and trade is checked by the server against what the player really owns. A made-up sale of an item that is not the player’s is refused, and the refusal goes back to that window alone. In the first version, the game checks a new price before saving it.
- Realtime rooms. A room joined by its code, a list of who is in it, a host who starts the round, and every answer and score sent to everyone in the room the moment the server has it.
- Late joiners land in the running round. A player who joins mid round is sent where the round is and the scores so far, and plays on from the open question.
- Trades checked at the moment of accepting. An offer names one item from each side. When it is accepted the server checks again that both still own them; if one was sold in the meantime, the offer is cancelled and nothing changes hands.
- Growth without a running loop. In the first version a plant’s state comes from when it was planted and the time now, so the garden keeps growing while nobody plays. Mutations follow a fixed list here, so every visitor sees the same golden first harvest.
- An admin console. A price changed there is checked, shows on the menu at once and is what the next customer pays.