davidADSP / SIMPLE

Selfplay In MultiPlayer Environments
GNU General Public License v3.0
297 stars 103 forks source link

Feature request: Implement chess and an user interface for it using SIMPLE #4

Open ghost opened 3 years ago

ghost commented 3 years ago

Hi David, i'm new to data sciene and also to Python. I find SIMPLE amazing. Can you please extend SIMPLE with chess please? It would be awesome if you can provide an user interface for it also. Thanks.

davidADSP commented 3 years ago

Hi - thanks I'll bear that in mind. Chess would be an interesting one to include for sure, though there will certainly be other implementations out there (e.g. LeelaZero) that are better suited to training a state of the art chess engine for sure. SIMPLE is designed to be very generally applicable to multiplayer games, but agree that it would be an interesting exercise to implement chess and see how it does.

ltnKoen commented 2 years ago

Am I right to understand that the action space when implementing a new environment has to be a discrete space of the form {0, 1, ..., N-1} where N is the number of possible moves, and cannot be a more structured space?

For instance, to implement chess, a possible choice for the action space is the set of quadruplets (x1,y1,x2,y2) where (x1,y1) represents the starting square and (x2,y2) the end square. Is there a better way to represent this space than self.action_space = gym.spaces.Discrete(8 * 8 * 8 * 8) in the Env class?

kambielawski commented 2 years ago

Am I right to understand that the action space when implementing a new environment has to be a discrete space of the form {0, 1, ..., N-1} where N is the number of possible moves, and cannot be a more structured space?

For instance, to implement chess, a possible choice for the action space is the set of quadruplets (x1,y1,x2,y2) where (x1,y1) represents the starting square and (x2,y2) the end square. Is there a better way to represent this space than self.action_space = gym.spaces.Discrete(8 * 8 * 8 * 8) in the Env class?

I'd love a response to this as well. I'm trying to create a self-play RL model for the game Blokus and I'm struggling to see how I might encode the relatively large action space.

AndreThompson-Atlow commented 1 year ago

There are already libraries for getting possible moves in chess and evaluating moves, so it might not actually be too difficult to do this.