Skip to main content

Gymnasium wrapper for PySTK2

Project description

PySuperTuxKart gymnasium wrapper

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

Environments

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 discrete and continuous keys)
  • supertuxkart-flattened-discrete-v0 is like the previous one, but with fully discretized actions

Example

import gymnasium as gym
import pystk2_gymnasium

# Use a a flattened version of the observation and action spaces
# In both case, this corresponds to a dictionary with two keys:
# - `continuous` is a vector corresponding to the continuous observations
# - `discrete` is a vector (of integers) corresponding to discrete observations
env = gym.make("supertuxkart-flattened-v0", render_mode="human", use_ai=False)

ix = 0
done = False
state, *_ = env.reset()

while not done:
    ix += 1
    action = env.action_space.sample()
    state, reward, terminated, truncated, _ = env.step(action)
    done = truncated or terminated

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

pystk2_gymnasium-0.1.0.tar.gz (19.4 kB view hashes)

Uploaded Source

Built Distribution

pystk2_gymnasium-0.1.0-py3-none-any.whl (20.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page