Skip to main content

High-performance card game environment

Project description

Essence Wars

A deterministic, perfect-information strategy card game designed for AI research

Quick StartFeaturesProject StructureDocumentationContributing


What is Essence Wars?

Essence Wars is a strategic two-player card game engine with a focus on:

  • Perfect Information — Both players see all cards, including hands and decks. Victory comes from outthinking your opponent, not luck.
  • Deterministic Execution — Seeded RNG ensures every game is reproducible, perfect for AI training and analysis.
  • Lane-Based Combat — Creatures occupy board positions, creating spatial strategy alongside card selection.
  • ML-Ready Design — 328-float state tensors, 256 discrete actions, and high-performance Rust engine (~33k games/sec).

Gameplay

Features

Desktop Application

Full-featured Tauri desktop client with Human vs AI, Spectator mode, Replays, Deck Builder, and Tutorial.

Main Menu Spectator Mode Deck Builder

AI & Machine Learning

  • Multiple Bot Types — Random, Greedy (28 tunable weights), MCTS, Alpha-Beta search
  • Python ML Framework — Gymnasium/PettingZoo environments, PPO, AlphaZero, Card2Vec
  • Training Infrastructure — Callbacks, experiment tracking, Elo ratings, HTML reports

Claude Code Integration

Play Essence Wars directly in Claude Code via MCP (Model Context Protocol):

  • Natural language game control
  • AI move recommendations with analysis
  • Live game visualization in Tauri UI

Quick Start

Play the Desktop App

# Clone and build
git clone https://github.com/christianwissmann85/essence-wars
cd essence-wars
cargo build --release

# Launch the UI
cd crates/essence-wars-ui
pnpm install && pnpm tauri:dev

Train ML Agents (Python)

# Install Python package
pip install essence-wars[train]

# Train a PPO agent
essence-wars train ppo --timesteps 500000

# Benchmark against baselines
essence-wars benchmark --checkpoint model.pt

Play via Claude Code (MCP)

Add to your .mcp.json:

{
  "mcpServers": {
    "essence-wars": {
      "command": "./target/release/essence-wars-mcp"
    }
  }
}

Then in Claude Code: "Start a game with the Iron Wall deck against Swarm Aggro"

Project Structure

essence-wars/
├── crates/
│   ├── cardgame/           # Core game engine (Rust)
│   ├── essence-wars-ui/    # Desktop app (Tauri + Svelte)
│   └── essence-wars-mcp/   # MCP server for Claude Code
├── python/                 # ML agents & training (PyTorch)
├── data/
│   ├── cards/              # Card definitions (YAML)
│   ├── decks/              # Deck definitions (TOML)
│   └── weights/            # Bot weight files
└── docs/                   # Documentation
Component Description README
cardgame High-performance game engine, bots, CLI tools README
essence-wars-ui Cross-platform desktop client README
essence-wars-mcp MCP server for Claude Code README
python ML agents, training, benchmarking README

Three Factions

Faction Identity Keywords
Argentum Combine Defense & durability Guard, Shield, Fortify, Piercing
Symbiote Circles Aggressive tempo Rush, Lethal, Regenerate, Volatile
Obsidion Syndicate Burst damage Lifesteal, Stealth, Quick, Charge

Plus Neutral cards and 12 unique Commanders with passive abilities.

Documentation

Game Design

Art & Assets

ML & AI

Development

Performance

Metric Value
Random games ~33,000/sec
Greedy bot games ~4,300/sec
MCTS (100 sims) ~22ms/move
Engine state clone ~245 ns
State tensor encode ~158 ns

Commands

# Build & Test
cargo build --release                    # Full workspace
cargo nextest run --status-level=fail    # Rust tests
uv run pytest python/tests               # Python tests

# Lint
cargo lint                               # Rust (clippy)
uv run mypy python/essence_wars          # Python types
pnpm run check                           # Svelte/TS (in UI crate)

# Game Tools
cargo run --release --bin arena --       # Bot matches
cargo run --release --bin validate --    # Quick balance check
cargo run --release --bin benchmark --   # Thorough analysis
cargo run --release --bin swiss --       # Tournament mode

Contributing

Contributions are welcome! This project uses:

  • Rust for the core engine and desktop backend
  • Svelte 5 (with runes) for the desktop frontend
  • Python for ML agents and training

Each crate has its own CLAUDE.md with AI-developer context and README.md with human contributor documentation.

Development Setup

# Rust
cargo build --release

# Python (using uv)
uv sync --all-groups
uv run pytest python/tests

# UI (using pnpm)
cd crates/essence-wars-ui
pnpm install
pnpm tauri:dev

Citation

If you use Essence Wars in your research, please cite:

@software{essence_wars,
  title = {Essence Wars: A High-Performance Card Game Environment for RL Research},
  author = {Wissmann, Christian},
  year = {2025},
  url = {https://github.com/christianwissmann85/essence-wars}
}

License

MIT License — see LICENSE for details.


Built with Rust, Svelte, and PyTorch
Designed for humans and AIs alike

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

essence_wars-0.8.7.tar.gz (720.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

essence_wars-0.8.7-cp313-cp313-win_amd64.whl (952.4 kB view details)

Uploaded CPython 3.13Windows x86-64

essence_wars-0.8.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

essence_wars-0.8.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

essence_wars-0.8.7-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

essence_wars-0.8.7-cp313-cp313-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

essence_wars-0.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

essence_wars-0.8.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

essence_wars-0.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

essence_wars-0.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

essence_wars-0.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

essence_wars-0.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

File details

Details for the file essence_wars-0.8.7.tar.gz.

File metadata

  • Download URL: essence_wars-0.8.7.tar.gz
  • Upload date:
  • Size: 720.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for essence_wars-0.8.7.tar.gz
Algorithm Hash digest
SHA256 7a98e6abd3863786025e875a32ebd3797dc29ee59a86acb10d5e1722997dd9bd
MD5 4119cb42f5c1c0ca3e06aba3b65fe50c
BLAKE2b-256 b65a646d354744db091b09f8ca0918f21a7ebe8cc511aa12b9b53ecac877ac6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7.tar.gz:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8b0727955c14bd50681bb7b2e272d67208c6bc3ed6d8e0b54444d5f38f6cada9
MD5 592a5e739646a50c0d1a6ea7ed3b4dfb
BLAKE2b-256 92042d4e486548956f54b2dde35dceb75375d29f37bba664edc63c9e58ce19d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6020585a654eee92917e30324c1398f629dfaa9d2f3d38c17cd3f6fea2b4e77
MD5 31eea8dec009632396a4128ee02655db
BLAKE2b-256 68aa003d62ffac97919b25a1740e9efc575f8429a862dfc9e47aa2b98cc0a653

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fdbcf0f52a47dd551a4714ceebb4f9e57dd0e77ceb642bb8c119ffcae6bd7678
MD5 10635087dac62b71bb720658e6183d5f
BLAKE2b-256 1e84d11be27478bfac1b6620a17fb3531124bcadbf3a436fb1467bcb3c0ea3e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd7cab5c045e425b1303aae07d412d087ea4da150ee33d0717cfa6a31c8d25c5
MD5 b572699ba0369bac1fb807f530e0ae0a
BLAKE2b-256 a8dbf154aca6711e8f5fe794a6bee5c44203fd67457d13c00a1931903385a76f

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9baa1854d6abdf4520ee74db45245cc09afafc1c095c6090a64e93460bad9c47
MD5 9ed46a55fdeee974d108b7b1752709a0
BLAKE2b-256 f1cc2a7dd6a3ba96ad70040c891a0dbb97d09f5185fe339459ef9328af4425a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8de6737102edaf227fbff799ce4f36a98314d6993f111579516d900c91951dd
MD5 f912b88852558514562708dcb5099a29
BLAKE2b-256 90ec1fceb5e1ac47cc3108f2e84730b5528295fdf0d8c35bc7d0ce2f6a4ad059

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 119bb43df298f2b5c624e9aea2c96d37faea305e3ba9a2160fb02259b97ae5bd
MD5 60ecbbb6e0da6c9ba7d8ead11f95acb4
BLAKE2b-256 02e600ec77541cf36be0d101e48f1f559ba1dd981d96190a2ec5d4c517668354

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bb0573f9c1dd93a9f9947fa30969d068a6f7f21eb0d9f9576468f098f6c0680
MD5 f921072dd917127ffad11c105c71dab6
BLAKE2b-256 81438637f052f6107e8e9f3d9b2480f587e8980906c8eaf0409be61d8e6b76b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1e24cfa55c3817cd6cf6e7962b7480c61e933a938cfe5bf976db3aef04cce11f
MD5 b1347c247da5b7d703d04a2848c36355
BLAKE2b-256 2066954ba8422a805c65ce1fa337ee69995a6d9b811388af870f0e22b3e4a8dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f783a59d1b10283b40872a702c6f4f0b330798baf2b90bf5cac656d49563bf28
MD5 abdb236f9f96a05afc0b4e42875d2991
BLAKE2b-256 45b33a8c924aaa140992e1106ce08cf6bac33608ec4f74dd78ac4b2957eced05

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essence_wars-0.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8293f36c0203978f62e6eb56a2266d092d673a87d644c2d4de1c7ab118a674d3
MD5 a5ec9691cd720370047308ef1c638f28
BLAKE2b-256 7ce957e1a1382013e97b2fa41c610adfd7aea563f08736b860a80c7d9cefacf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on christianWissmann85/essence-wars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page