Update knights_archers_zombies to v11#1297
Open
dm-ackerman wants to merge 58 commits intoFarama-Foundation:masterfrom
Open
Update knights_archers_zombies to v11#1297dm-ackerman wants to merge 58 commits intoFarama-Foundation:masterfrom
dm-ackerman wants to merge 58 commits intoFarama-Foundation:masterfrom
Conversation
The archer and knight were not aligned properly.
Arrow's initial position was set incorrectly. This impacted the display and the observations
Several changes made to Zombie class: * class is now responsible for initial position. This was broken before - zombie could spawn outside allowed area. This led to occasional image jumping behavior in rendering Unsure if it caused issues with the observations * simplified x-motion code * added type hints and docstrings Additionally, * removed SCREEN_UNITS from constants (no longer used) * added WALL_WIDTH to constants (used to define boundaries for zombies) * removed random position assignment in kaz env (now in class)
Also removed from documentation. It did nothing and the docs were wrong.
previous location caused circular import.
Added _fill_agent_name_mapping to fill the mapping which is done in two locations that had identical code.
This wasn't in the documentation and was confusing in the code. There is now an Actions Enum with named actions. The env documentation was updated to list the actions. The mixed 0-indexed and 1-indexed actions have been converted to 0-indexed everywhere.
remove name collision with pygame
Just to make a little clearer
There are two different methods, moving them to different functions keeps the code cleaner.
The direction and angle contained the same information. Angle has been removed and all used of it converted use the direction.
alive() is a function for pygame sprites, so the alive data members conflict with this.
moved duplicate code into base class fixed floats being assigned to ints added type hints added docstrings
Replaced `vector_state`, `use_typemasks`, and `sequence_space` parameters with `obs_method`. The 3 bools gave 8 options - half of which were invalid. `obs_method` takes one of four values * 'vector' (default) [vector_state=T,use_typemasks=F,sequence_space=F] * 'image' [vector_state=F,use_typemasks=F,sequence_space=F] * 'vector-sequence' [vector_state=T,use_typemasks=T,sequence_space=T] * 'vector-masked' [vector_state=T,use_typemasks=T,sequence_space=F] The actual behavior of the spaces is unchanged.
The components are now joined into a single backgroun image instead of being re-added individually each time.
Changing agent_list to agent_map makes the agent_name_mapping not needed. This reduces a layer of abstraction when accessing an agent.
The method changes, but result should be the same. The intent is to support future plans.
removes some warnings
This adds a mix-in class that adds properties for vector state with and without typemasking.
This also adds an interval timer to simplify the code of deciding when to spawn a new zombie.
The docs said the state listed archers before knights. This wasn't explicitly done in the code (although may have worked out that way). It's now explicitly ordered.
type masks were wrong
The behavior is the same but the name was changed because rate implied a higher number was faster which was the opposite of the behavior.
Always create a screen Remove unneeded draws Store screen dimensions as var for later use
This will be added back after the manual policy is updated
added docstrings and updated/expanded the env doc
In the process, also avoid geting an image unless needed
There were artifical limits on when forward or back movement could be done. These were removed. In addition, the tests for out of bounds and the clamping to be within bounds were not aligned with the screen area. This has been fixed.
This now correctly identifies when agents reach the bottom as well as being more general in supporting left/right limits
Contributor
Author
|
hmm.... The are two groups of failures: a) waterworld tests and b) pygame display mode issues This PR doesn't touch waterworld and I see an earlier PR is failing there too, so I don't think that's me. I see the display mode issues locally too, but i thought that was an SDL bug on my system. I'm confused by this one because the errors are in envs i didn't touch. I'm going to poke at this later. |
This inadvertantly broke other code.
Contributor
Author
|
The display issue is fixed. The waterworld issue is the same as in #1295 . This should be ready after that is fixed. |
|
Hi, I'm interested in this branch, any news of merging this yet ? |
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
Behavior changes:
vector_state,use_typemasks, andsequence_spaceparameters with
obs_methodThe old options had multiple invalid combinations. The obs_method
options are listed in the documentation
'Rate' implied higher numbers were faster which was the
opposite of the behavior.
Other changes:
Type of change
Checklist:
pre-commitchecks withpre-commit run --all-files(seeCONTRIBUTING.mdinstructions to set it up)pytest -vand no errors are present.pytest -vhas generated that are related to my code to the best of my knowledge.