Risk (replica)

1 language
  • Article
  • Read
From Wikipedia, the free encyclopedia
This article is about the replica. For the game it replicates, see RISK: Global Domination. For the Slay-like territory game in the same repository, see Island Empire (replica).
Risk (replica)
Screenshot of the Risk replica in the draft phase: a South America board with owner-coloured territories, numbered troop tokens, the roster capsules on the right edge, the Deploy Troops count dialog and the troops-to-deploy counter
Screenshot of the Risk replica in the draft phase: a South America board with owner-coloured territories, numbered troop tokens, the roster capsules on the right edge, the Deploy Troops count dialog and the troops-to-deploy counter
TypeTurn-based strategy board game, in the browser
Replica ofRISK: Global Domination
DeveloperDavid
Written inNext.js 16, pure deterministic engine with exact battle-odds tables, PGlite (local) / Neon (production)
Tests1,880 unit and property tests, 18 e2e runs
Built withEight research lanes, seven build slices, six review rounds
Repository../Risk
PlatformWeb browser (desktop and phone)
ReleasedOctober 2026
Websitehttps://risk-david.vercel.app

Risk (replica) is a browser rebuild of RISK: Global Domination, SMG Studio's digital edition (2019) of the Hasbro board game. It was developed in the Risk folder of the Replicates repository and ships three ways to play — solo against five tiers of computer opponent, pass-and-play for up to six people on one device, and casual online games behind a four-letter lobby code — over sixteen boards and eleven rule modifiers. Its defining property is that the game engine contains no randomness at all: every die roll, card draw and opening deal is data inside the action that caused it.[1]

Overview

The rules follow the digital edition rather than the printed one where the two differ. A turn is a draft, an attack phase and one fortify move; reinforcements are a third of the territories held (at least three) plus continent bonuses; cards are awarded for a capture and traded in sets under either the fixed scale (4, 6, 8, 10) or the progressive ladder; eliminating a player seizes their hand, and an inheritance that lifts the hand to five or more cards sends the player straight back to the draft to trade. The research phase confirmed each numbered rule against the published rulebook and the studio's own help pages, and recorded the handful of places the replica deliberately departs — most visibly that the two-player neutral army is an option the host switches on rather than the default.[2]

Anyone who reaches the site is given a temporary, discoverable identity — a display name and a colour — with no account, password or e-mail. Chat is forty-two preset lines and eight emoji; there is no free text anywhere, which is also why the online lobby needs no moderation.

Modes and modifiers

Solo plays against one to five bots drawn from five difficulty tiers — Beginner, Easy, Medium, Hard and Expert — each bot a persona folded with its tier once at match start. Pass & Play seats two to six people on one device behind a full-screen hand-off that conceals the board between turns, so Fog of War works at a kitchen table. Online is a lobby browser showing who is present, a four-letter code to join, readiness, a turn timer that hands an absent seat to a bot, and a reclaim when the player returns.

The modifiers are independent and combine freely: Fog of War, Capitals (an extra defence die, and optionally the win condition), Blizzards (frozen territories that still pay their continent), Portals (stable or relocating every three rounds), Percentage Domination from 50 to 90 percent, Manual Placement, Max Rounds, Round Delay, Alliances, the choice of card scale, the choice of dice mode, and the two-player neutral army. Every game also carries a battle log that records who attacked whom, where, and what each side lost.

Dice

The digital edition's Balanced Blitz is not a dice roll but a reshaping of the true battle distribution in four stages, and the studio publishes only a few worked examples of it. The replica reverse-engineered the reshape from those examples and reproduces them to fifteen decimal places: thirty attackers against a capital held by fifteen, losing exactly twelve, has probability 0.0100282888709122 under Balanced Blitz against 0.02221280017072782 under True Random, and forty-nine is the fewest attackers for an eighty-percent Blitz against fifty. The same cumulative-distribution walk serves both the battle resolver and the win-chance figure shown before a battle, and the bots score their attacks from the odds table of the dice mode actually in play.[3]

Boards

No RISK board geometry is available under a licence that permits reuse, so every board is public domain or generated. Three — the classic forty-two-territory world, an extended world and Napoleonic Europe — come from a public-domain fan project's territory paths; nine regional boards (Europe, the United States, Asia, Africa, North and South America, Australia and New Zealand, the Middle East, and a simplified world) are dissolved out of Natural Earth data by a committed pipeline that derives adjacency from shared borders and budgets the vertices of every ring; and a seeded Voronoi generator makes a random board of any size. The classic graph was checked against nine independent sources, seven of which agree exactly.[2]

Architecture

The engine is one pure function, apply(state, map, action), and a build-failing layering test reads its source off disk to reject Math.random, the clock, and any import of React or the DOM. Randomness lives one layer out, in a resolver that takes an explicit seeded generator keyed on the sequence number of the action it is producing, and writes the outcome into the action. The action log is therefore the game: replaying it must reproduce the authority's state hash at every row, which is the first end-to-end test. A property test drives hundreds of games and asserts that the list of legal actions and the validator never disagree; it is what found the last two rule wedges.

The board is an SVG of one path per territory, painted by attribute diff rather than re-rendered, with HTML troop tokens inside the same transform so that one camera projection serves hit-testing, labels and the continent badges alike.

Online play

Online play is one Postgres table and a polling loop, sized to the free tiers it runs on. The server holds the same engine behind route handlers and appends to an append-only action log with contiguous sequence numbers; clients poll every two seconds on their turn and four seconds off it, slower when the tab is hidden, and receive a bodyless 204 when nothing changed. Bot turns, turn-timer takeovers and lobby expiry run lazily inside whichever poll arrives next, so nothing needs a scheduler. Fog games receive a masked snapshot and a redacted action list, and a client never rolls a die: an attack is submitted as an intent and resolved by the authority.[1]

Development

The replica was built from eight research lanes, seven build slices, six review rounds: research lanes gathered 304 evidence images from store listings, the studio's training videos and map tiles, verified the rules and the classic graph, and reverse-engineered the dice; seven developers then built the engine, odds and bots, maps, screens, session and online layers in parallel against contracts published first. Four review rounds returned seventy findings, every one fixed, and two rounds of hands-on play returned fourteen more — among them the discovery that the continent ring, a filled path drawn above the territories, was silently swallowing every tap on a completed continent. It carries 1,880 unit and property tests, 18 e2e runs.[4]

See also

References

  1. ^ Risk/README.md.
  2. ^ Risk/research/07-research-brief.md and Risk/DECISIONS.md.
  3. ^ Risk/SPEC.md, §4 (the odds contract) and the Balanced Blitz oracles.
  4. ^ Risk/DECISIONS.md, D106–D114.