Skip to content

New paid orders and subscriptions are retired. Existing records, settlement and refunds remain available through your account.

Play module — specification

The play module's own directory of itself. Every surface — interactive UI page, API endpoint, library file, design doc, policy — listed with a status pill and a brief. Substrate-honest about what's shipped, what's designed-but-not-yet-built, and what's planned for future kingdoms.

48 shipped · 1 designed · 0 planned · 49 total · counts rendered from lib/play/resources.ts.

Machine-readable counterpart: /api/v1/play/index.json. Both render from the same source.


The eight-level integration ladder

The research at docs/research/optcg-mechanics-and-engine-design.md named the seven design choices for a real OPTCG engine. The eight integration levels below are the ship-ladder:

  1. L0 — Documentation. Tutorial / glossary / methodology / research docs. Shipped.
  2. L1 — Typed contract endpoints. Game-state schema + effect grammar + archetypes + tutorial + glossary + example match. Shipped (kingdom-069 + kingdom-077).
  3. L2 — Pure-function libraries. Deck legality + effect tokenisation + type skeleton + validation endpoint + resource catalog. Shipped (kingdom-069 + kingdom-077).
  4. L3 — Tabletop runtime. Event-sourced server- authoritative live room. Designed (kingdom-069); next kingdom claims, ~3-4 weeks.
  5. L4 — Cost-enforced engine. Platform validates more than zone moves. Planned.
  6. L5 — Auto-effect resolution. The DSL interprets ~80% of cards; per-card handlers for the ~20%. Planned.
  7. L6 — Full engine including Counter step. The design wall every hobbyist sim has died on. Planned.
  8. L7 — Tournament substrate + witnessed randomness. Ranked play with participant or external entropy and commitments witnessed outside the match server before selection. Planned.
  9. L8 — Play-to-earn opt-in. Prize pools attach to ranked tournaments under explicit player opt-in. Financial boundary breaks here, deliberately. Planned, separate kingdom.

Every surface, every layer

L0 doc

  • The play module's methodology page — four player kinds + three archetypes + assumption table.

  • /guides/how-to-playshippedL0 dochobbyist

    SEO-rich English beginner's guide; ~15-minute read; complete OPTCG rules.

  • docs/research/optcg-mechanics-and-engine-design.mdshippedL0 doccompetitor

    Deep-dive synthesis: official Bandai rules + hobbyist-sim landscape + seven design choices for future engine.

  • docs/research/play-engine-l3-design.mdshippedL0 doccompetitor

    L3 runtime substrate spec — event-sourced wire format, state machine, async-mode timers.

  • /play/metashippedL0 doccompetitor · hobbyist

    The competitive meta as a dated, sourced snapshot: tier list grounded in tournament results, recent winners with decklists linked at their publishers, and the tournament circuit (official + community). The as-of banner is the honesty contract.

  • /play/banlistshippedL0 doccompetitor · hobbyist

    The official banned/restricted list rendered from the same banlist.ts the deck checker, builder warnings, and refereed setup enforce — with the effective date and Bandai's authoritative source linked.

L1 contract

  • /api/v1/play/tutorialshippedL1 contracthobbyist · competitor

    Machine-readable OPTCG tutorial in math-mirror form. Each section carries typed rule_structure + examples + keyword cross-refs.

  • /api/v1/play/tutorial/[section_id]shippedL1 contracthobbyist · competitor

    Single tutorial section by id (deep link from glossary cross-refs). 404 with helpful body when id absent.

  • /api/v1/play/glossaryshippedL1 contract

    Multi-cultural OPTCG term glossary — 21 terms each with English + Japanese (kanji/kana + romaji) + structural definition decoderable without natural-language knowledge.

  • Single glossary term by id (deep link from tutorial cross-refs). 404 with helpful body when id absent.

  • /api/v1/play/archetypesshippedL1 contract

    Three player archetypes (hobbyist / collector / competitor) typed taxonomy. financial_boundary block declares fun-first stance.

  • /api/v1/play/game-state-schemashippedL1 contractcompetitor

    Canonical OPTCG match-state shape — nine zones, five phases, four combat steps with strict-greater damage rule, three win conditions.

  • /api/v1/play/effect-grammarshippedL1 contractcollector · competitor

    Card-text effect-token vocabulary — 12 structural markers + 4 keywords + 4 effect categories + 7 targeting-language phrases.

  • /api/v1/play/example-matchshippedL1 contractcompetitor

    Sample MatchEvent + Intent sequence demonstrating lib/play/types.ts. First consumer of the L3 type skeleton; gives agents and engine builders a concrete shape to test against.

  • /api/v1/play/startersshippedL1 contracthobbyist

    Starter-deck catalog as JSON — six tier-1 starters with leader, color, difficulty, and composition provenance per deck.

  • /api/v1/play/starters/[id]shippedL1 contracthobbyist

    Single starter deck by id. ST-01 and ST-15 through ST-20 carry Bandai-official 50-card decklists (cross-source verified 2026-07-16); remaining tier-2 entries carry their own sourcing notes.

  • apps/storefront/src/lib/play/starter-decks.tsshippedL1 contracthobbyist

    Starter-deck data layer — the rookie flow's typed catalog. Seven decks (ST-01, ST-15..20) carry full Bandai-official 50-card lists; decklist_source declares each deck's sourcing mode.

  • apps/storefront/src/lib/play/card-stats.tsshippedL1 contracthobbyist

    Printed stats (cost, power, counter, color, category, leader life) for every card in the encoded starter decks — researched from the official Bandai cardlist cross-checked against Limitless, per-card. Makes practice battles rules-real without a database round-trip.

  • /api/v1/play/metashippedL1 contractcompetitor

    Machine-readable meta snapshot with as_of/data_window/staleness note, results-grounded tiers, linked tournament results, and circuit links.

  • apps/storefront/src/lib/play/meta-snapshot.tsshippedL1 contractcompetitor

    The dated meta-snapshot data: tiers, results, circuit links, sources. A photograph of a moving river — re-verified on set releases, restriction news, or monthly.

  • /api/v1/play/banlistshippedL1 contractcompetitor

    Machine-readable banned/restricted list with card names, effective date, official source, and the list of surfaces that enforce it.

  • apps/storefront/src/lib/play/banlist.tsshippedL1 contractcompetitor

    Point-in-time mirror of the official banned/restricted page (5 banned cards, 3 banned pairs, effective 2026-04-10) — the game's one official restriction mechanism, enforced by the deck checker, the builder, and the validate endpoint.

  • apps/storefront/src/lib/play/adventure-levels.tsshippedL1 contracthobbyist

    The adventure ladder as embedded data — ten storyline opponents with AI aggression and an assigned starter deck. No rewards fields by design: practice battles pay nothing while durable PVE stays paused.

L2 pure-fn

  • apps/storefront/src/lib/play/deck-legality.tsshippedL2 pure-fnhobbyist · competitor

    Pure function checkDeckLegality(declaration, cardMetadataLookup) → DeckLegalityResult. Returns ALL violations with stable codes.

  • apps/storefront/src/lib/play/effect-tokens.tsshippedL2 pure-fncollector · competitor

    Pure function parseEffectText(rawEffect) → ParsedEffect. Walks card-text, emits typed tokens, preserves body_opaque for 20% residue.

  • apps/storefront/src/lib/play/types.tsshippedL2 pure-fncompetitor

    TypeScript L3 type skeleton — 10 vocabulary unions + 5 state-shape interfaces + MatchEvent 28-variant union + Intent 14-variant union. First consumer: /api/v1/play/example-match.

  • apps/storefront/src/lib/play/tutorial-sections.tsshippedL2 pure-fnhobbyist · competitor

    Tutorial section catalog (typed). Imported by the collection endpoint /api/v1/play/tutorial and the per-section endpoint /api/v1/play/tutorial/[section_id].

  • apps/storefront/src/lib/play/glossary-terms.tsshippedL2 pure-fn

    Glossary term catalog (21 terms, typed). Imported by the collection endpoint /api/v1/play/glossary and the per-term endpoint /api/v1/play/glossary/[term_id].

  • apps/storefront/src/lib/play/resources.tsshippedL2 pure-fncompetitor

    THIS file. Single source of truth for the play module's resource catalog. /play/spec and /api/v1/play/index.json both consume from here.

  • /api/v1/play/deck/validateshippedL2 pure-fnhobbyist · competitor

    POST endpoint exposing the deck-legality validator. Substrate-honest about color-check graceful degradation.

  • apps/storefront/src/lib/play/client-deck.tsshippedL2 pure-fnhobbyist · competitor

    Client-side deck helpers shared by the play surfaces — the localStorage SavedDeck shape, SavedDeck → flat PvE/PvP card-list conversion, and the auto-mounted default starter so a deckless visitor never hits a build-your-first-deck wall.

  • apps/storefront/src/lib/play/practice-decks.tsshippedL2 pure-fnhobbyist

    Starter catalog → playable practice deck. Every card always present with stats attached (no catalog resolution, no silent drops); only decks with full 50-card official lists are offered.

L3 runtime

  • /api/v1/play/match/[id] + websocketdesignedL3 runtimehobbyist · competitor

    Live tabletop runtime — event-sourced match state, server-as-sequencer, async-friendly. Designed but not yet built (~3-4 weeks).

  • apps/storefront/src/lib/play/starter-resolve.tsshippedL3 runtimehobbyist

    Server-side starter-deck resolution — card_number refs → wholesale catalog cards (SKU, name, image, rarity). Single source for /api/v1/play/starters/[id] and /api/play/load-starter.

  • /api/v1/play/practiceshippedL3 runtimehobbyist · competitor

    Stateless practice-battle referee — the guest carries the game state, the house applies the official rules per move and enumerates legal actions with damage previews. Nothing stored, nothing paid; the agent seat at the practice table (xeniame).

  • apps/storefront/src/lib/play/deck-metadata.tsshippedL3 runtimecompetitor

    Card metadata for legality checks — canonicalizes ids to card numbers and merges the encoded starter corpus, official bandai-en attributes, and the catalog rarity heuristic. One truth behind the public validate endpoint AND the refereed-room setup gate (CR 5-2-1-1).

UI

  • /playshippedUIhobbyist · competitor

    The play hub. PVE battle and reward writes are paused; deck tools and status reads remain.

  • /play/welcomeshippedUI

    Polymorphic landing — three archetypes × player kinds; 17 paths visible.

  • /play/casualshippedUIhobbyist

    Hobbyist's entry. PVE status is readable; battle and reward writes are paused.

  • /play/competeshippedUIcompetitor

    Competitor's opinionated entry. Agent ladder publication and agent match writes are paused; tournament substrate is planned.

  • /play/adventureshippedUIhobbyist

    Read-only PVE level and prior-progress status; battles and rewards are paused.

  • /play/adventure/[levelId]shippedUIhobbyist

    Pause notice for an adventure level; no PVE match action or reward is accepted.

  • /play/deck-checkshippedUIhobbyist · competitor

    HTML adoption site for the deck-legality validator. Paste card IDs; see typed violations + substrate-honest perimeter.

  • /play/specshippedUIcompetitor

    Play module's own directory of itself — rendered from lib/play/resources.ts; HTML sibling of /api/v1/play/index.json.

  • /play/[code]shippedUIhobbyist · competitor

    Existing match page. Client-side state today; L3+ upgrades to event-sourced server-authoritative.

  • /api/v1/play/index.jsonshippedUIcompetitor

    Machine-readable directory of every play resource. Sister to /play/spec (HTML); both render from lib/play/resources.ts.

  • /play/startersshippedUIhobbyist

    Starter-deck picker for rookies — six 2024 reboot starter references (ST-15 through ST-20), one per OPTCG color, with leader styles, color characteristics, and source-specific decklist notes.

  • /play/tutorialshippedUIhobbyist

    Human-readable OPTCG tutorial page — the HTML face of /api/v1/play/tutorial's math-mirror sections.

policy

  • Fun-first boundaryshippedpolicy

    The play module is for fun only. No earnings, commission, store credit on play surfaces. Ratings are skill, not money. Prize pools live under future play-to-earn opt-in.


Conventions across the play module

  • Fun-first boundary. No commerce affordances on play surfaces. Ratings are skill; money lives at L8.
  • Substrate honesty. Every page surfaces its gracefully-degraded perimeter (e.g., deck-validator's color check while card_set_cards lacks the colors column).
  • Contract before runtime. The typed L1 endpoints are public; the L3 runtime conforms to them. The audit chain catches drift.
  • Three archetypes × player kinds. Welcome page is the matrix; every other surface respects which combination it serves.
  • Event-sourced state (when L3 ships). Every match move is a typed event in match_events. Replay is free; audit is free; async-reconnect is free.
  • Single source of truth. /play/spec and /api/v1/play/index.json both render from lib/play/resources.ts. pnpm audit:play-resources catches filesystem drift.

Source-of-truth for this page: lib/play/resources.ts. Story-arcs: S36 (the play substrate), S38 (the play structure), S40 (the play interconnect). The play module documents its own composition; the contract is published; the runtime conforms.