Add RetroSpaceDuel two-player environment (revives #92) - #197
Open
borgr wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asRetroSpaceDuel-v0.Changes vs. the original submission (API port only — mechanics unchanged)
reset()asTwoPlayerState;reset(num_players, seed)signature.ObservationType; invalid moves useset_invalid_move(reason=).set_winner(); turn-limit resolution viacheck_turn_limit().ActionFormattingWrapper(e.g.[f w]), so it works under the default wrappers.numpydependency and the deadoffline_rendererimport; addedget_board_str().Verification
ta.make("RetroSpaceDuel-v0")→ reset / observation / step all work; no placeholder leaks in the prompt.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.