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, Game Transformer
  • Training Infrastructure — Callbacks, experiment tracking, W&B integration

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
python scripts/training/ppo.py --timesteps 500000

# Train with W&B tracking
python scripts/training/ppo.py --timesteps 500000 --wandb

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.9.0.tar.gz (666.6 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.9.0-cp313-cp313-win_amd64.whl (905.2 kB view details)

Uploaded CPython 3.13Windows x86-64

essence_wars-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

essence_wars-0.9.0-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.9.0-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

essence_wars-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

essence_wars-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

essence_wars-0.9.0-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.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

essence_wars-0.9.0-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.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

essence_wars-0.9.0-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.9.0.tar.gz.

File metadata

  • Download URL: essence_wars-0.9.0.tar.gz
  • Upload date:
  • Size: 666.6 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.9.0.tar.gz
Algorithm Hash digest
SHA256 a8e8e8a1c01d7cd099f3d60ecebd0129b7e6cbb79de4865f7de204b023c866a6
MD5 6ed939f792a00b91ad56485d265609a9
BLAKE2b-256 6c36b930c8e3d37b27a0da45bbb918d14d6ef50fcf084921923e8e20b65715f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for essence_wars-0.9.0.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.9.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a48cb2249324cb5f144214ce19e62606d110845c111fddaf676b51a9d6215611
MD5 d80edae01a13b76dfc9015f542daf3a3
BLAKE2b-256 5f83d7a5d15ff3c02b4d7e067d2ece21e2a3b029cca59805eb130a46c49b235b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5ca17aaba5fe9179b307295e25d510eeef07955159d4d2d1818b4293b419261b
MD5 4e96300f8e26c8a5daa5ad3596e17e0b
BLAKE2b-256 598cb4b6f0e5687f815e7c8825eb6128434285c4edf02525ef862a88d4fb7848

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 da4a483e867a01d2708b70dcf383d45952d41aba078fcad932dcd9d3e084e8a7
MD5 e76dacd507349c30b532cd64371c2e98
BLAKE2b-256 dd22a54236068f3d303026bcafe7faf35c2c79de2386fbd478e3f8eda5bf0a4f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 200e5d806e619447c4f4178ac996ab8d3fc7a648c0c10992180e3492eb265195
MD5 6a2266d7cbbc4398140d7605b05e64b3
BLAKE2b-256 3470865997fe7bb599dc98fbea6b7bb3790fd545c4b738f2d94dcea265b7cce0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 25075ae1ff136451aa26d583d58d6d6ff85ab48dcdf90f94cf0815ab2645faf1
MD5 1f61e3056aa5f465bb03ad1de1447e77
BLAKE2b-256 b06bd302441422955eb8990aee4a040a3fc8cdfd8e2fd76942724d9a74b9c27c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfc031a3864f0e4564ae1c5a11bcf9a55d6373e5ba007f759d12481d3d0f8858
MD5 032fe99e1ee10657fcbf20566e08b1ee
BLAKE2b-256 0af79682dc9911ead593dff4f44de7f4d453b04e39c015df062b108d185719cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d7aa3856ddd38a8539b0bc9b4a5116601c97becad15de326c54327ca31ee2dd
MD5 1de5482ddc8835e6352889d7f030e69e
BLAKE2b-256 bf4395f95a0db2ee57a3c5515d9006bcd17eb2134aad11db13b91d250c021f23

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12fa6eeac32decfe42622e359e5dd55817fd15ceb76407c3dff447dc8cdbec89
MD5 172dbaccbdb9fbe4f1414a6bd11128ae
BLAKE2b-256 bbf2c5542a9a14be8e786488ee34c94f2c0ec1dcc007226226a7899e8ca2c75e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7c2b78cb24ef1f2a6a4caf7acf0ab39a2f17d5b46fbeea6260e23ca52adedb4a
MD5 d3926e42598af2b3960bfea2ec03f39d
BLAKE2b-256 8779adcd83e093d93dc7d452f348624778d35769bd404a16243afdd16cf84bd5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d42cc500adfc6fa84a54beecceebbb27d0a4c5dd3c9b7ecf4b5a498d7d38af3b
MD5 3307d0d6fc53a4e6eaaf8d130f13648d
BLAKE2b-256 61bbb9251a6b551b112611c70c2ec11df1504e6a908eb870bb03c71d69515b91

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for essence_wars-0.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 87ee9a73ce6b09fc1750ac8cb8b969c1af9414bdf03468536fa64ae85dd5e214
MD5 5381a0bca03915669f6154d49948dd16
BLAKE2b-256 38d71dc288d2496f6e8625ea1e547f54fb8ec9edc349d6f4e63a21535a8f9538

See more details on using hashes here.

Provenance

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