# ๐Ÿฆ– Dino Isle Online A multiplayer dino-survival island game in the spirit of *The Isle* โ€” playable in any browser. Eat, drink, rest, grow through 4 evolution stages, hunt AI prey, and devour the other players. **Zero dependencies** โ€” pure Node.js (HTTP + hand-rolled WebSocket) and vanilla JS canvas on the client. ## โ–ถ Play ``` node server.js # default port 8095 (PORT=xxxx node server.js to change) ``` Open **http://localhost:8095** โ€” open more tabs / other devices on the LAN for multiplayer. Everyone plays on the same persistent island. ## ๐ŸŽฎ How to survive | Key | Action | |---|---| | `WASD` / arrows | Move | | `Shift` | Sprint (drains stamina) | | `Space` / left click | Bite (hunt & fight) | | `E` (hold) | Context action: eat carcass ยท graze plants ยท drink at water | | `R` | Rest โ€” regenerates stamina/HP fast, but you're defenseless | | `Enter` | Chat ยท `M` mute | ### Survival loop - **Food** decays constantly; sprinting drains it faster. Starving hurts. - **Water** decays faster; stand in shallow water or at the shore and hold `E`. - **Health** only regenerates when fed & hydrated โ€” or fast while resting. - **Growth**: every meal gives XP โ†’ **Hatchling โ†’ Adolescent โ†’ Adult โ†’ Apex**. Each stage makes you visibly bigger, stronger and tougher (camera zooms out). - Diets matter: herbivores graze grass patches & berry bushes, carnivores hunt, omnivores eat everything. - **Fauna**: skittish critters roam land, fish shoals dart around shallows โ€” wade in and time your bite when they tire โ€” and **AI dinosaur herds** (*Dryosaurus*, *Psittacosaurus*) graze the plains: medium prey that flee hard but drop big carcasses worth feasting on. - **PvP**: everyone can attack everyone. Kills drop a carcass โ€” feast on your rivals for big XP. Death shows a recap screen; respawn keeps playing. - Watch the day/night cycle โ€” nights are dark and dangerous. ### ๐Ÿ›  Developer mode (testing helpers) Press **`` ` ``** (backquote) in-game to toggle. While active: - God-mode: no hunger/thirst decay, HP & stamina stay full - **ร—6 growth XP**, ร—2.5 bite damage, +28% speed - Hotkeys: **`1`** full heal ยท **`2`** evolve one stage instantly ยท **`3`** spawn an AI dino nearby ยท **`Alt+Click`** teleport to cursor ## ๐Ÿงช Tests ``` node test/smoke.mjs # headless 2-player integration test (join, sync, move, # hunt, AI-dino hunt, PvP kill, carcass feast, respawn, # chat, developer mode) node test/visual.mjs # real-browser UI test via playwright-core (menu โ†’ play) ``` ## ๐Ÿ—‚ Structure ``` server.js HTTP static server + WebSocket upgrade + game loop (20 Hz tick) sim.js Authoritative simulation: species, needs, growth, AI, combat worldgen.js Seeded island generation (tiles, forest decor, spawns) ws.js Minimal RFC6455 WebSocket implementation (no deps) public/ index.html ยท style.css ยท client.js (canvas renderer, prediction) test/smoke.mjs Headless multiplayer smoke test ``` Notes: `DEBUG_CHEATS=1` enables a `{t:'tp'}` teleport message used by tests.