TinyIsland.
1,000,000 grains of sand. One island in the middle of nowhere. Starts with one grain. Fight the tide.
This is a toy prototype. Your island is local-only — stored only in this browser tab. It is NOT saved to the server and NOT shared with anyone yet. Refresh = gone (unless this tab autosaves). Shared state, accounts, and moderation are coming later. Don’t build anything you wouldn’t want to lose. And yes — the tide fights back on purpose. It wants the island gone.
1,000,000 grains = one island big enough to live on. Every grain deals 1 damage to the Tide. Every 30 grains, and every 45 seconds, the Tide hits back — it washes sand away, floods a beach, tries to sink a whole row. Fight undoes its last attack, +10 bonus. Seawall blocks for 60s.
One grain. In my ocean. Cute. I will wash it away before lunch.
No attacks yet. The tide is pretending to be calm.
How to build: Sand on water → Palm / House / Rock on sand. Dredge removes land back to water. Fight = undoes the tide’s last attack. Seawall = blocks for 60s.
How it works (when it’s real)
Everyone builds the same island. One grain at a time. You pile sand, the tide tries to wash it away, you fight it back. Cooldowns, accounts, and moderation will keep it from becoming chaos. For now, you’re building alone — practice against a very rude tide.
- Add sand = 1 damage to the Tide
- Every 30 grains + every 45s, the Tide attacks
- Fight undoes its last attack, Seawall blocks for 60s
- Download .txt to keep your island
Community — coming soon
Shared state is not connected yet.
🟢 0 islanders building right now (fake — local toy)
🏖️ Last grain: —
⚔️ Last fight: — (not saved)
📜 Rules: No hate, no NSFW, no ads.
⬇ Backend — TinyIsland Backend — Template
Right now TinyIsland is a tinker toy — grid is a local 20 x 20 array in this tab, tideAttack() washes sand from the grid, totalEver is a local counter, history is 10 in-memory snapshots, and Refresh = gone (except local autosave). Disclaimer is the truth: local-only, not saved, not shared. This backend is the map to make it real: one shared island, per-grain writes by x / y, tide attacks as server events, cooldowns, accounts, moderation. Proposed, not connected.
01 / Files to create
api/tinyisland/grain.php POST /api/tinyisland/grain api/tinyisland/grains.php GET /api/tinyisland/grains?since= api/tinyisland/fight.php POST /api/tinyisland/fight api/tinyisland/snapshot.php GET /api/tinyisland/snapshot api/tinyisland/clear.php POST /api/tinyisland/clear (mod only) sql/tinyisland_tables.sql
Keep the tinyfiles PHP pattern: /api/bootstrap.php, json_in() / json_out(), prepared PDO.
02 / Database tables
-- sql/tinyisland_tables.sql
tinyisland_grains
id BIGINT AUTO_INCREMENT PRIMARY KEY
x SMALLINT NOT NULL -- 0-999
y SMALLINT NOT NULL -- 0-999
kind VARCHAR(20) NOT NULL -- "sand","palm","house","rock"
user_id INT NOT NULL
created_at DATETIME NOT NULL
UNIQUE(x, y)
tinyisland_attacks
id BIGINT AUTO_INCREMENT PRIMARY KEY
kind ENUM('wash','flood','sink','try_sink_row') NOT NULL
x SMALLINT NULL
y SMALLINT NULL
detail VARCHAR(200) NULL
created_at DATETIME NOT NULL
tinyisland_snapshot
id INT AUTO_INCREMENT PRIMARY KEY
path VARCHAR(200) NOT NULL
grain_count INT NOT NULL DEFAULT 0
created_at DATETIME NOT NULL
tinyisland_cooldowns
user_id INT PRIMARY KEY
last_write_at DATETIME NOT NULL
grains_last_minute INT NOT NULL DEFAULT 0Island is 1000 x 1000 = 1,000,000 grains. Never store a full island per user — store only grains by x / y, plus one snapshot. Same idea as TinyMap / TinyCity / TinyGarden, but sand instead of pixels / tiles / seeds. Toy shows 20 x 20 — real island is the full 1M-grain map.
03 / API endpoints
POST /api/tinyisland/grain
{ "grains": [ { "x": 512, "y": 400, "kind": "sand" } ] }
- auth required, 1-100 grains per request, x/y 0-999, kind in set
- cooldown: 1 write per 500ms, max 100 per request
- INSERT ... ON DUPLICATE KEY UPDATE kind, user_id
GET /api/tinyisland/grains?since=
- returns { "ok": true, "grains": [ { x, y, kind } ] }, max 5000
POST /api/tinyisland/fight
{ "attack_id": 123 } — undoes that tide attack, +10 bonus
GET /api/tinyisland/snapshot
- returns { "ok": true, "url": "/data/tinyisland/snapshot.json", "grain_count": 1234 }
POST /api/tinyisland/clear (mod only) — 403 unless modTide attacks are server events — tinyisland_attacks — not client random. Server decides wash / flood / sink / try_sink_row on timer + every 30 grains.
04 / Cooldown, moderation & validation
// Cooldown: 1 write per 500ms, 100 grains per request, 1 fight per 5s // Moderation: no hate / NSFW / ads — mods can clear + ban user_id // Validation: x/y ints 0-999, kind in allowed set — else 400
Keep disclaimer until this ships: “Tinker toy — not live yet. Refresh = gone.”
05 / Frontend wiring
// grid[20][20] is already local. After building (debounced 800ms): // POST /api/tinyisland/grain with new grains // Poll GET /api/tinyisland/grains?since= every 2s, apply only new grains // On load: GET /api/tinyisland/snapshot -> load into grid // If API fails, fall back to local-only toy + disclaimer.
api/tinyisland/ + sql/tinyisland_tables.sql — no GitHub needed. Shared 1,000,000-grain island, per-grain writes by x / y, tide as server events, cooldowns + moderation.