google-deepmind / open_spiel

OpenSpiel is a collection of environments and algorithms for research in general reinforcement learning and search/planning in games.
Apache License 2.0
4.27k stars 937 forks source link

Orbital Velocity Board Game #101

Closed pratapram closed 5 years ago

pratapram commented 5 years ago

I am the creator of a new board game called "Orbital Velocity" (to be released in Dec 2019). It is a simple card game to help students learn, and in this finally learn MachineLearning.

I wonder if I could use OpenSpiel to build RL platform. I can contribute code related to that code. From what I understand, the existing OpenSpiel API is sufficient to build my game.

What is the best way to contribute my game to this repository.

lanctot commented 5 years ago

Hi @pratapram , that's very interesting! Thanks for your interest in OpenSpiel.

Reading the boardgamegeek description of the game, it sounds like quite an interesting game. It would be fun to do RL research on this game, and it would be great if OpenSpiel could help with that.

It's hard to say precisely without a full description of the rules, but if you think the OpenSpiel API is sufficient, then you can add an implementation by a Pull Request. As this might be a large implementation, I would recommend putting it in its own subdirectory games/orbital_velocity. There are step-by-step guidelines on how to implement a game here: https://github.com/deepmind/open_spiel/blob/master/docs/developer_guide.md . If it's an imperfect information game, then I would say you can start from Leduc poker. If you have any questions with any of the parts, feel free to ask (the basic simulation tests in the other games basically play uniformly random).

Once you have it implemented in the OpenSpiel API, there are a number of RL algorithms and techniques you could use to try to learn to play the game.

Just one other consideration: if/since this game is being published, then we might also need some form of permission from the publisher(s) to host an implementation of it in the code base.

pratapram commented 5 years ago

This game is an imperfect information game. I am the publisher of the game, and I will make the initial commit.

lanctot commented 5 years ago

Great! Do no hesitate to ask any questions if you need clarifications.

pratapram commented 5 years ago

Thanks!

Here are the simple rules:

Game type: sequential (non-simultaneous) Num of Players: 2 Deck: 54 cards (numbers 1-9, and "-" cards) in a specific distribution Deal: Each player gets 5 cards Rocket: There is 1 rocket (not 1 rocket per player) Each player plays a card to move the rocket (same rocket) and then takes a card. The player that moves the rocket to 39 (the target orbital velocity) wins the game.

Game ends if

  1. if rocket reaches 39
  2. if rockets goes past 39
  3. if deck runs out

Important clue: The even cards are colored white and odd cards are colored black. The color of the cards is visible to the opponents. The color of the opponents is crucial information required for dominant strategy.

Is "leduc poker" the best starting point to implement this?

lanctot commented 5 years ago

Sounds interesting!

Yes, Leduc is probably the best starting point, though it is a lot smaller/

if you anticipate using only RL methods for the learning part, you can implement the game using the kSampledStochastic chance mode, rather than kExplicit. You would need the explicit one if you plan to run any of the tabular solving algorithms like CFR, but sounds like your game will be too large for those anyway. This is the mode that Leduc (and most of our stochastic games) use. It treats each card flip as an explicit chance node and the card that flipped is the outcome of that chance node. E.g. you can have the chance nodes come up every time you need to flip a card, too, like after every action.

On the other hand, the sampled stochastic mode could have a single chance node at the top of the game with a single outcome, but the transition is non-deterministic (you can think of applying the chance move as shuffling the deck). You can look at games/negotiation for an example of a game that uses this kind of chance mode.

lanctot commented 5 years ago

Hi @pratapram , I'm closing this issue now but looking forward to the implementation! (Feel free to re-open if you have questions.)