datamllab / rlcard

Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
http://www.rlcard.org
MIT License
2.91k stars 628 forks source link

Is it possible to implement a Game, where the state,action space of each player is different? #252

Open IndianBoy42 opened 2 years ago

IndianBoy42 commented 2 years ago

For a course project I am trying to implement Reinforcement Learning to play Dungeon Mayhem.

It is a multiplayer strategy card game where each player has a different deck with different cards (and thus different possible actions)

This differs from most card games, and all the games that you have implemented.

Do you think your framework would able to handle this kind of a game? If so, can you give me any pointers about doing so?

daochenzha commented 2 years ago

@IndianBoy42 It is possible. We do not have restriction on the state or action spaces for all the players. You can just implement the state and action spaces for different players. The closest example I have in mind is DouDizhu, which shares the same deck but the hand cards are different. Thus, the possible actions are also different for different players. You can take a look at here https://github.com/datamllab/rlcard/blob/master/rlcard/envs/doudizhu.py#L23-L24 where we define different state and action spaces for different players.

IndianBoy42 commented 2 years ago

How do I make sure a different model is used for each role in my game? I don't want to try train a single super model that can play as any character, at least for now

daochenzha commented 2 years ago

@IndianBoy42 Sorry for the late reply. This can be easily achieved. You can still refer to example of DouDizhu. For example, in https://github.com/datamllab/rlcard/blob/master/rlcard/agents/dmc_agent/utils.py#L86 we can set different agents in the environments. Each agent will correspond to different agents.