Metadata-Version: 2.1
Name: soulsgym
Version: 1.0.0
Summary: OpenAI gym extension for DarkSouls III
Author-email: Martin Schuck <real.amacati@gmail.com>
License: Copyright 2022 Martin Schuck
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        
Project-URL: Homepage, https://github.com/amacati/SoulsGym
Project-URL: Documentation, https://soulsgym.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/amacati/SoulsGym
Keywords: gym,reinforcement learning,dark souls
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gymnasium (>=0.27.0)
Requires-Dist: mss (>=7.0.0)
Requires-Dist: numpy (>=1.21.0)
Requires-Dist: psutil (>=5.9.0)
Requires-Dist: PyYAML (>=6.0)
Requires-Dist: Pymem (>=1.10.0) ; platform_system == "Windows"
Requires-Dist: pywin32 (>=305.0) ; platform_system == "Windows"
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'

![soulsgym_banner](https://raw.githubusercontent.com/amacati/SoulsGym/master/docs/img/soulsgym_banner.png)
[![PEP8 Check](https://github.com/amacati/SoulsGym/actions/workflows/github-actions.yaml/badge.svg)](https://github.com/amacati/SoulsGym/actions/workflows/github-actions.yaml)   [![Documentation Status](https://readthedocs.org/projects/soulsgym/badge/?version=latest)](https://soulsgym.readthedocs.io/en/latest/?badge=latest)

SoulsGym is an extension for OpenAI's [gym](https://github.com/Farama-Foundation/Gymnasium) toolkit for reinforcement learning environments. It enables training and testing of reinforcement learning algorithms on Dark Souls III bosses.
SoulsGym uses the game as a simulation that is modified at runtime by reading and writing into the game memory to create gym environments from the game's boss fights.

- [Requirements](#requirements)
- [Installation](#installation)
- [API](#api)
- [Getting Started](#getting-started)
- [Documentation](#documentation)

## Requirements
You need to have the latest version of Dark Souls III installed since SoulsGym uses the game as engine for its environments. Dark Souls III is **not** available for free and has to be purchased (e.g. at the [Steam store](https://store.steampowered.com/app/374320/DARK_SOULS_III/)). SoulsGym requires the player to load into the game before any environments are created. In addition we require custom key bindings and graphic settings. It is also highly recommended to start the game in offline mode and delete your new save game after gym use to protect you from multiplayer bans.

> **Warning:** Please follow the setup description in our [official docs](https://soulsgym.readthedocs.io/en/latest/index.html) for the correct key settings, ban prevention, loss of game saves etc.

## Installation
To install soulsgym, use `pip install soulsgym`. At this time, we only support Windows. SoulsGym requires a running instance of Dark Souls III (see [requirements](#requirements)) and relies on the win32api. It is therefore not available on other operating systems.

## API
SoulsGym's environments follow the `gym` API as closely as possible. Since our environments are based on Dark Souls III we are, however, not able to provide reproducible results by setting the RNG seeds.

Our internal API for interacting with the game and creating the boss fight environments is located in the [`core`](soulsgym/core/) module. 

A detailed API documentation of our environments and the core library can be found in the [official docs](https://soulsgym.readthedocs.io/en/latest/index.html).

## Getting Started
You can use SoulsGym like any other `gym` environment. Below is an example of a random agent fighting against Iudex Gundyr:

```python
import gymnasium as gym
import soulsgym

env = gym.make("SoulsGymIudex-v0")
obs, info = env.reset()
terminated = False

while not terminated:
    action = env.action_space.sample()
    next_obs, reward, terminated, truncated, info = env.step(action)

env.close()
```
> **Note:** Dark Souls III has to be running with the correct settings when executing the script. See [requirements](#requirements).
## Documentation
For details on the `soulsgym` package see our [official docs](https://soulsgym.readthedocs.io/en/latest/index.html).
