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 repetition draws? #695

Closed
VitamintK opened this issue Aug 18, 2021 · 6 comments
Closed

rbc repetition draws? #695

VitamintK opened this issue Aug 18, 2021 · 6 comments
Assignees

Comments

@VitamintK
Copy link
Contributor

VitamintK commented Aug 18, 2021

The rules for recon blind chess here state that "all rules associated with stalemates or automatic draw conditions are eliminated."

The OpenSpiel implementation doesn't currently match:

>>> game = pyspiel.load_game('rbc')
>>> game.new_initial_state().child(0).child(0).child(0).child(0).child(0).child(0).child(0).child(0).is_terminal()
True

Should this be changed, or does the implementation intentionally differ?

@VitamintK VitamintK changed the title rbc draws? rbc repetition draws? Aug 18, 2021
@lanctot
Copy link
Collaborator

lanctot commented Aug 18, 2021

Hi @michalsustr, can you take a look?

@michalsustr
Copy link
Collaborator

Ah, I was basing the implementation on these rules which are slightly different. I will take a closer look at the differences. Regarding the automatic draw specifically, I think it's preferrable to make sure the game is finite and terminates after some number of (possibly nonsensical) moves.

@VitamintK
Copy link
Contributor Author

VitamintK commented Aug 18, 2021

Regarding the automatic draw specifically, I think it's preferrable to make sure the game is finite and terminates after some number of (possibly nonsensical) moves.

That sounds reasonable to me -- would it be worth it to add the automatic draw thresholds as parameters to the game?

Also-- unrelated, but I just noticed: the rbc rules from jhuapl also say that "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 tensor and observation string code in open_spiel, I couldn't find this in there. Is this missing?

@VitamintK
Copy link
Contributor Author

VitamintK commented Aug 19, 2021

Ah, now I see that captures are in WritePublicInfoTensor, so they are in the observation tensors at least.

I do have some other questions though:

1. For the capture in the public info tensor, 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 !=
2. 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)

(spun the observation stuff into its own issue: #696 )

@michalsustr
Copy link
Collaborator

Would it be worth it to add the automatic draw thresholds as parameters to the game?

Right now the draws are controlled via kNumRepetitionsToDraw constant, when the board hashvalue occurs more than 3 (kNumRepetitionsToDraw) times. https://github.com/deepmind/open_spiel/blob/master/open_spiel/games/rbc.cc#L419
I think this is a reasonable default, but if you have a particular use-case in mind when you'd need to change that feel free to make a PR, I can make a review for it.

Thanks for pointing out these issues!

@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.

@lanctot lanctot closed this as completed Sep 20, 2021
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