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

rbc observations #696

Closed
VitamintK opened this issue Aug 21, 2021 · 4 comments
Closed

rbc observations #696

VitamintK opened this issue Aug 21, 2021 · 4 comments
Assignees

Comments

@VitamintK
Copy link
Contributor

VitamintK commented Aug 21, 2021

(spinning out the potential issues I brought up in #695 regarding RBC observation strings/tensors into its own thread)

  1. The RBC rules say "If a player captures a piece, she is informed that she made a capture (but she is not informed about what she captured)" but from skimming the observation string code in open_spiel, I couldn't find this in there.
  2. Captures do seem to be part of the observation tensor already, but it seems to always be set to true. Isn't state.move_captured_ always true? It's set by move_captured_ = Board().at(move.from).color != Board().at(move.to).color, and since the color of the destination square is either the opponent or empty, it will always be unequal to the piece's color, no? If true, this could be fixed by using OppColor instead of !=
  3. illegal_move_attempted_ is in the public info tensor, but it doesn't seem like it should be common knowledge if my opponent attempted an illegal move (if things like failed pawn captures or forward moves are considered illegal moves)
  4. It looks like the observation string (DarkFEN) includes the half-move clock, which informs the other player whether the previous player made a pawn move or not:
game = pyspiel.load_game('rbc')
# white makes pawn move
print(game.new_initial_state().child(0).child(3594).observation_string())
# white makes knight move 
print(game.new_initial_state().child(0).child(656).observation_string())
>>> rnbqkbnr/pppppppp/????????/????????/????????/????????/????????/???????? b kq - 0 1
>>> rnbqkbnr/pppppppp/????????/????????/????????/????????/????????/???????? b kq - 1 1

But this doesn't seem to be an issue in the observation tensor.

@lanctot
Copy link
Collaborator

lanctot commented Aug 22, 2021

@michalsustr can you take a look?

@michalsustr
Copy link
Collaborator

Hey @VitamintK thanks for making the issue. I am at the moment busy with some duties, but I will try to respond by the end of this week.

@michalsustr
Copy link
Collaborator

michalsustr commented Aug 31, 2021

  1. / 4) The RBC rules say "If a player captures a piece, she is informed that she made a capture (but she is not informed about what she captured)" but from skimming the observation string code in open_spiel, I couldn't find this in there.

Yes, the strings are based on DarkFEN and should be implemented appropriately for RBC... I took too much of a shortcut and will rewrite this. Thanks for pointing it out!

  1. Captures do seem to be part of the observation tensor already, but it seems to always be set to true. Isn't state.move_captured_ always true? It's set by move_captured_ = Board().at(move.from).color != Board().at(move.to).color, and since the color of the destination square is either the opponent or empty, it will always be unequal to the piece's color, no? If true, this could be fixed by using OppColor instead of !=

Indeed!

  1. illegal_move_attempted_ is in the public info tensor, but it doesn't seem like it should be common knowledge if my opponent attempted an illegal move (if things like failed pawn captures or forward moves are considered illegal moves)

True as well, just checked with the rules.

Seems like I did a portion of the code carelessly :-/ I'm a bit under a load of work and it shows.

I'll link a PR here when I get back to it, which might be in a week or two (conference deadlines). But feel free to post a PR yourself and I can have a look if you'd like the changes to be done faster.

@lanctot
Copy link
Collaborator

lanctot commented Sep 20, 2021

I believe this was fixed by #704. If there are any outstanding problems on this issue, please re-open.

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

No branches or pull requests

3 participants