Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added radius rescaling to simple env #1213

Merged

Conversation

pandyah5
Copy link
Contributor

@pandyah5 pandyah5 commented Jun 7, 2024

Description

This PR implements dynamic rescaling of the entity radius as we 'Zoom In' or 'Zoom out' of the rendering. This fixes #1188 which mentions that keeping the radius constant when rescaling the coordinates leads to an illusion of fixed obstacles coming closer or moving away from each other when in reality they are fixed.

Files modified: simple_env.py
High-level overview: Extended the concept of cam_range and recorded the original cam_range to scale the radius

Fixes #1188 , Depends on None

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update [Mentioning this in the documentation may be helpful]

Screenshots

Notice how the zoom out effect is more intuitive in the dynamic resizing case

Before dynamic resizing:
before

After dynamic resizing:
after

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have run pytest -v and no new errors are present.
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pandyah5 pandyah5 marked this pull request as ready for review June 7, 2024 21:03
@pandyah5
Copy link
Contributor Author

Hi @elliottower, just wanted to bring your attention to this PR. Let me know if it requires any changes, would be glad to add them!

Copy link
Member

@jjshoots jjshoots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for necro-ing this PR. the maintainers of PZ went on a short hiatus and are now getting back to things.

pettingzoo/mpe/_mpe_utils/simple_env.py Outdated Show resolved Hide resolved
@jjshoots
Copy link
Member

Thanks for the fix! Looks good to go for me, once precommit is fixed then we can merge. :)

@pandyah5
Copy link
Contributor Author

Thanks for the fix! Looks good to go for me, once precommit is fixed then we can merge. :)

Gotcha, for the precommit I just need to modify the formatting of my files right? The tutorial failures seem unrelated to this PR.

@pandyah5
Copy link
Contributor Author

@jjshoots I have modified the formatting and the pre-commit check passes now. Thanks for reviewing my PR!

PS: I just glanced over your website, your journey across the 'remote Pacific' is sooo cool. Is there a place where I can message you to learn more about it? 😄

@jjshoots
Copy link
Member

LGTM! Thanks for the addition.

You can contact me on Discord @jjshoots

@jjshoots jjshoots merged commit 9434bd7 into Farama-Foundation:master Jun 26, 2024
43 of 46 checks passed
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.

[Bug Report] Strange behavior in MPE Simple-Tag rendering
2 participants