From 01b83f9c9f4e2bdf15996ba506e5a2e771a1df56 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:48:43 -0500 Subject: [PATCH 1/3] docs(game): DESIGN.md v1 draft rules sections (council-designer-a) Co-Authored-By: Claude Opus 5.5 --- docs/game/DESIGN.md | 272 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 docs/game/DESIGN.md diff --git a/docs/game/DESIGN.md b/docs/game/DESIGN.md new file mode 100644 index 0000000..ea5b510 --- /dev/null +++ b/docs/game/DESIGN.md @@ -0,0 +1,272 @@ +# WikiDeck: Edit War — game design v1 (draft) + +**Status:** v1 DRAFT, freeze target 23:30 EST 2026-11-16. +**Owners:** council-designer-a owns sections 0–9 (research, card derivation, rules). council-designer-b +owns sections 10–12 (keywords, peer-hosted modes, worked example). council-critic reviews. +Every number in **`code font`** is a rules-config key (see §9). Modes can override any of them. + +A two-player lane game for 3–6 minute matches. Each player has a 12-card deck and there are 3 +**Topics** (lanes). There are 6 turns, both players play at the same time, and energy ramps from 1 to 6. +Win 2 of the 3 Topics. Each Topic is judged on one Wikipedia stat (**Attention**, **Depth** or +**Reach**), and a card is stronger in a Topic that matches its best stat. Fame (how high a card's +stats are overall) sets its **cost**, not its efficiency, so famous cards are sidegrades. They are +not upgrades. + +--- + +## 0. Research summary (what we took, what we left) + +| Game | Why it's fun | Taken | Left | +|---|---|---|---| +| Marvel Snap | 3-minute matches; simultaneous turns; 3 lanes, so the decision is *where*, not just *what*; lanes revealed over time | lanes, 6 turns, ramp 1→6, simultaneous reveal, staggered lane reveal, small deck | cube betting ("snap") is left to modes; it needs ranked stakes | +| Hearthstone | mana curve; readable cards; tempo | energy = turn number, curve-shaped costs | 30-card decks and 15-minute matches; hero powers | +| Magic: The Gathering | factions (colours) with distinct identities; deckbuilding depth | 6 factions with their own keyword flavour | land screw (resource variance); the stack; long text | +| Balatro | huge "moment" when a combo goes off; simple base rules plus modifiers | lane modifiers (Portals) as the run-to-run variety | single-player scoring | +| Slay the Spire | readable intents; every card is a choice | open information about lane state and power | roguelike runs (could be a mode) | +| Gwent | rows; best 2 of 3; passing and bluffing | best 2 of 3 Topics; hidden commitments | multi-round card advantage (too long) | +| Pokémon TCG | type advantage | on-topic bonus (card stat matches lane stat) | energy attachment; coin flips | +| Top Trumps | instantly understood: "my number beats yours" | lanes judged on one stat | picking the stat is solved play (always pick your best) | +| Dominion | deck building as play | — (too long for 3–6 min) | — | + +The core loop is a lanes game in the style of Snap. The Top Trumps twist is that each lane asks for +one Wikipedia stat. That makes every stat matter and gives each turn its main decision: play the card +on-topic for the bonus, or put it where the fight is. + +--- + +## 1. Card derivation (card data → game card) + +The engine never reads raw 0–100 stats as power. Every game card is derived **deterministically** from a +`CardInput` that the match host freezes at match start: + +``` +CardInput = { cardId, pageId, title, category, rarity, + snapshot: MintStatsSnapshot, // at mint, immutable + live: { trendPercent: number | null } } // frozen at match start +``` + +### 1.1 Percentiles (rank-normalisation) +For each stat `s` in {attention, depth, reach}, `pct_s` = the percentile (0–100, integer) of the card's +snapshot score in the reference table `percentiles.`. That table holds 99 ascending cut points from +council-data's `docs/game/card-sample.json`. +`pct_s` = the number of cut points strictly below the score, plus half the number equal to it, rounded +down. A `null` attention gives `pct_attention = null`. + +### 1.2 Fame → Cost +`fame` = the integer mean (rounded half up) of the non-null percentiles. +`cost` = 1 + the number of thresholds in `costThresholds` (5 ascending values, default +`[15, 35, 55, 75, 90]`) that are ≤ `fame`. So cost runs 1–6. +The defaults aim at a pool cost spread of about 15/20/20/20/15/10 %. They are retuned from the +sample's fame distribution. + +### 1.3 Power +`power` = `powerByCost[cost]`, default `[_, 1, 2, 4, 5, 7, 9]` (cost 1 → 1 … cost 6 → 9). +Power depends **only on cost**. Two cards of the same cost have the same base power, whatever their +fame. Inflating stats (forged snapshots, template shopping) only moves a card up the curve. It never +makes a card more efficient. + +### 1.4 Home stat +`home` = the stat with the highest `pct_s`. Ties are broken in this order: depth, reach, attention. +Depth and reach are the hardest to inflate. A `null` stat can never be home. +When a card is in a Topic whose stat equals its `home`, it gets **+`onTopicBonus`** power (default +**+2**). + +### 1.5 Faction +`faction` = the card's `category` (Space, Nature, People, Science, History, Culture), from +`server/wiki.ts`. Culture is about half the pool, so faction keywords are written so that a +mono-faction deck gains no consistency edge (see §10, and `factionSynergyCap` in §9). + +### 1.6 Trend (live, small, capped) +`trend` = +1 if `live.trendPercent ≥ trendUp` (default 25), −1 if `≤ trendDown` (default −25), +otherwise 0. A `null` value gives 0. The host computes it **once at match start**, and it is frozen for +the match. It shows as an arrow (▲/▼), not a number. It adds to power in every Topic. + +### 1.7 Rarity +The hash-derived `rarity` (`shared/protocol.ts:38`) is **cosmetic in v1** (frame colour). Mining luck +must not become power. + +### 1.8 Keyword +Each card has at most **one** keyword, chosen deterministically from faction, home stat and rarity by +the table in §10 (owned by designer B). + +### 1.9 Card face (phone) +The card face shows **cost** (top-left), **power** (big, centre), a **home-stat icon** +(📣 attention / 📚 depth / 🌐 reach), an optional trend arrow, and one keyword word. That is two +numbers, plus the live lane power when the card is on the board. + +### 1.10 Plausibility (anti-forgery, off-chain) +When `verifyStats` is true (the default for hosted matches), the match host checks each owned card's +snapshot before the match: +`pageBytes` against that revision's byte size, `languageCount` ≤ the live count + 5, and views for the +snapshot month within ±10 % of the pageviews API. +A card that fails is played **as if its snapshot were its live values**, and the match log marks it. +The engine itself does no I/O: it receives already-checked `CardInput`s. + +--- + +## 2. Decks + +- **Deck size:** exactly `deckSize` cards (default **12**). +- **Copies:** at most `maxCopiesPerPage` cards with the same `pageId` (default **2**). Each copy keeps + its own snapshot, so the two copies may differ in cost. +- **Owned cards:** any card the player's wallet owns at match start. Ownership is read off-chain. The + match never moves, locks or burns a card. +- **Loaner cards:** off-chain preview cards with a fixed `CardInput`, shipped with the game data + (`shared/game/loaners.json`). They are drawn from `shared/catalog.ts` and council-data's sample. + Loaners follow the same derivation, so they are no weaker or stronger than owned cards. +- **Starter decks:** `starterDecks` (default: 4 fixed 12-card loaner decks). Each one has two leading + factions and an average cost of 3.0–3.3. A new player picks one and can play at once. +- **Mixed decks:** an owned deck may fill any slots with loaners, up to `maxLoaners` (default 12, which + means no limit). Owning NFTs gives **variety**, not power: owned and loaner cards follow the same + curve. + +--- + +## 3. Board + +- 3 **Topics** (lanes), numbered 1–3 from left to right (top to bottom in portrait). +- Each Topic has a **stat** (attention, depth or reach) and an optional **Portal** modifier (§10.3). +- Each player has at most `laneCapacity` cards per Topic (default **4**). +- **Topic draw:** at match start, `topicCount` (3) Topics are drawn without replacement from + `topicPool`. The default pool has 9 Topics: each stat 3 times, one plain and two with Portals. + If `distinctStats` is true (the default), the draw is redone until the 3 Topics have 3 different + stats. In practice the engine draws one Topic per stat and then shuffles the lane order. +- **Staggered reveal:** Topic *i* is face-down until the start of turn *i* (`revealSchedule`, default + `[1, 2, 3]`). Cards can be played into a face-down Topic: that is the risky, on-topic gamble. + +--- + +## 4. Match setup (deterministic) + +1. The input is `{ seed: uint32, rules, players: [p0, p1] }`, and each player's input is + `{ id, deck: CardInput[12] }`. Seat order is input order. +2. RNG: **mulberry32(seed)**. Every random choice draws `next()` in this fixed order: + 1. shuffle p0's deck (Fisher–Yates, i from n−1 down to 1, j = floor(next() × (i+1))) + 2. shuffle p1's deck the same way + 3. draw and shuffle the Topics + 4. the initiative coin: p0 has initiative on turn 1 if next() < 0.5, otherwise p1 + 5. later random events (keywords only), in resolution order +3. Each player draws `openingHand` cards (default **3**). There are no mulligans in v1 + (`mulligan: false`). + +--- + +## 5. Turn structure + +The match lasts `turns` turns (default **6**, hard cap). Each turn has these phases: + +1. **Start** + - Reveal Topic *t* if it is scheduled (resolve its Portal "on reveal"). + - Each player gets `energy = t + bonusEnergy` (energy does not carry over). + - Each player draws 1 card if their deck isn't empty and their hand holds fewer than `handLimit` + (default **7**) cards. Otherwise they don't draw. +2. **Underdog check** (comeback; `underdog: true`, from turn 2). A player who leads in 0 Topics while + the opponent leads in ≥ 2 gets **+1 energy** this turn. +3. **Plan** (simultaneous, hidden) + - Each player queues an ordered list of plays `(handIndex, topic)`. + - Total cost must be ≤ their energy, and each Topic needs room on that player's side. + - Plays can be undone freely until **Commit**. Passing is an empty commit. + - The turn timer is `turnSeconds` (default **25**). On timeout, whatever is queued is committed. +4. **Reveal** + - The player with **initiative** reveals all their queued cards in queue order, then the other + player reveals theirs. + - Each card enters its Topic and its "on reveal" effect resolves at once. + - A queued play that is no longer legal at reveal (the lane is full or the card was removed) goes + back to hand and its energy is lost. +5. **End** + - Recompute all Topic powers (§6). + - End-of-turn effects resolve, the initiative player's first. + - Set initiative for the next turn: the player who leads in more Topics. If they lead in the same + number, the player who did *not* have initiative this turn. So reveal order alternates when the + game is even, and the leader reveals first (and gives away information) when it isn't. + +A typical turn is: look at the lanes, tap a card, tap a Topic (×1–3), tap Commit. That is under 10 +seconds, done with one thumb, with no dragging. + +--- + +## 6. Power and Topic control + +- A card's **lane power** = `power` + (`onTopicBonus` if its home stat is the Topic's stat) + `trend` + + keyword and Portal modifiers. It is never below 0. +- A player's **Topic power** = the sum of their cards' lane power in that Topic. +- A player **leads** a Topic if their Topic power is strictly greater than the opponent's. 0–0 and + other ties have no leader. +- Face-down Topics have no stat yet, so on-topic bonuses there count as 0 until the Topic is revealed. + +--- + +## 7. Win conditions and tie-breaks + +At the end of the last turn: +1. The player who leads **more Topics** wins (2–1, 2–0, 1–0 and 3–0 all count). +2. If they lead the same number of Topics: the higher **total power across all Topics** wins. +3. If that is also equal: the match is a **draw**. + +**Concede:** a player can concede at any time, and the opponent wins at once. A player who misses +`afkTurns` timeouts in a row (default **2**) with nothing queued concedes. + +--- + +## 8. Degenerate lines and why they fail (for the critic) + +| Line | Why it isn't dominant | +|---|---| +| All-famous (all max-stat) deck | It becomes an all-cost-5/6 deck: nothing to play on turns 1–4, so it gives up 2 Topics early. Power per energy is flat across the curve (`powerByCost` is tuned for this in sim). | +| All one faction | Faction synergies are capped (`factionSynergyCap`), and Culture is the largest pool but has the weakest synergy keywords (§10). | +| "Always play the highest-power card" | It ignores on-topic +2 (about 40% of a cheap card's power), lane capacity, and the face-down lanes. Target: < 55% against the sim's smart bot. | +| Stall or pass | Passing leaves lanes to any 1-power card. Two passing players draw. | +| Mirror the AI | Hidden simultaneous commits: you only see the opponent's cards after you commit. | +| Seat or initiative | Turns are simultaneous. Initiative alternates when the game is even and goes to the leader otherwise. Target: each seat wins 48–52%. | +| Forged or shopped stats | They only raise cost (§1.3), the host check falls back to live stats (§1.10), and trend is capped at ±1. | +| Inflated live pageviews | Worth at most +1, and frozen at match start. | +| Swinginess | No effect may change a lane by more than 6 power or move cards between lanes in v1 (a keyword-design rule for §10). | + +--- + +## 9. Rules config (all defaults) + +The engine takes a `RulesConfig` object. Peer-hosted modes override it (§11). Defaults: + +```json +{ + "version": "1.0", + "deckSize": 12, "maxCopiesPerPage": 2, "maxLoaners": 12, + "openingHand": 3, "handLimit": 7, "mulligan": false, + "turns": 6, "turnSeconds": 25, "afkTurns": 2, + "energyByTurn": [1, 2, 3, 4, 5, 6], "bonusEnergy": 0, "underdog": true, + "topicCount": 3, "distinctStats": true, "revealSchedule": [1, 2, 3], "laneCapacity": 4, + "topicPool": "default", + "costThresholds": [15, 35, 55, 75, 90], + "powerByCost": [0, 1, 2, 4, 5, 7, 9], + "onTopicBonus": 2, + "trendUp": 25, "trendDown": -25, + "factionSynergyCap": 3, + "verifyStats": true, + "percentiles": "card-sample-2026-11-16", + "starterDecks": "default" +} +``` + +(`energyByTurn[t-1]` replaces "energy = t" in §5 so that modes can change the ramp.) + +--- + +## 10. Keywords *(owner: council-designer-b)* + +*To be written by council-designer-b. Constraints from the rules above:* +- one keyword per card, one word, no more than one short line of reminder text +- triggers are limited to: on reveal, ongoing, end of turn +- keywords change power only (no stealing, moving cards between lanes or removing cards in v1) +- no single effect may swing a lane by more than 6 +- each faction gets a keyword pool; Culture's has the lowest synergy ceiling +- §10.3 Portals: the Topic modifiers in `topicPool` + +## 11. Peer-hosted modes *(owner: council-designer-b)* + +*To be written by council-designer-b. A mode is a named `RulesConfig` override, plus a Topic pool and +optional starter decks.* + +## 12. Worked example match *(owner: council-designer-b)* + +*To be written by council-designer-b.* From f808f963c6b4f1204aa78ab2956b83a2b4f26d19 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:49:12 -0500 Subject: [PATCH 2/3] docs(game): starter cards file, mode-variable fields Co-Authored-By: Claude Opus 5.5 --- docs/game/DESIGN.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/game/DESIGN.md b/docs/game/DESIGN.md index ea5b510..96ddf9d 100644 --- a/docs/game/DESIGN.md +++ b/docs/game/DESIGN.md @@ -112,7 +112,8 @@ The engine itself does no I/O: it receives already-checked `CardInput`s. - **Owned cards:** any card the player's wallet owns at match start. Ownership is read off-chain. The match never moves, locks or burns a card. - **Loaner cards:** off-chain preview cards with a fixed `CardInput`, shipped with the game data - (`shared/game/loaners.json`). They are drawn from `shared/catalog.ts` and council-data's sample. + (`docs/game/starter-cards.json`, picked by council-data: about 24 pageIds across all 6 categories, + with frozen, hand-checked snapshot stats, including the 4 cards in `shared/catalog.ts`). Loaners follow the same derivation, so they are no weaker or stronger than owned cards. - **Starter decks:** `starterDecks` (default: 4 fixed 12-card loaner decks). Each one has two leading factions and an average cost of 3.0–3.3. A new player picks one and can play at once. @@ -250,6 +251,12 @@ The engine takes a `RulesConfig` object. Peer-hosted modes override it (§11). D (`energyByTurn[t-1]` replaces "energy = t" in §5 so that modes can change the ramp.) +**What modes may vary:** every key above, plus `topicPool` contents and the starter-deck lists. +**Fixed for all modes:** matches are off-chain and never move or burn NFTs; the RNG and its draw order +(§4); the shape of the derivation (§1: percentile → fame → cost → power); at most one keyword per card; +the phases of a turn (§5). +A mode must keep `turns × turnSeconds ≤ 240` so that matches stay within 3–6 minutes. + --- ## 10. Keywords *(owner: council-designer-b)* From a9ab940f4b600a971434d4d3de53b6ad40550654 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:53:56 -0500 Subject: [PATCH 3/3] docs/game/DESIGN.md: keywords, portals, modes, worked example (council-designer-b) Fills sections 10-12 on top of designer-a's draft: 9 power-only keywords chosen by rarity/home stat/faction, 9-Topic default pool with 6 Portal kinds, mode schema with validation ranges and example modes, and a fully computed 6-turn worked example with a golden test (T1 17-11, T2 8-16, T3 18-20). Adds rules keys vanillaBonus, keywordsEnabled, ownedCards to section 9. Refs #1. Co-Authored-By: Claude Opus 5.5 --- docs/game/DESIGN.md | 188 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 177 insertions(+), 11 deletions(-) diff --git a/docs/game/DESIGN.md b/docs/game/DESIGN.md index 96ddf9d..d6eb699 100644 --- a/docs/game/DESIGN.md +++ b/docs/game/DESIGN.md @@ -240,7 +240,8 @@ The engine takes a `RulesConfig` object. Peer-hosted modes override it (§11). D "topicPool": "default", "costThresholds": [15, 35, 55, 75, 90], "powerByCost": [0, 1, 2, 4, 5, 7, 9], - "onTopicBonus": 2, + "onTopicBonus": 2, "vanillaBonus": 1, + "keywordsEnabled": ["Buzz","Anchor","Echo","Orbit","Grow","Rally","Research","Legacy","Remix"], "ownedCards": true, "trendUp": 25, "trendDown": -25, "factionSynergyCap": 3, "verifyStats": true, @@ -261,19 +262,184 @@ A mode must keep `turns × turnSeconds ≤ 240` so that matches stay within 3– ## 10. Keywords *(owner: council-designer-b)* -*To be written by council-designer-b. Constraints from the rules above:* -- one keyword per card, one word, no more than one short line of reminder text -- triggers are limited to: on reveal, ongoing, end of turn -- keywords change power only (no stealing, moving cards between lanes or removing cards in v1) -- no single effect may swing a lane by more than 6 -- each faction gets a keyword pool; Culture's has the lowest synergy ceiling -- §10.3 Portals: the Topic modifiers in `topicPool` +### 10.1 Which keyword a card gets +The keyword comes from the card's **rarity**, **home stat** and **faction**, using the first rule that matches: + +1. `cost == 1` → **no keyword**. Instead the card gets +`vanillaBonus` power (default **1**), so a cost-1 card has power 2. + Cheap cards stay simple, which helps new players. +2. `rarity == "Common"` → the **home-stat keyword** (Buzz, Anchor or Echo; table 10.2). +3. Otherwise (Rare, Epic or Legendary) → the **faction keyword** (table 10.2). + +This puts rarity to use, but only as *which* keyword a card has, never as how much power it has. Every keyword below is +worth about +1 to +3, which is the same as the trade-offs between home-stat keywords, so mining luck buys variety and not power. (This changes +§1.7 slightly. Designer-a, please note it there: "rarity chooses the keyword source, not power".) +Rough expected mix (with Common about 60%): about 15% vanilla, about 50% home-stat keywords, about 35% faction keywords. + +Keywords are **one word** on the card face, plus one line of reminder text in the tap-to-inspect sheet. +They only ever *add* power (v1 has no removal, stealing, moving or lowering power). "Here" means this card's Topic, and +"your" means the owner's side. An effect stops at its cap, so no keyword moves a lane by more than 3 (§8 requires 6 or less). + +### 10.2 Keyword list + +| Keyword | Source | Trigger | Reminder text | Cap | +|---|---|---|---|---| +| **Buzz** | home: attention | On reveal | +1 power to each of your *other* cards here. | +3 (lane cap 4) | +| **Anchor** | home: depth | Ongoing | +2 power while it is your only card here. | +2 | +| **Echo** | home: reach | On reveal | +1 power to your most recently played card in each *other* Topic. | +2 (2 cards) | +| **Orbit** | faction: Space | Ongoing | +1 to your Topic power in each *adjacent* Topic. | +1 per adjacent Topic | +| **Grow** | faction: Nature | End of turn | +1 power. | +3 total | +| **Rally** | faction: People | On reveal | +1 power to each of your *other People* cards, in any Topic. | `factionSynergyCap` (3) | +| **Research** | faction: Science | On reveal | +1 power for each Topic you lead right now. | +3 | +| **Legacy** | faction: History | Ongoing | +2 power on the last turn. | +2 | +| **Remix** | faction: Culture | On reveal | +2 power if you are losing here. | +2 | + +Precise rules (for engine-b): +- **On reveal** resolves when this card enters its Topic during Reveal (§5.4). It sees every card already revealed, + including cards the initiative player revealed earlier in the same turn. Bonuses it grants are permanent power counters on the target cards. +- **Ongoing** is recalculated every time Topic power is read. It's a condition, not a counter. +- **End of turn** resolves in §5.5 order: the initiative player's cards first, then Topic 1→3, then play order. +- **Buzz** targets only cards already here when it reveals. Cards that arrive later don't get the bonus. +- **Anchor** counts only its owner's cards here. Opposing cards don't matter. +- **Echo:** "most recently played" means the highest play sequence number among your cards in that Topic. Topics where you have no card are skipped. +- **Orbit** adds to Topic power, not to a card. It works even if you have no cards in the adjacent Topic (so Topic power can go 0 → 1). + Topic 2 is adjacent to 1 and 3. Topics 1 and 3 are adjacent only to 2. +- **Grow** stops after it has gained +3 in total. +- **Rally** counts cards by faction. Wildcard-style faction changes don't exist in v1. It gives at most `factionSynergyCap` counters in total, + going to the targets in play order. +- **Research** counts Topics where you lead (strictly greater Topic power) at the moment it resolves, including this + Topic after its own base and on-topic power is added. *(Clarification: the card's own power counts toward leading here.)* +- **Legacy** applies when `turn == turns` (the last turn), from the start of that turn. +- **Remix:** "losing here" means the opponent's Topic power here is strictly greater than yours, counted just *before* this card + is added. +- **Culture is about half the pool,** so its faction keyword (Remix) is the one with no faction synergy. A Culture-heavy deck + gets no consistency bonus from being mono-faction. Only People (Rally) has faction synergy, and it's capped. + +Examples: +- *Buzz:* you have Haiku (2) and Jazz (4) in Topic 2, then play Pop music (Buzz, power 5). Haiku becomes 3, Jazz 5, and Pop music stays 5. +- *Anchor:* Coral reef (power 2) alone in Topic 1 is 4. Once you add another card there, it's 2 again. +- *Echo:* Moon is revealed in Topic 3. Your last card in Topic 1 gets +1. You have nothing in Topic 2, so that part is skipped. +- *Orbit:* Jupiter is in Topic 3, so your Topic 2 power is +1 even though no card there changed. +- *Rally:* Albert Einstein is revealed with no other People cards in play, so nothing happens. With Marie Curie and Ada Lovelace in play, each gets +1. +- *Research:* you lead Topics 1 and 3 when Periodic table is revealed into Topic 1, so it gets +2. +- *Legacy:* Ancient Rome (power 7) shows 7 on turns 5 and 9 on turn 6. +- *Remix:* the opponent has 6 here and you have 3, so Jazz (power 2) is revealed as 4. + +### 10.3 Portals (Topic modifiers) and the default Topic pool +Each Topic has `{ id, name, stat, portal | null }`. The default `topicPool` has 9 Topics, one plain and two with +Portals for each stat. A Portal applies from the moment its Topic is revealed (§3), except where it says otherwise. + +| Topic | Stat | Portal rule | +|---|---|---| +| Current Events | attention | – | +| Main Page | attention | On the last turn, each card here gets +1 power. | +| Trending | attention | Trend arrows (§1.6) count double here (±2). | +| Archive | depth | – | +| Featured Article | depth | At end of the match, the player with the single highest-power card here gets +2 Topic power here (no bonus if tied). | +| Stub | depth | Lane capacity here is 2 per player. | +| Translations | reach | – | +| Interwiki | reach | +1 Topic power here for a player who has at least one card in all 3 Topics. | +| Disambiguation | reach | Every card here counts as on-topic, whatever its home stat. | + +As data: `portal = { kind: "lastTurnCardBonus", amount: 1 } | { kind: "trendMultiplier", factor: 2 } | +{ kind: "highestCardBonus", amount: 2 } | { kind: "laneCapacity", value: 2 } | { kind: "spreadBonus", amount: 1 } | +{ kind: "allOnTopic" }`. Modes may add Topics with these kinds, using new numbers, but not new kinds (engine code). + +--- ## 11. Peer-hosted modes *(owner: council-designer-b)* -*To be written by council-designer-b. A mode is a named `RulesConfig` override, plus a Topic pool and -optional starter decks.* +A **mode** is data, published by a node operator and run by the match host: +```json +{ + "id": "blitz", // [a-z0-9-]{3,32}, unique per host + "name": "Blitz", "description": "Four quick turns.", // ≤ 40 and ≤ 280 chars, plain text + "rules": { "turns": 4, "energyByTurn": [2, 3, 4, 5], "revealSchedule": [1, 1, 2], "deckSize": 10 }, + "topicPool": [ /* optional: Topic objects (10.3); default if omitted */ ], + "starterDecks": [ /* optional: lists of loaner pageIds */ ] +} +``` +- `rules` is a **partial** `RulesConfig` (§9) merged over the defaults. Unknown keys are rejected. +- **Validation** (modes owns the code; these are the limits). If any check fails, the mode is refused: + +| Key | Allowed | +|---|---| +| `turns` | 3–8, and `turns × turnSeconds ≤ 240` | +| `energyByTurn` | length = `turns`, each 0–10 | +| `bonusEnergy` | 0–3 | +| `revealSchedule` | length = `topicCount`, each 1..`turns`, non-decreasing | +| `topicCount` | 1–5; `distinctStats` only if ≤ 3 | +| `laneCapacity` | 1–6 | +| `deckSize` | 6–20; `maxCopiesPerPage` 1–4; `maxLoaners` 0..`deckSize` | +| `openingHand` | 0–6; `handLimit` 1–10 | +| `turnSeconds` | 10–60; `afkTurns` 1–5 | +| `costThresholds` | 5 strictly ascending integers in 0–100 | +| `powerByCost` | 7 integers in 0–20, non-decreasing from index 1 | +| `onTopicBonus`, `vanillaBonus` | 0–5 | +| `trendUp` / `trendDown` | 0–200 / −200–0 | +| `factionSynergyCap` | 0–6 | +| `keywordsEnabled` (new, default: all 9) | any subset of the 9 v1 keywords; a disabled keyword makes those cards vanilla, *without* `vanillaBonus` | +| `verifyStats` | the host may only turn this off for modes that use only loaners (`maxLoaners == deckSize` and owned cards banned) | +| `topicPool` | 3–20 Topics, Portal kinds only from 10.3 | + +- **Identity:** `modeHash` = SHA-256 of the canonical JSON (sorted keys, no whitespace) of the *merged* rules + plus the topicPool. A match record holds `{ modeHash, seed, both decks' CardInputs, both players' commit lists }`, + and that is enough to replay it exactly. +- **What modes can't change** is the "Fixed for all modes" list in §9. Modes also can't add keywords or Portal kinds, or + stake, move or burn NFTs. + +Example modes (good defaults for operators to publish): +| Mode | Overrides | Feel | +|---|---|---| +| **Blitz** | `turns 4`, `energyByTurn [2,3,4,5]`, `revealSchedule [1,1,2]`, `deckSize 10`, `turnSeconds 20` | about 2 minutes | +| **Deep Cuts** | `topicPool`: only the 3 depth Topics, `distinctStats false` | rewards long, obscure articles | +| **Loaner League** | `maxLoaners 12` and owned cards banned (`"ownedCards": false`, a new boolean key, default true) | fully level, for tournaments | +| **Big Board** | `topicCount 5`, `distinctStats false`, `revealSchedule [1,2,3,4,5]`, `laneCapacity 3` | win 3 of 5 | +| **No Keywords** | `keywordsEnabled []`, `onTopicBonus 3` | Top Trumps–style tutorial mode | + +--- ## 12. Worked example match *(owner: council-designer-b)* -*To be written by council-designer-b.* +Default rules. The derived cards are given directly (§1 output). "base" = `powerByCost[cost]`, with +1 for cost-1 vanilla cards. +Topics after the seeded draw: **T1 Archive (depth)**, **T2 Main Page (attention)**, **T3 Translations (reach)**. +Ana (p0) has initiative on turn 1. Neither player has a trend arrow. + +Cards played: +| Player | Card | Faction / rarity | Cost | Base | Home | Keyword | +|---|---|---|---|---|---|---| +| Ana | Octopus | Nature / Common | 1 | 2 | depth | – (vanilla) | +| Ana | Moon | Space / Common | 2 | 2 | reach | Echo | +| Ana | Periodic table | Science / Rare | 3 | 4 | depth | Research | +| Ana | Albert Einstein | People / Epic | 4 | 5 | attention | Rally | +| Ana | Ancient Rome | History / Rare | 5 | 7 | depth | Legacy | +| Ana | Library of Alexandria | History / Common | 4 | 5 | depth | Anchor | +| Ana | Coral reef | Nature / Common | 2 | 2 | depth | Anchor | +| Bo | Haiku | Culture / Common | 1 | 2 | attention | – (vanilla) | +| Bo | Jazz | Culture / Rare | 2 | 2 | attention | Remix | +| Bo | Fern | Nature / Rare | 3 | 4 | depth | Grow | +| Bo | Pop music | Culture / Common | 4 | 5 | attention | Buzz | +| Bo | Jupiter | Space / Epic | 5 | 7 | reach | Orbit | +| Bo | Saturn | Space / Legendary | 6 | 9 | reach | Orbit | + +Topic power is written as **Ana–Bo**. "Lead" is the number of Topics each player leads after the turn. + +| Turn | Revealed | Ana plays (reveals first when she has initiative) | Bo plays | T1 | T2 | T3 | Lead | Initiative next | +|---|---|---|---|---|---|---|---|---| +| 1 | T1 Archive | Octopus → T1: 2, +2 on-topic = **4** | Haiku → T1: **2** (attention ≠ depth) | 4–2 | 0–0 | 0–0 | 1–0 | Ana (leads more) | +| 2 | T2 Main Page | Moon → T3 (face-down, no bonus yet): 2. Echo: Octopus +1 → 5 | Jazz → T2: 2+2 = 4. Remix: Ana has 0 here, so not losing, no bonus | 5–2 | 0–4 | 2–0 | 2–1 | Ana | +| 3 | T3 Translations: Moon is now on-topic, 4 | Periodic table → T1: 4+2 = 6. Research: Ana leads T1 (11–2) and T3 (4–0) → +2 = **8** | Fern → T1: 4+2 = 6. End of turn, Grow: 7 | 13–9 | 0–4 | 4–0 | 2–1 | Ana | +| 4 | – | Einstein → T2: 5+2 = 7. Rally: no other People cards, so nothing | Pop music → T2: 5+2 = 7. Buzz: Jazz +1 → 5. Grow: Fern 8 | 13–10 | 7–12 | 4–0 | 2–1 | Ana | +| 5 | – | Ancient Rome → T3: 7 (depth ≠ reach) | Jupiter → T3: 7+2 = 9. Orbit: Bo's T2 +1 → 13. Grow: Fern 9 (the +3 cap is reached) | 13–11 | 7–13 | 11–9 | 2–1 | Ana | +| 6 (last) | Main Page: +1 per card. Legacy: Rome 9 | Library of Alexandria → T3: 5. Anchor: not the only card, so no bonus. Coral reef → T1: 2+2 = 4 (Anchor: no) | Saturn → T3: 9+2 = 11. Orbit: Bo's T2 +1 | **17–11** | **8–16** | **18–20** | 1–2 | – | + +The turn-6 numbers: +- **T1:** Ana has Octopus 5 + Periodic table 8 + Coral reef 4 = 17. Bo has Haiku 2 + Fern 9 = 11. +- **T2:** Ana has Einstein 7 + 1 (Main Page) = 8. Bo has Jazz 5+1 and Pop music 7+1, plus Orbit ×2, = 16. +- **T3:** Ana has Moon 4 + Rome 9 + Library 5 = 18. Bo has Jupiter 9 + Saturn 11 = 20. + +**Bo wins 2–1.** Bo trailed 1–2 from turn 2 to turn 5. Ana guessed Bo would contest T3 and spent 4 of her 6 energy there. Saturn on-topic (11) still beat her by 2, and its Orbit also tipped T2. The underdog check never fired, because Bo always led one Topic. +Energy check: Ana spent 1/2/3/4/5/6 and Bo spent 1/2/3/4/5/6. + +**Golden test for engine-b:** with these card inputs, this Topic order and these commit lists, the final Topic powers must be +`T1 17–11, T2 8–16, T3 18–20`, and the result must be a Bo win (2 Topics to 1). Only the seed's Topic draw and the decks' order +vary. The test should inject the Topic order and the hands directly.