tideholm

Tideholm

A browser-based island empire game in the spirit of the classic early-2000s German browser strategy games — slow real-time timers, table-driven UI, alliances-and-raids gameplay. Original name, assets, text and numbers.

Bots play alongside humans using the exact same rules and actions.

Play it live: https://nostr.social/tideholm/ — sign in with a pod (create one).

Your island The world map
Island overview World map

Available in English, German and Czech — pick a language on the login screen or in-game; the whole UI, error messages and even battle reports are rendered in each player’s own language (public/i18n.js holds the dictionary; adding a language is one new block there plus a help page).

Run

node server.js

Then open http://localhost:3000 and register with any name + password.

No dependencies. State is saved to data/world.json every 30 seconds and on shutdown. Delete that file to start a fresh world.

Config (env vars)

World & server

Var Default Meaning
PORT 3000 HTTP port
GAME_SPEED 5 Multiplies production, divides build times. 1 ≈ classic pace (hours), 5 = minutes. Lower it (23) for a slower, more deliberate world.
BOTS 20 Bots spawned when a new world is created
FREE_ISLES 30 Uncharted (colonizable) islands on a new world
LAND_RESPAWN 0 (off) Uncharted islands added when the map runs out of them. Fires on world load, i.e. a server restart — so with it on, a deploy can reshape a live map and move the dominance threshold (all islands count toward WIN_SHARE). Off by default; see #36.
WORLD_THEME generated Map backdrop: generated (seeded fictional chart) or aegean (real coastlines; build other regions with tools/build-region.js)
WIN_SHARE 0.6 Island share a player/alliance must hold for a dominance victory
WONDER_WIN_LEVEL 5 Great Beacon level that wins the world. Raising it stretches the endgame: each level costs 1.55× more and takes 1.5× longer, and every completed level is announced world-wide.
NIGHT_BONUS Night window HH-HH (e.g. 22-6) where defenders get a bonus
ADMIN_TOKEN Enables the admin panel at /admin.html (stats, announce, reset)

Season lifecycle (#8, #2)

Var Default Meaning
WORLD_START now Launch time (epoch ms or ISO date). Before it, the world is frozen and shows a signup countdown so everyone starts together.
SEASON_AUTO off Auto-recycle a finished world into the next season
SEASON_END_GRACE_HOURS 48 Bragging window a won world lingers before auto-reset
SEASON_SIGNUP_HOURS 24 Pregame countdown for the next auto-started season

Balance / difficulty (#7, #13) — all default to prior behavior

Var Default Meaning
PROTECT_GRACE_HOURS 72 ÷ speed Newcomer shield in real hours (independent of speed). Set e.g. 48 for two real days.
PROTECTED_POINTS 40 Points below which a player can’t be attacked
BULLY_RATIO 3 Attack point-band: no punching up/down past this ratio
MORALE_FLOOR 0.3 Min attack-power multiplier when outweighing the defender
BOT_MORALE_FLOOR = MORALE_FLOOR Same, but vs bot defenders. Season 6 ran at 1 (the leader fights bots at full power) until 2026-09-08, then 0.3 like humans: a big player farming small bots pays the same morale tax as bullying a small human.
WONDER_WIN_COUNT 1 How many winning-level Beacons ONE captain must hold at once. At 2, build both (~2× the wonder bill — the pacifist premium) or build one and capture a rival’s: conquest carries buildings intact, so an enemy’s rising tower is a prize as much as a threat, and stealing a lone finished beacon no longer wins by itself. Wonder stays personal — alliances have the crown. Clamped [1, 5]. See #178.
WIN_BASIS all What WIN_SHARE is a share of: all islands on the map, or populated (inhabited only). Under season-6 curves a crown priced against the whole map is a decoy — the flagship ladder to 23 islands costs a second beacon — while half the living world tracks beacon-cost all season and rises as colonies land. See #177.
POOL_TRADE_SPEED / POOL_TRAVEL_MIN / POOL_TRAVEL_MAX 8 / 30 / off The Tidepool’s sails (#176): minutes per field for pool deliveries, the floor, and an optional ceiling in minutes (0 = uncapped). Defaults reproduce #76’s behaviour exactly (pool boats match TRADE_SPEED, 30-min floor, no cap). Distance stays real — the #30 brake holds — but the market’s boats can be tuned apart from merchant convoys. Loosening mid-season strands nothing, so these are env knobs, not world stamps. Season 6 runs 2 / 10 / 100.
TRANSIT_POP_FACTOR 0 (free) What fraction of its population an army costs while at sea — troops aboard attack, return, scout and colonize voyages charge pop × factor (ceil) against their home farm. 0 is the old behaviour: transit was population-free, so perpetual raiding pipelined a standing force unboundedly past the cap (train into the gap while the army sails; nothing re-checks on return). 0.5 — half rations at sea — keeps campaign surges possible while bounding the pipeline at ~2× cap; 1 is strict. Support is #40’s domain at full cost under its own world flag. Clamped to [0, 1], junk falls back to free. See #174.
FLAGSHIP_COST_GROWTH 1 (flat) The conquest unit rides the same positional curve as the Colony Ship, under its own knob — position is islands owned plus flagships already paid for (garrison, queue, aboard any movement), so batches cannot dodge. With settling taxed and flagships flat, width-by-conquest bypassed the expansion tax ~10× cheaper at position 10. Tune softer than COLONY_COST_GROWTH: conquest already pays in blood (1.2 puts the 10th flagship at ~29k all-in, the 15th ~73k). Same [1, 3] clamp as #61. See #173.
FLAGSHIP_STORAGE_CLAMP 1 (on) A flagship’s price is clamped to the launching isle’s storehouse, resource by resource, while at least one of the three still fits. Under #173 every resource climbs the same ladder, so wood overflows first and gold four rungs later; those four rungs used to be unbuyable for a non-money reason (“no storehouse can hold it”) and now cost a full storehouse of the overflowed resource. Once all three overflow the bare curve returns — unaffordable until the storehouse grows. Net: four more flagships per storehouse level, ~8% off the bill to isle 24, nothing off the calendar. 0 restores the bare curve. See #182.
BOT_RESPAWN 1 (on) Whether a bot wiped to its last island receives a refuge. Set 0 and a wiped bot is eliminated — the season’s BOTS become a finite population and attrition consolidates the endgame into PvP. Never gates humans. See #172.
BOT_GARRISON_RATIO Cap a bot’s standing defence to islandPoints × ratio (raiders exempt). Set e.g. 12 to stop bots turtling into unbeatable fortresses.
TRADE_SLOTS_PER_HARBOR 1 Merchant slots granted per Harbor level (#30). A shipment occupies one slot for the round trip, so distance costs throughput, not just patience — supplying a distant island is genuinely expensive. Applies to trade and market shipments; the Tidepool is exempt. New worlds only: existing seasons load unlimited (tradeSlots: null) so a restart cannot tighten logistics under plans already in motion. 0 grants no slots at all.
COLONY_COST_GROWTH 1 (flat) Colony Ship price multiplier per step along the expansion curve — cost × growth^(position-1), stepped per ship. Position is islands owned plus every colony ship already paid for (in a garrison, in a training queue, or sailing to settle), so ordering singly costs exactly the same as ordering a batch — counting islands alone let a player split orders for a 25% discount. 1.3 is the tuned brake on going wide: the 10th step costs ~29k all-in instead of 2.7k, the 15th ~106k. Steeper bites much harder than it looks (1.6 puts the 15th at 1.9M). Clamped to [1, 3] — anything outside falls back to flat, because an unbounded value made the ship unbuildable at any wealth while reporting “not enough resources” (#61). The train form quotes the real batch total, which is dearer than the single-ship price times the count (#62). Only meaningful from a fresh world.

Example — a fair, self-running “casual” world:

GAME_SPEED=3 \
WORLD_START=2026-07-20T18:00:00Z \
PROTECT_GRACE_HOURS=48 BOT_GARRISON_RATIO=12 BOT_MORALE_FLOOR=1 \
SEASON_AUTO=1 SEASON_SIGNUP_HOURS=24 SEASON_END_GRACE_HOURS=48 \
ADMIN_TOKEN=... node server.js

Gameplay

Combat model

Attack power A vs defense power D (home garrison defends). If A > D the attacker wins and loses fraction (D/A)^1.5 of the army; the defender’s garrison is wiped. Otherwise the attacker is wiped and the defender loses (A/D)^1.5. Loot is capped by the survivors’ carry capacity, drawn proportionally from the target’s stocks.

Defense counts the garrison plus all stationed support, then the Wall: D = (defenders + 15×wall) × (1 + 0.08×wall). A sacked island loses one wall level.

If a Flagship survives a winning attack it breaks 25-40 loyalty; at 0 the island changes owner: the Flagship is consumed, survivors stay as the garrison, and the island’s buildings and resources transfer. Loyalty regenerates at 2/h (×speed). An attack that arrives at an island you already own (e.g. captured by an earlier wave) reinforces it.

Roadmap

  1. ✅ Core loop: login, resources, buildings, queue, map, bots
  2. ✅ Units + combat: barracks, troops, attacks with travel time, battle reports
  3. ✅ Colonization: harbor, colony ships, uncharted islands, multi-island play
  4. ✅ Conquest: flagships, island capture, respawn after elimination
  5. ✅ Bot war AI: raids, grudges and retaliation, bot expansion
  6. ✅ Alliances, messaging, rankings
  7. ✅ War depth: loyalty conquest, support troops, scouts, wall, farm cap
  8. ✅ Trade shipments + QoL: renaming, battle simulator, map centering
  9. ✅ Bot war college, dominance victory, morale, night bonus

Running it for real

See deploy/DEPLOY.md — a systemd + Caddy recipe for a VPS, or Fly.io. The server enforces a single instance via a lockfile, keeps rolling world backups in data/backups/, rate-limits registration/login per IP and actions per player, and logs actions and errors (not polling) to stdout. Set TRUST_PROXY=1 behind a reverse proxy so rate limiting sees real client IPs and session cookies are marked Secure.

Run the engine test suite with node tests.js. Balance-test a simulated world with node playtest.js [days] [bots].

Set ADMIN_TOKEN to enable the admin panel at /admin.html: world stats, announcements to all players, and season reset (archives the old world to data/backups/, keeps the hall of fame). Without the env var the admin API is disabled entirely.

Run inside a Solid server (JSS)

Tideholm doubles as “plugin zero” for JSS’s plugin system (JavaScriptSolidServer#206): mounted at /tideholm inside a pod server, where your WebID is your player — no password, auto-provisioned on first request. See jss-plugin/ (adapter + manifest) and run the end-to-end proof with npm install && node jss-plugin/demo.js (JSS >= 0.0.214 comes from the devDependency; the game itself stays zero-dependency).

Layout

The Season DAO (#189)

A million shares a season, one gold each, bought with sealed gold that is burned. The book is dao.json beside the hall of fame (DAO_FILE, default under DATA_DIR), keyed by season, and outlives the world. GET /api/dao serves it public and CORS-open for the venue at https://tide-games.github.io/dao/. A buy is a negative trail move whose evidence is { venue: 'dao', mark, stake, shares }; /api/tidegate/sync checks one gold a share, a 100,000-share ceiling per move and the season’s remaining supply before the seal moves, then credits the ledger. No per-key cap, no vote, no trading in v1. Constants in dao.js.