Print & Play¶
This page covers generating printable cards from SVG templates and assembling a physical deck.
Generating Cards¶
The card generator pipeline converts the card data (cards_v03.json)
into print-ready PNG images via SVG templates.
Quick Start¶
python tools/card_generator/generate_cards.py \
--cards-json cards/cards_v03.json \
--dpi 300 \
--out-dir my_cards/
CLI Reference¶
| Flag | Default | Description |
|---|---|---|
--cards-json |
cards/cards_v03.json |
Card data file |
--dpi |
150 |
Output resolution (300 for print quality) |
--out-dir |
output/ |
Output directory |
--format |
png |
Output format (png or svg) |
--template |
tools/card_generator/templates/card_template.svg |
SVG template path |
--config |
tools/card_generator/templates/faction_config.json |
Faction colour/symbol configuration |
Pipeline¶
cards_v03.json → svg_builder.py → rasterizer.py → PNG
↑ ↑
card_template.svg (cairosvg / Inkscape)
faction_config.json
svg_builder.py— Reads the card JSON, applies card data to named SVG elements (by XMLid), sets faction colours from config.rasterizer.py— Renders populated SVGs to PNG at the requested DPI using cairosvg or Inkscape as a fallback.
Template Variables¶
The SVG template (card_template.svg) has named elements that
svg_builder.py targets:
| SVG Element ID | Populated With |
|---|---|
card-title |
Card name |
card-type |
Card type (harvest, sacrifice, etc.) |
harvest-value |
Harvest amount |
card-text |
Effect description |
flavor-text |
Flavour text |
faction-name |
Archetype name |
art-clip |
AI-generated card art (from visual_prompt) |
Printing Recommendations¶
Card Stock¶
- Weight: 300–350 gsm (grams per square metre) for a tabletop feel
- Finish: Matte or linen — avoids glare, handles better than gloss
- Size: Standard poker (63 × 88 mm) at 300 DPI
Sizing¶
Cards are generated at poker size (750 × 1050 px at 300 DPI = 63.5 × 88.9 mm). Add 3 mm bleed on all sides if using a professional print service.
Deck Assembly¶
| Deck | Cards to Print |
|---|---|
| Forest | 30 × Cedar of the Sacred Forest (Forest Deck) + 20 × Cedar (Box Reserve) |
| Warrior-King | 18 cards (all unique IDs starting with warrior_) |
| Temple Keeper | 20 cards (all unique IDs starting with temple_) |
| River Merchant | 20 cards (all unique IDs starting with merchant_) |
| Stranger-King | 20 cards (all unique IDs starting with stranger_) |
| Event | 12 cards (all unique IDs starting with event_) |
Total: 140 cards (50 forest tokens + 78 archetype cards + 12 events).
Tokens¶
For physical play, you also need: - 12 Capacity tokens (any small object or printed chit) - 10 Patience tokens - 6 Renewal tokens - 1 Defection Token (double-sided) - 1 six-sided die (Forest Die) - Forest Health track (0–10, printed or drawn)
Card Art¶
AI-generated card art is included in the repository as
CC0 1.0 — free to
use, modify, and redistribute. Each card's visual_prompt field in
cards_v03.json describes the intended artwork style (Assyrian
bas-relief, black ink on cream).
To regenerate card art with a different style, modify the
visual_prompt fields and re-run the generation pipeline. The
generate_cards.py script can embed external images by path
reference in the card data.
Digital Play Alternatives¶
If physical printing is not practical, the game can be played entirely in simulation mode:
# Heuristic mode (no LLM needed)
python agents/cards_ai_play.py \
--deck1 warrior --deck2 temple \
--cards cards/cards_v03.json --demo --games 1
# LLM mode (local model)
python agents/cards_ai_play.py \
--deck1 stranger --deck2 warrior \
--cards cards/cards_v03.json --games 5 \
--api-model deepseek-v4-flash
See First Card Game for a full tutorial and Card Generator for the pipeline reference.