Skip to content

Commit

Permalink
Merge branch 'main' of github.com:bpiwowar/pystk2-gymnasium
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiwowar committed Oct 24, 2023
2 parents 3810d04 + d28f1d0 commit 6434982
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,36 @@

*warning*: pystk2-gymnasium is in alpha stage - the environments might change abruptly!

## Install

The PySuperKart2 gymnasium wrapper is a Python package, so installing is fairly easy

`pip install pystk2-gymnasium`

Note that during the first run, SuperTuxKart assets are downloaded in the cache directory.

## Environments

*Warning* only one SuperTuxKart environment can be created for now. Moreover, no graphics information
is available for now.

After importing `pystk2_gymnasium`, the following environments are available:

- `supertuxkart-v0` is the main environment containing complete observations
- `supertuxkart-simple-v0` is a simplified environment with fixed size observations
- `supertuxkart-flattened-v0` has observation and action spaces simplified at the maximum (only `obs_discrete` and `obs_continuous` keys)
- `supertuxkart-v0` is the main environment containing complete observations, with the following options:
- `render_mode` can be None or `human`
- `track` defines the SuperTuxKart track to use (None for random). The full list can be found in `STKRaceEnv.TRACKS` after initialization with `initialize.initialize(with_graphics: bool)` has been called.
- `num_kart` defines the number of karts on the track (3 by default)
- `rank_start` defines the starting position (None for random, which is the default)
- `use_ai` flag (False by default) to ignore actions and use a SuperTuxKart bot
- `max_paths` the maximum number of the (nearest) paths (a track is made of paths) to consider in the observation state
- `laps` is the number of laps (1 by default)
- `difficulty` is the difficulty of the other bots (0 to 2, default to 2)
- `supertuxkart-simple-v0` is a simplified environment with fixed number of observations for paths (controlled by `state_paths`, default 5), items (`state_items`, default 5), karts (`state_karts`, default 5)
- `supertuxkart-flattened-v0` has observation and action spaces simplified at the maximum (only `discrete` and `continuous` keys)
- `supertuxkart-flattened-discrete-v0` is like the previous one, but with fully discretized actions

The reward is the distance traveled.

## Example

```py3
Expand Down

0 comments on commit 6434982

Please sign in to comment.