Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add RetroSpaceDuel two-player environment (revives #92) - #197

Open
borgr wants to merge 1 commit into
TextArena:mainfrom
borgr:retrospaceduel-revive
Open

Add RetroSpaceDuel two-player environment (revives #92)#197
borgr wants to merge 1 commit into
TextArena:mainfrom
borgr:retrospaceduel-revive

Conversation

@borgr

@borgr borgr commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Revives RetroSpaceDuel, originally proposed by @romirthedev in #92. That PR targeted an older State/observation API and no longer imports against current main, and the author is no longer active, so this ports it forward and verifies it end-to-end.

What this is

A two-player competitive space shooter on an emoji grid: move in 8 directions, shoot (f <dir>), with asteroids (indestructible, ricochet), debris (destructible), nebulas (slow movement, projectiles pass through), mines, and power-ups (shield / speed / spread-shot). Win by eliminating the opponent; at the turn limit the higher-health player wins (draw on a tie). Registered as RetroSpaceDuel-v0.

Changes vs. the original submission (API port only — mechanics unchanged)

  • State is created in reset() as TwoPlayerState; reset(num_players, seed) signature.
  • Observations use ObservationType; invalid moves use set_invalid_move(reason=).
  • Single-winner outcomes use set_winner(); turn-limit resolution via check_turn_limit().
  • Action parser tolerates the brackets added by ActionFormattingWrapper (e.g. [f w]), so it works under the default wrappers.
  • Dropped the unused numpy dependency and the dead offline_renderer import; added get_board_str().

Verification

  • ta.make("RetroSpaceDuel-v0") → reset / observation / step all work; no placeholder leaks in the prompt.
  • Terminal branches verified: opponent elimination, turn-limit health-win, turn-limit draw, and clean projectile hits (damage applied, shooter unharmed).
  • Random-play smoke across 8 seeds: every episode terminates with no exceptions.

Design note for reviewers

The original (intentional) mechanic is preserved: a shot that reaches a boundary or asteroid ricochets back and eliminates the shooter, so firing without a target lined up is self-destructive. The prompt warns about this. Under a purely random policy this ends games very fast; a policy that reads the rules avoids blind shots. Happy to adjust (e.g. reflect instead of eliminate) if maintainers prefer a softer rule.

Closes #92 if you'd rather track it here; otherwise feel free to keep #92 open and land this instead.

Revives the RetroSpaceDuel game (originally proposed in TextArena#92) ported to the
current TextArena environment API:

- State created in reset() as TwoPlayerState; reset(num_players, seed).
- Observations use ObservationType; invalid moves use set_invalid_move(reason=).
- Single-winner outcomes use set_winner(); turn-limit resolves by health
  (draw on a tie) via check_turn_limit().
- Action parser tolerates ActionFormattingWrapper brackets (e.g. [f w]).
- Dropped the unused numpy dependency and the dead offline_renderer import;
  added get_board_str() for the board-observation wrappers.

Registered as RetroSpaceDuel-v0. Game mechanics (movement, shooting with
boundary/asteroid ricochet, mines, debris, nebulas, power-ups, spread shot)
are unchanged from the original submission.
@borgr borgr mentioned this pull request Aug 9, 2026
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant