-
Notifications
You must be signed in to change notification settings - Fork 38
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
Version 1 release: major improvements, bug fixes and more #8
Conversation
This file contains 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
genyrosk
changed the title
Version 1
Version 1 release: major improvements, bug fixes and more
Jan 13, 2021
This was referenced Jan 13, 2021
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.
Version 1 of
gym-chess
is an almost complete rewrite of the original code with a bunch of improvements, bug-fixes and tests. The original implementation has been renamed V0, but further development or maintenance of it is not planned.Environment settings
As chess is a 2-player game, you can choose to play against a random bot or against yourself (self-play).
initial_state
: initial board positions, the default value is the default chess starting boardopponent
: can be"random"
,"none"
or a function. Tells the environment whether to use a random bot, play against self or use a specific bot policy (default:"random"
)log
:True
orFalse
, specifies whether to log every move and render every new state (default:True
)player_color
:"WHITE"
or"BLACK"
, only useful if playing against a botNew move specification:
Moves are now specified as either:
((from_x, from_y), (to_x, to_y))
"CASTLE_KING_SIDE_WHITE"
,"CASTLE_QUEEN_SIDE_BLACK"
,"RESIGN"
Moves are pre-calculated for every new state and stored in
possible_moves
.A basic script would look like this:
You can also calculate the possible steps separately for every player:
State
The state is the board with pieces.
It can be rendered in a prettier way with the
render()
method:Every integer represents a piece. Positive pieces are white and negative ones are black.
Piece IDs are stored in constants that can be imported.
The schema is:
Additional information can be found in other attributes of the environment:
Other features
Code linting and fixing
Code fixing is done with black with max line width of 100 characters with the command
black -l 100 .
No config needed.Notes:
En-passant moves are not currently supported in the V1 environment.