Feature/moving walls Added Barrier with Button functionality#3
Open
SeanYeSchool wants to merge 19 commits intomainfrom
Open
Feature/moving walls Added Barrier with Button functionality#3SeanYeSchool wants to merge 19 commits intomainfrom
SeanYeSchool wants to merge 19 commits intomainfrom
Conversation
Implements two new environment features: - Moving walls that travel in a direction each step, with optional bounce mode and agent-pushing behavior - Buttons that agents can interact with to control linked walls (toggle pause, direction, bounce, or trigger single-step move) Includes layout parsing (n/s/e/w for walls, ! for buttons), demo layouts, visualizer sprites, and an interactive play script. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tton or by time and does not trap agents when activated on the same tile
There was a problem hiding this comment.
Pull request overview
Adds moving walls, buttons, and barrier mechanics to the Overcooked V3 environment, including new layouts and visualization support, plus demo/test scripts to exercise the new functionality.
Changes:
- Extend Overcooked V3 state/layout parsing to include moving walls, buttons, and barriers (including timed barriers).
- Add rendering support for the new static objects in
OvercookedV3Visualizer. - Add demo/test scripts and interactive play entry points for exercising moving walls/barriers.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
jaxmarl/environments/overcooked_v3/common.py |
Adds StaticObject entries for moving walls/buttons/barriers and introduces ButtonAction. |
jaxmarl/environments/overcooked_v3/settings.py |
Adds MAX_* limits and default barrier duration constant. |
jaxmarl/environments/overcooked_v3/layouts.py |
Adds demo layouts and extends layout parsing/config to support walls/buttons/barriers. |
jaxmarl/environments/overcooked_v3/overcooked.py |
Implements barrier blocking, button interactions, moving wall movement, and barrier timers; updates obs shape. |
jaxmarl/viz/overcooked_v3_visualizer.py |
Renders moving walls/buttons/barriers and encodes barrier state for visualization. |
jaxmarl/environments/overcooked_v3/interactive.py |
Adds a simple interactive runner for Overcooked V3. |
play/play_moving_walls.py |
Adds a Pygame-based interactive demo for moving walls/buttons. |
tests/overcooked_v3/test_barriers.py |
Adds barrier behavior “tests” (currently print-driven). |
test_barrier_viz.py |
Adds a barrier visualization script (currently top-level executable). |
test_barrier_progression.py |
Adds a barrier progression visualization script (currently top-level executable). |
jaxmarl/environments/overcooked_v3/__init__.py |
Exports ButtonAction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/overcooked_v3/test_barriers.py
Outdated
Comment on lines
+132
to
+137
| print(f"After button press:") | ||
| print(f" Barrier active: {state.barrier_active[0]}") | ||
| print(f" Barrier timer: {state.barrier_timer[0]}") | ||
| print(f" Expected timer: 29 (barrier_duration - 1, since timer decrements on same step)") | ||
|
|
||
| if not state.barrier_active[0] and state.barrier_timer[0] == 29: |
There was a problem hiding this comment.
barrier_duration is configured as 5 for this test, but the expected timer is hard-coded as 29 here. This is inconsistent/misleading and will confuse future debugging. Consider computing the expected timer from the configured barrier_duration (and assert against it).
Suggested change
| print(f"After button press:") | |
| print(f" Barrier active: {state.barrier_active[0]}") | |
| print(f" Barrier timer: {state.barrier_timer[0]}") | |
| print(f" Expected timer: 29 (barrier_duration - 1, since timer decrements on same step)") | |
| if not state.barrier_active[0] and state.barrier_timer[0] == 29: | |
| # Timer is initialized from barrier_duration, then decremented on the same step | |
| expected_timer = int(state.barrier_duration[0]) - 1 | |
| print(f"After button press:") | |
| print(f" Barrier active: {state.barrier_active[0]}") | |
| print(f" Barrier timer: {state.barrier_timer[0]}") | |
| print(f" Expected timer: {expected_timer} (barrier_duration - 1, since timer decrements on same step)") | |
| if not state.barrier_active[0] and state.barrier_timer[0] == expected_timer: |
Fixed a bunch of overhead lag, demos in moving_wall_demo.py and moving_wall_bounce_demo.py
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.
No description provided.