Skip to content

Asterix-MinAtar

MinAsterix

MinAsterix(use_minimal_action_set: bool = True)

Bases: Environment[EnvState, EnvParams]

Collect treasure while dodging enemies that cross the screen.

JAX port of the MinAtar Asterix environment. The player starts at column 5, row 5 of a 10x10 grid and moves freely in the four cardinal directions within rows 1 to 8. Enemies and treasure spawn at the left and right edges of these rows and cross the grid horizontally, with at most one entity per row; each spawned entity is treasure with probability 1/3. If params.ramping is set, the difficulty increases periodically: entities spawn and move faster.

  • Observation: Box of shape (10, 10, 4) with binary channels: 0 player, 1 enemy, 2 trail (the cell behind each enemy and treasure, indicating its direction), 3 treasure.
  • Actions: Discrete(5) with the minimal action set: 0 no-op, 1 left, 2 up, 3 right, 4 down. Discrete(6) with the full action set, which adds 5 (fire) without any effect.
  • Reward: +1 for each treasure collected.
  • Termination: the player makes contact with an enemy.
  • Truncation: after params.max_steps_in_episode steps (1000 by default).

Parameters:

  • use_minimal_action_set (bool, default: True ) –

    Whether to expose only the actions that have an effect in this game instead of all six MinAtar actions.

References

Parameters and state

EnvParams

Bases: EnvParams

Parameters of the Asterix environment.

Attributes:

  • ramping (bool) –

    Whether the difficulty increases over the course of an episode.

  • ramp_interval (int) –

    Start value of the countdown between difficulty increases.

  • init_spawn_speed (int) –

    Initial number of steps between entity spawns.

  • init_move_interval (int) –

    Initial number of steps between entity moves.

  • shot_cool_down (int) –

    Unused.

  • max_steps_in_episode (int) –

    Number of steps after which the episode is truncated.

EnvState

Bases: EnvState

State of the Asterix environment.

Attributes:

  • player_x (int) –

    Column of the player.

  • player_y (int) –

    Row of the player.

  • shot_timer (int) –

    Unused; stays at 0.

  • spawn_speed (int) –

    Current number of steps between entity spawns.

  • spawn_timer (int) –

    Steps left until the next entity spawns.

  • move_speed (int) –

    Current number of steps between entity moves.

  • move_timer (int) –

    Steps left until the entities move next.

  • ramp_timer (int) –

    Countdown to the next difficulty increase.

  • ramp_index (int) –

    Number of difficulty increases so far.

  • entities (Array) –

    Array of shape (8, 5) with one entity slot for each of the rows 1 to 8. Columns are [x, y, direction, is_gold, active], where direction is 1 for entities moving right and 0 for entities moving left.

  • time (int) –

    Number of steps taken in the current episode.

  • terminal (bool) –

    Whether the episode has terminated.