Atari Asteroids
An implementation of the Atari Classic Asteroids as a gymnasium environment.
Installation
- Clone the repository
- Use pip to install as python package (
pip install <Path of setup.py>) - Copy the Resource folder into the working directory
Dependencies
The environment needs the following packages to run
gymnasiumnumpypygame
Environment Arguments
The environment can be customized using the following kwargs:
- render_mode: possible values are ["human", "agent", "rgb_array", "debug"], these are all explained in the Rendering Modes section
- obs_type: either "pixels" or "features", specifies the observation type given to the agent
- num_rays: a positive integer, specifying the number of rays the agent will use to see in "features" mode.
Feature Space
The agent get the following values as features:
- "agent_pos": Center position of the hitbox of the agent
- "forward_normal": Normalized vector in the direction the agent is facing
- "direction": Normalized vector in the direction the agent is traveling
- "velocity": Scalar velocity of the agent
- "angular_velocity": Scalar angular velocity of the agent
- "hit_distance": Distance to the asteroid hit
- "ray_direction": Normalized direction vector of the Asteroid the ray intersected (not implemented yet) The Shape of the vector depends on the number of rays the agent uses to see, but can be calculated via (8 + 5 * <num_rays>)
Pixel Space
A 64 by 64 pixel image, the Observation Space has the Shape (64, 64, 3).
Reward Function
The agent gets a positiv reward of 1.0 if he destroys an asteroid. The agent gets a negativ reward of -10.0 if he gets hit by an asteroid.
Rendering Modes
The Environment supports 4 different rendering mode:
1. "human"
The normal rendering mode, rendering the environment like a human would see the game.
2. "debug"
Same as human, but with the following debug info visualized:
- the hitbox of the player as orange box
- the hitbox of the asteroids as orange circle
- the rays used by the agent to "see" as blue lines
- the intersection points of the rays with the asteroids as red dots
- the players velocity, angular velocity and position as text in the topleft corner
3. "agent"
Visualizes the environment in a way the agent would "see" by rendering...
- ...the rays (in blue) it uses to "see"
- ...the forward facing direction of the agent (in red), this is the same as one of the eight rays
- ...the moving velocity and direction of the player (as green ray)
- ...the turning velocity and direction of the player (as orange ray)
- ...the intersection points of the rays with asteroids (in red)
- ...the direction vector of the asteroids (in red)
- ...the velocity, angular velocity and position of the player (as text)
4. "rgb_array"
Metadata
Release files for asteroidsenv 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| asteroidsenv-1.3.0.tar.gz | 22.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asteroidsenv-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.8 kB
Release files / asteroidsenv-1.3.0.tar.gz
| Download URL | asteroidsenv-1.3.0.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d9b6e4abda05989b1c7d82b31166d5338e87375efe293a8a25bc505b592657c
|
|
BLAKE2b-256 checksum How to use checksums |
9d7209fc80c67e9a3f80b39bcde3a5a33f3b7aeda31e3fe0eaafc824e9bfce76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / asteroidsenv-1.3.0-py3-none-any.whl
| Download URL | asteroidsenv-1.3.0-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f49e6ea9a2bdc996d19e3992ba4a8d19ea5d22243e94b1ed1882266ea791b11
|
|
BLAKE2b-256 checksum How to use checksums |
b4912db6e57ce3a6c5a21719bac82943f26da06d6b3f743f48b8898ba0b9982d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for asteroidsenv 1.3.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.