CYBERPUNK TCG sim lab

Guide

This is a simulator for the Cyberpunk Trading Card Game. It plays the game by the official comprehensive rules, lets you play against an AI with the real cards, and — its main purpose — lets AIs build decks and play each other thousands of times so you can find out which decks are actually good.

The tabs

TabWhat it is forYou can…
PLAYA game between you and the AI.Pick decks, play a full game with click-to-act and a button for every legal move, undo, concede, export the replay.
WATCHReplay any recorded game.Step through a game decision by decision with both hands visible; auto-play; see every legal option and the one taken.
LABAI-vs-AI measurement.Run tournaments between decks, run leagues where AI builders evolve decks, generate and screen batches of decks, open the reports.
BUILDDeck construction.Build a deck by hand with live legality and RAM, or let the AI build one toward a learned archetype; save, load, export.
CARDSThe card pool.Search and read every card at full size; find the starter-set cards.

How a game works (the short version)

Each player brings 3 Legends and a deck of 40–50 cards, and starts with 6 dice (d4, d6, d8, d10, d12, d20) in their fixer area. Every die that has been rolled into your Gig area is a Gig; its face value is worth that much Street Cred. You win the moment you begin a turn with 7 or more Gigs — and since you only own 6, you must steal at least one from the Rival. You also win if the Rival must draw from an empty deck.

  1. Start of turn: win check; ready everything (Units, Legends, Eddies); draw 1; take a die from your fixer, roll it, and put it in your Gig area (the d20 only when it is the last die left).
  2. Main phase, in any order: play cards from hand by paying their cost in €$ (each ready Eddie or Legend is 1 €$); sell one card per turn — it goes face-down into your Eddies area and pays for things from now on; Call a Legend once per turn for 1 €$ to flip one face-up and use its text; GO SOLO a Legend that allows it, paying its cost to put it on the field as a Unit; use abilities; attack with ready Units that did not enter this turn.
  3. Attacking: choose the attacker and a target — a spent rival Unit (a fight: higher power wins, the loser is defeated, ties defeat both) or the rival's Gig area. The attacker is spent. The defender may react: BLOCKER Units redirect the attack to themselves, QUICK cards can be played, a Legend can be Called. If the Gig attack goes through, you steal one die, plus one more for every 10 power (power 10 steals 2). Stolen dice keep their values.
  4. End of turn: "this turn" effects end and all Units lose Lag. Once both players have run out of fixer dice, Overtime begins: from then on 7 Gigs at any moment wins instantly.

The sim follows the comprehensive rules precisely, including the fine points (a spent Legend may GO SOLO and arrives spent; a Legend that leaves play is removed from the game; a 0-power Unit cannot defeat anything). Every judgement call is written down in docs/rulings.md with the rule it comes from.

Reading the board

Reading a report

A report is what a tournament or a league generation leaves behind. It opens with the run's facts, then says in plain sentences who won and how much to trust it, and every number after that is explained where it appears; the glossary at the end of each report has the full definitions.

Archetypes: kinds of deck learned from play

Nobody here wrote down what an "aggro" or a "control" deck is. Instead, every deck that finishes a tournament or league is recorded with its shape numbers — average cost, the mix of Units, Programs and Gear, and how many blockers, removal effects, Gig-manipulation cards, haste, economy, extra-steal and draw effects it runs — and the lab groups the recorded decks by those numbers (a standard clustering, re-run after every job). Each group is an archetype: it gets a name generated from the two numbers that set it apart from the other groups (for example Low-curve swarm or Removal wall), a one-line description, and the pooled win rate of its decks, so you can see for yourself whether the group is real and whether it wins. The grouping is deliberately cautious: a group needs at least three decks, one-card variants of a list count as one deck, and groups are only kept when they separate more cleanly than random decks would — otherwise there is one group so far. Every archetype says how well it stands apart (clearly separated, loosely grouped or provisional), and a group whose distinctive numbers change is renamed with its old name kept as an alias. Reports label a deck that was not built toward an archetype with the group its list sits closest to (nearest: …).

Decks and files

Running it yourself

The easiest way is the hosted site: renatom11.github.io/cyberpunk-tcg. It is the same client with the rules engine running inside your browser (Python via WebAssembly), so it plays for real on any device — nothing to install. Decks you save, reports you produce and the archetypes the lab learns stay in that browser. Lab jobs run one engine per processor core of your device, which is still far slower than a computer, so keep tournaments small there (a few hundred games); for big leagues run it locally:

  1. Install Python 3.11 or newer, then in a terminal: git clone https://github.com/renatom11/cyberpunk-tcg, cd cyberpunk-tcg, pip install -e .
  2. Start it with python -m cptcg serve and open http://127.0.0.1:8000/ in a browser. Every tab is live: games are played against the engine, decks save to disk, and lab jobs run on your cores.
  3. On a phone: start it with python -m cptcg serve --host 0.0.0.0 and open http://<your computer's IP>:8000/ on the phone while both are on the same Wi-Fi. The board uses the stacked phone layout automatically.

Tips

New game

What PLAY does, and how to use it

Play a full game against the AI, with you making every decision for one seat. The engine enforces the rules; you only ever choose among legal actions.

  1. Pick your deck and the AI's deck. The list holds the sample decks, anything you saved in BUILD, and decks generated in LAB. Only legal decks (3 Legends, 40–50 cards, RAM limits) are listed.
  2. Choose the AI. heuristic looks one move ahead and plays sensibly; random plays legal moves at random (useful to learn the interface).
  3. Seat and seed. Seat 0/1 only changes which side of the log you are. A seed makes the shuffles and dice repeatable: the same seed replays the same game if you make the same choices. Leave it blank for a random game.
  4. Press START. The board opens. A d20 roll-off decides who chooses to go first; the first player's two left-most Legends start spent.

On the board, your half is at the bottom. When it is your decision, the PROMPT panel (bottom right, or bottom on a phone) says what is being asked and shows one button for every legal action. Cards that can act glow: click a glowing card to play, sell, attack with, Call or GO SOLO it; when a card has more than one option a small menu appears. Dice in your fixer tray glow when you must take one. Anything you can click is also always in the prompt list, so the buttons are never wrong.

Read a card by hovering it (on a phone: tap a card that has nothing to do, or long-press any card). The LOG narrates everything both players do. UNDO takes back your last decision (the AI's replies are recomputed), CONCEDE ends the game, EXPORT downloads the replay so you can watch it again in WATCH or share it, and NEW GAME returns to this form.

Cards render as images when data/images/<id>.jpg exists, otherwise as text cards.

Watch a replay

What WATCH does, and how to use it

Replay any recorded game, one decision at a time, with both hands visible. Every game the engine plays can be recorded as a tiny replay file: the decks, the seed and the list of choices. Replaying re-runs the engine, so what you see is exactly what happened.

  1. Where replays come from. Games you EXPORT from PLAY; batch simulations run with cptcg sim --replays DIR; anything under out/ ending in .json inside a replays folder.
  2. Pick a file and press LOAD. The board shows the game at its first decision.
  3. Step with ◀ ▶, drag the slider, or press AUTO to play it back at about one decision per second. The PROMPT panel shows every legal option at that moment and, in green, the one the player chose ("Next: …"). The LOG fills in as you go.

Use it to check why a deck won, to audit a rule ("why could that Unit not block?"), or to review your own game after the fact.

What LAB does, and how to use it

The lab is where AIs play each other in bulk so you can measure decks instead of guessing. Three kinds of job run in the background on this machine; you can keep using the other tabs while they run, and the Jobs panel shows progress. Results are files under out/lab/ and stay available after a restart.

  • Run a tournament — tick the decks, set games per pair, START. Every pair plays that many games with the first player alternating, stopping early when one side is clearly ahead. The report ranks decks three ways (see the Guide: Reading a report).
  • Run a league — the AI invents decks. Each builder either explores (invents a deck shape) or builds toward an archetype learned from earlier runs; every generation they improve their deck by trial swaps against each other, play a round robin, and the worst is replaced by a fresh build. Learned card values, past champions and the archetypes themselves carry over to the next league.
  • Generate decks — build many different legal decks at once (novelty rules keep them varied), optionally screen them against a panel and keep only the best. They appear in every deck list, so you can play them, edit them in BUILD or enter them in a tournament.

Reports on the right: open any finished tournament (including each generation of a league). A report says in words who won and how much to trust it, ranks the decks with their win rate and its range of plausible values, colours the head-to-head matrix by who beats whom and ticks the results that are statistically solid, prints every deck list with its archetype and shape, lists the cards that helped and hurt each deck, and for a league draws how every builder's strength moved across the generations. Each deck can be opened in BUILD with one tap.

Rough cost: heuristic AIs play about 5 games per second per core on a computer, 2–3 per core in the browser, and the LAB runs one engine per core. A 4-deck tournament at 200 games per pair is ~1,200 games, a minute or two; a 6-builder league of 3 generations takes 10–20 minutes. The estimate under each START button is a range, because every comparison stops as soon as its result is clear: the low end assumes each one settles at its first batch of games, the high end that every one runs to its cap. While a job runs, its card shows what it is doing, how many of its comparisons are settled, a progress bar, and a time-left range that applies the speed measured on this device to the games it can still play — the range narrows as comparisons settle. The games counter is information about the run so far, not a target.

Run a tournament

Every pair plays mirrored games (each seed twice, seats swapped) until the cap, or until one deck is clearly ahead or the two are clearly even. The report ranks the decks by win rate with its range of plausible values, by a strength rating fitted to all matchups at once, and by what to bring if you had to pick blind.

Run a league

Tick which builders take part: the Explorer invents deck shapes, and each archetype below is a kind of deck learned from the decks that have played here, shown with how often it has won. Builders improve their decks against each other, then play a round robin; each generation replaces the worst deck, and every finished generation teaches the archetypes, the knowledge store (learned card values) and the hall of fame.

Generate decks

Build many different decks at once, cycling through the ticked builders: the Explorer invents a shape for each deck, a learned archetype builds toward its centre on Legends its own decks used. A novelty penalty spreads the batch across the Legend space and a similarity floor keeps near-copies out. Optionally screen them against a panel and keep only the best.

Jobs

Reports

Pick a finished run and press OPEN. The page starts with the result in words, then the standings, the head-to-head matrix, every deck list, the cards that helped and hurt, and (for leagues) the evolution chart; a glossary at the end explains each term and a text version can be copied. Nothing on it needs prior knowledge of the statistics: a range is the plausible values, a tick means the result is unlikely to be luck.

What BUILD does, and how to use it

Build a deck by hand, or let the AI build one, and save it for PLAY and LAB. A legal deck is exactly 3 Legends with different names plus 40–50 other cards, at most 3 copies each. Your Legends decide what you may play: each Legend gives 2 RAM of its colour, and a card is legal only if its RAM is at most your total in that colour (so a Blue card with RAM 4 needs two Blue Legends).

  1. Choose Legends first: click Legend cards in the library (they sit at the end; filter type = Legend). The RAM badges update and the library greys out cards you can't run. Click a Legend in the slots to remove it.
  2. Add cards by clicking them (up to 3 copies, right-click removes one), or use the + / − controls in the list on the right. The cost curve, the size counter and the legality check update live; errors are spelled out.
  3. AI build: pick a builder and press BUILD. Explorer invents a deck shape; each archetype in the list is a kind of deck learned from the decks that have played in the LAB, and the build heads for the centre of that group (see the Guide). With keep my Legends ticked it builds around your three; otherwise it picks its own. It uses learned card values from past leagues when there are any.
  4. SAVE writes data/decks/<name>.json and the deck appears in PLAY and LAB at once. EXPORT shows a plain-text list to copy. load… opens any existing deck to edit; saving under a new name makes a copy.

The library filters: search matches name, subtitle, rules text, tags and keywords; legal for these Legends hides what your Legends can't run; the set filter isolates the cards that come only in the two starter decks, The Heist and Embracing Power. To tune a starter, load it from load…, edit, and SAVE under a new name.

AI build:
LEGENDS
COST CURVE

Card pool

What CARDS does

Browse the whole pool — 151 cards of Welcome to Night City plus the cards that come only in the starter decks. Search matches name, subtitle, rules text, tags, type and colour (try blocker, arasaka, steal). Hover or tap a card to read it at full size. The set filter isolates the starter-only cards.

Click any card for its strategy guide — what it does, what it combos with, and what wants it. The connections are not opinions: every card in the pool was tagged with what it creates and what it is paid for, and a link appears wherever one card's output meets another's requirement (a card that pushes a Gig down connects to every card paid for a min Gig). Links marked one step away need an intervening play — a Gear tutor finds the Gear, you still have to equip it.

Card data is transcribed from the printed cards and is the source of truth for the engine; the images are the real faces. Three cards are still placeholders because their full face was never captured: 6th Street Recruits, Adam Smasher — Metal Over Meat and Adrenaline Converter; Rebecca's ability is not yet revealed. These can't be put in a deck.