Fix cooperative_pong ball bounce physics (v7) — supersedes #1336 - #1398
Open
RewardGuard wants to merge 2 commits into
Open
Fix cooperative_pong ball bounce physics (v7) — supersedes #1336#1398RewardGuard wants to merge 2 commits into
RewardGuard wants to merge 2 commits into
Conversation
Kallinteris-Andreas
force-pushed
the
main
branch
from
July 13, 2026 03:48
079b7c9 to
dc1a4c8
Compare
Member
|
@RewardGuard I apologize for the hassle, but could you please rebase your changes off main? |
The ball previously had its position clamped exactly to the colliding surface on a bounce, discarding the distance it had already overshot past the wall/paddle within that step. This made bounces lose energy/precision and could let the ball clip through fast collisions. Reflect the overshoot back out of the surface instead of clamping, in both the top/bottom wall handling (ball.py) and the paddle collision handling (paddle.py). Because this changes environment dynamics, bump cooperative_pong_v6 -> v7 and update all references, docs, tests and the env registry accordingly. Supersedes Farama-Foundation#1336, fixes Farama-Foundation#1289. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RewardGuard
force-pushed
the
pong-physics-v7
branch
from
July 14, 2026 18:31
58c2902 to
ec34ffe
Compare
Collaborator
|
@RewardGuard there's merge conflicts. |
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.
Description
Supersedes #1336 (which had merge conflicts and a failing CI) and fixes #1289.
Cooperative pong resolved collisions by snapping the ball's position exactly onto the colliding surface, throwing away the distance the ball had already travelled past the wall/paddle during that step. The correct behaviour is to reflect that overshoot back out of the surface, so the bounce conserves the ball's motion within the step.
This PR:
ball.py— reflects the overshoot on top/bottom wall bounces instead of clamping to the wall.paddle.py— reflects the overshoot on all four paddle-collision cases (left/right/top/bottom) instead of clamping to the paddle edge.cooperative_pong_v6→v7(the physics change alters environment dynamics) and updates every reference: the version module,all_modules.py, the env registry, docs, and tests.Rebased cleanly on current
main, so there are no merge conflicts (thepyproject.toml/pygame_init_testfixes that #1336 carried are already present onmain).Type of change
Checklist:
pytestfor the affected env (api_test,parallel_api_test,seed_testall pass forcooperative_pong_v7).🤖 Generated with Claude Code