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

Skip to content

Add Bomberman two-player environment (revives #93) - #198

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

Add Bomberman two-player environment (revives #93)#198
borgr wants to merge 1 commit into
TextArena:mainfrom
borgr:bomberman-revive

Conversation

@borgr

@borgr borgr commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Revives the two-player Bomberman environment, originally proposed by @romirthedev in #93. 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 turn-based two-player Bomberman on a grid with indestructible (#) and destructible (+) walls. Each turn a player moves ([up]/[down]/[left]/[right]), waits ([stay]), or drops a bomb ([bomb]). Bombs detonate after a timer with a cross-shaped blast that destroys destructible walls and eliminates players caught in it. Last player standing wins; both caught in one blast, or reaching the round limit, is a draw. Registered as Bomberman-v0.

Changes vs. the original submission

  • 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(); mutual destruction and the round limit resolve to a draw.
  • Dropped the unused numpy dependency and the dead offline_renderer import; added get_board_str().
  • Bug fixes beyond the API port: player spawn cells could land on an indestructible pillar (for even grid sizes) — the spawn cell is now forced clear; and dropping a bomb onto a cell that already holds a bomb is now rejected as an invalid move.
  • The action regex already matched bracketed tokens, so it works cleanly under ActionFormattingWrapper.

Verification

  • ta.make("Bomberman-v0") → reset / observation / valid move all work.
  • Terminal branches verified with deterministic scenarios: bomb eliminates the opponent → single winner; both players in one blast → draw; round-limit → draw; repeated invalid actions → loss.
  • Random-play smoke across 6 seeds: every episode terminates with no exceptions.

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

Revives the two-player Bomberman game (originally proposed in TextArena#93) 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(); mutual destruction and the
  turn (round) limit resolve to a draw.
- Dropped the unused numpy dependency and the dead offline_renderer import;
  added get_board_str() for the board-observation wrappers.
- Fixed spawn cells being placed on indestructible pillars (spawn cell is now
  forced clear) and rejected placing a bomb on top of an existing bomb.

Registered as Bomberman-v0. Bomb/explosion/destructible-wall mechanics 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