St Petersburg Board Game Simulator

I like board games. A lot. My friends and I have been playing board games together pretty regularly for about 5 years, and we've tried quite a few. One of the games we played was Saint Petersburg. This game consists of acquiring cards of different categories from a common pool, earning income and points using those cards, with the goal of maximizing the total number of points by the end of the game. The official rules can be found here [PDF].

This board game would be pretty easy to analyze, I thought, because it doesn't have a lot of randomness (only the token distribution and the shuffling of the decks at the beginning of the game). Of course, I quickly found the state size to be too large to analyze, but that didn't stop me from writing an AI for it.

The AI idea is really basic: just BFS and a state evaluation function based on points and money. The AI doesn't cheat (peak at the next unrevealed cards) but it does take into account changing turns. This AI has lots of problems, but provides a good benchmark for new strategies for an inexperienced player.

I thought about different ways that I could improve the AI. Some obvious approaches:

  1. Encode my current strategy into the AI and try to beat that manually. Rinse and repeat.
  2. Perform a series of BFS searches while cheating (looking at the deck configuration), but instead of looking at the real deck configuration, get the remaining cards and create a few possible deck configurations
  3. Estimate the next cards based on a probability distribution and assign scores appropriately

I think all of these are reasonable, but they're a lot of work. Instead, I decided to do something else.

My plan is to collect traces from a bunch of real games, and train a neural net over that data. I have some ideas about how to encode the moves in a given state as feature vectors, hopefully it'll work. I have no reason to think this approach will be any good. But it's at least interesting, and different from anything I've done before.

Therefore, here's what I want help with: play the game against the current AI. Try to beat it. And know that the game history is being uploaded to my server to make the AI better. You can find the game here. Have fun!

Caveats

  • The current UI probably won't work on phones because there are a lot of visual elements to fit on the screen.
  • Depending on your screen size, you may have to zoom out towards the end of the game so that everything fits on the screen.
  • The Pub card currently doesn't work in my simulation. Let me know if this is a problem for you (if you have a strategy that uses it) and I will try to fix that.
  • If you encounter any bugs or UI problems, tweet at me.

Strategies & Hints

If you're just starting out, consider these strategies. However, I encourage you to experiment with the game and try to come up with something new and better.

  1. You can make the game last longer or shorter by being strategic about how many cards are bought during a given round. I find that building cards tend to run out first because the workers are usually bought up almost completely each round. If you want the game to last less, try to get a lot of buildings to be dealt each round. If you want the game to last longer, try to keep the too many building cards dealt towards the end of the game (this may result in some financial loss)
  2. Don't forget that the aristocrat end-of-game bonuses are massive as you climb the scale towards 8-10 aristocrats.
  3. You can upgrade the Warehouse at the end of the game when you no longer need it to earn a few extra points

My record for most number of points during a game against the AI is 98. See if you can beat me. Tweet at me with a screenshot if you did.

Data Collection & Retention

I only collect game traces associated with a random game ID. I will not store your name, information about your browser, or any other personal information. I value your privacy. The game trace data may be released at a later date to the public as a research dataset.