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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

essence_wars-0.8.6-cp313-cp313-win_amd64.whl (952.2 kB view details)

Uploaded CPython 3.13Windows x86-64

essence_wars-0.8.6-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.6-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.6-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

essence_wars-0.8.6-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.6-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.6-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.6-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.6-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.6-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.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2642a5cbae25dd19db0c175173104ee931d9aea6247b691f4409ef880299141c
MD5 651aa6ef02cf3b960a9951171f195655
BLAKE2b-256 c4ea4c4cf7414ccecb612b09267129ecebdaa05a240b9ed1cf173a7385fe5b7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5c2807e6f89ee41cd71657208c9c1abd2a9fe530ff089e38b9299cc42d7b3d5
MD5 f1090c404f42efff31d25dd5f5dfe89d
BLAKE2b-256 cc91157347290c04682f26febf9584a2aef9c82f634187bf780ecd17f9216124

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c51668cac35e39310a187636345c8a11b978a0a67c10fd6e86b85c4e24009175
MD5 381eda8e37089c3591bc879d735ce2c2
BLAKE2b-256 7c6e738407e8b11c1b5d37be67917e14b91456a7acba14792fd4a679a752508c

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7579aceaf67be5e7c602e02b0718829a5a5f7503ca3ed595012f9a8941e7f319
MD5 6699f160b53b42b2c9cc144aef98138f
BLAKE2b-256 bafdc9ed9628c40bc13fbc57b6c97c7a399f8829d18b839188c85977403667f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8f6eb193e27a42b321cff90e02318c2d80d836c495b7367f3187d669b95b306b
MD5 9e55cf8654704467c78855ea799ecbed
BLAKE2b-256 490354669f43208c1d74b042356320fe0aecca5281e15515eb221d21c78208aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 227ee0d1712f403d826aa01470464597cd5f0f4e92796c3ed7f92c0294e32fde
MD5 f5d7a816c713dafe2918ba6a3af8f6a6
BLAKE2b-256 58295fb2b766368c46f88ea4e0009bf25702adeb3a9771e7736c7abbd4409106

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9e8a80ff6ef9f1da3fa95666fcac316de21ec0f31a33e2c3fb173bad7daa7f8b
MD5 7024384c4ccbc9f3d573aaae26c1c5e8
BLAKE2b-256 7aaaa2b90a536b9b797fad8efcab49c35c8149ab789a7f03b7e421e9b9491da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 649f46371ff9eeb84a2e897bedac36cfa6b06965b50b4f8822254cb69b3f60f0
MD5 f8a72e166dd2b3a1e50590926d1cf4f7
BLAKE2b-256 7588459dc8343f407bedd82d36578d9b1d023b63c1955b8bf996c121eda32e46

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eaf4be1b4afca5969fa7a785aa6085bfd7a91d1104c562f4ed9df0ebdf46176c
MD5 464a396825405e6f918905e195c77fa0
BLAKE2b-256 60a1d688872fe230f7356d9141dcb6498f123059a4234a08fd92679eb95efe5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec1dfb1186ba2a7df4d5d5bb247463c19ed48008f100bf60ff161885eaf40e38
MD5 02cde0383095f81bb2adf9fe2ccb7bc3
BLAKE2b-256 2bc69501649fc76625c1bb408d51851dcf9de5ebc18756c9408060b45aa202b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for essence_wars-0.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6dbe19e61bd5a1f5540eb7781b308e7446cea4a8e56cd36e48b8b25b70630f1d
MD5 da27ef0ac0292d2c6480de8083ba9761
BLAKE2b-256 93ec9bd8b041c53bf5ebeb25e5b292824f1bdb1d6f3acc55684b2ee9343e3329

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.8.6-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