Skip to main content

EldenGym 🎮

PyPI version Tests Documentation Python 3.10+ License: MIT

A Gymnasium-compatible reinforcement learning environment for Elden Ring.

🚀 Quick Start

import gymnasium as gym
import eldengym

# Create environment
env = gym.make("EldenGym-v0", scenario_name="margit")

# Standard RL loop
obs, info = env.reset()
for _ in range(1000):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)

    if terminated or truncated:
        obs, info = env.reset()

env.close()

✨ Features

  • 🎯 Gymnasium API - Standard RL interface
  • 🎮 Multiple Action Spaces - Discrete, multi-binary, or continuous
  • 📊 Flexible Observations - RGB frames, game state, or both
  • ⚡ High Performance - gRPC-based C++ backend
  • 🔧 Customizable - Easy reward functions and wrappers
  • 🏆 Boss Scenarios - Pre-configured boss fights

📚 Documentation

Read the full documentation →

🔧 Installation

From PyPI (Stable Release)

pip install eldengym

From Source (Development)

# Clone repository
git clone https://github.com/dhmnr/eldengym.git
cd eldengym

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e .

🎮 Usage Examples

With Stable-Baselines3

from stable_baselines3 import PPO
import gymnasium as gym

env = gym.make("EldenGym-v0", scenario_name="margit")
model = PPO("CnnPolicy", env, verbose=1)
model.learn(total_timesteps=100_000)

Custom Reward Function

def custom_reward(obs, info, terminated, truncated):
    reward = 0.0
    if 'target_hp_delta' in info:
        reward += info['target_hp_delta'] * 10.0
    return reward

env = gym.make("EldenGym-v0", reward_function=custom_reward)

📖 Examples

Check out the examples directory:

🛠️ Development

# Install dev dependencies
uv sync --group dev --group test --group docs

# Run tests
uv run pytest

# Format code
uv run ruff format .

# Serve documentation locally
uv run mkdocs serve

📋 Requirements

  • Elden Ring (PC version)
  • Siphon Server (C++ gRPC backend)
  • Python 3.10+
  • Windows (for game interaction)

🤝 Contributing

Contributions are welcome! Please see our Contributing Guide.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📧 Contact


⭐ Star this repo if you find it useful!

Metadata

Release files for eldengym 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eldengym 0.6.0
File Size Uploaded
eldengym-0.6.0.tar.gz 279.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eldengym 0.6.0
File Interpreter ABI Platform
eldengym-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 309.2 kB

Release files / eldengym-0.6.0.tar.gz

Download URL eldengym-0.6.0.tar.gz
Size 279.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c9b1aa62ecf9ba1acdde73db9c399213991f84f2a38108fc2ba9adf24876eb19
BLAKE2b-256 checksum
How to use checksums
e514f18b4ba98fa594b84b095cacd70aa4482593d85378977a09716989ab4d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 20, 2026.

Transparency log

Release files / eldengym-0.6.0-py3-none-any.whl

Download URL eldengym-0.6.0-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ca6f776d4542b702b996f095e004aa808e2cce7915ea9830318a8d46ec478cf
BLAKE2b-256 checksum
How to use checksums
90065ff5e2fe60609473b308b8f0261c90160ca08130cdfd0671e71141859589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page