Recommend
55 
 Thumb up
 Hide
24 Posts

Machi Koro» Forums » Strategy

Subject: Complete simulation of Machi Koro strategies rss

Your Tags: Add tags
Popular Tags: [View All]
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
After my wife got this game for Christmas we played a few games and we loved it. However, I felt a couple combos seemed far better than others. I then came to the BGG forums and found that there is already a lot of discussion about this, with at least 5 "broken" strategies posted in the Strategy section. I figured that most were runs of good/bad luck, and would smooth out given enough games.

So I created a Machi Koro simulator that would pit 8 different strategies against each other in all combinations of 2, 3, and 4 player games. Each of these matchups would play 100,000 games with a randomized start player each game. I then tabulated this data into an Excel spreadsheet, which is linked at the end of this post.

The Contenders:
Name: Cheese Factory
BGG Discussion: http://boardgamegeek.com/thread/1291410/machi-koro-unbalance...
Dice: 2 Dice
Desired Quantities:
Ranch = 6
Cheese Factory = 2

Name: Convenience Store
BGG Discussion: http://boardgamegeek.com/thread/1263225/convenience-store-br...
Dice: 1 Die
Desired Quantities:
Convenience Store = 6
Bakery = 3

Name: One Die Spread
(Control Group)
Dice: 1 Die
Desired Quantities:
Wheat Field = 2
Ranch = 2
Bakery = 2
Forest = 1
Convenience Store = 2
Cafe = 2
Family Restaurant = 1
Stadium = 1

Name: Bakery
BGG Discussion: http://boardgamegeek.com/thread/1263080/are-we-missing-somet...
Dice: 1 Die
Desired Quantities:
Bakery = 6

Name: Furniture Factory
(My wife's strategy)
Dice: 2 Dice
Desired Quantities:
Forest = 3
Mine = 3
Furniture Factory = 2

Name: Fruit & Vegetable Market
BGG Discussion: http://boardgamegeek.com/thread/1157685/fruit-veg-blowout
Dice: 2 Dice
Desired Quantities:
Wheat Field = 6
Fruit & Veg Market = 6

Name: Mine + Blue Spread
BGG Discussion: http://boardgamegeek.com/thread/1077293/mines-why-would-i-bu...
Dice: 2 Dice
Desired Quantities:
Wheat Field = 1
Ranch = 1
Forest = 1
Mine = 4
Apple Orchard = 1

Name: Blue 1 Die
(It seemed like a decent strategy to me)
Dice: 1 Die
Desired Quantities:
Wheat Field = 6
Ranch = 6
Forest = 1

The AI:
The AI is very simple:
1. Only roll two dice if it has cards that can reward that and it owns the Station.

2. If it owns the Radio Tower then it will reroll the dice if the first roll wouldn't give it any money.

3. It is given a list of desired quantities of each card (as seen above) when created, with the 4 win-condition cards always set to 1. It does not deviate from this while playing.

4. At the end of its turn the AI will go through the list of cards in reverse cost order (so most expensive to least expensive) and buy the first card it wants that it can afford that is still available. A couple exceptions: The Shopping Mall is considered first since it is integral to a few of these strategies; and if it already owns at least 1 of a card it wants but none of a cheaper card it also wants then it will buy the cheaper card to diversify early on.

The Results:
You can see the full results in the spreadsheet, but below are the conclusions I have drawn from the data:

* The Cheese Factory strategy is dominant in 2, 3, and 4 players. I assumed that this was because most strategies don't grab the Ranches away, but the strategies that do still lose overwhelmingly.

* The 1 Die Spread strategy gets better with each added player.

* For some reason the Fruit & Vegetable Market does really well with 2 players and then horrible with 3 or 4. I'm not sure why.

* Besides the above point, the Furniture Factory, Fruit & Vegetable Market, and Mines + Blue Spread strategies are just awful. In the One Die Spread vs. Mines + Blue Spread game, the Mines + Blue Spread won only 256 of 100,000 games, which is far less than 1%.

* Having 2 overlapping strategies at the table increases the chances of the third strategy winning (no surprise).

* I also created a genetic algorithm that would have a population of 100 randomly generated strategies that would slowly evolve to become better. Their fitness was determined by how well they did against the 8 original strategies, then the fittest strategies would breed and/or mutate to create new strategies. After doing this a few billion times the best strategy it came up with was the Cheese Factory strategy.

* Despite the Cheese Factory being the dominant strategy, it still only wins about half of its games overall, and wins less than three-fourths of its 2-player games. While no strategy can consistently beat it in 2-player games, it will still lose about a quarter of the time. In other words, no game is a lost cause.

My Overall Impressions of Machi Koro:
After reading this, you may think that I have no reason to play Machi Koro again since I have "solved" it. Instead, here are my impressions:

* This simulation did nothing to counter its opponents (except coincidentally wanting the same cards). This means that there are still decisions to be made in games between humans.

* No strategy will always win, and choosing wisely based on your opponents is key. This means there are decisions to be made in games between humans, again.

* Even the worst strategy will win if you are graced by the dice gods. I still have yet to effectively counter my wife's Furniture Factory strategy. Despite me warning her of the terrible ROI, I consistently roll 5's every turn while mumbling the probabilities of rolling this many 5's without a single 4.

* This data is only relevant for the base Machi Koro game, and only when playing without the 10 Card variant. These strategies are still just as potent in the 10 Card variant, but only if you can successfully find the cards you need without falling behind.

* A fun bit of trivia: in my original tests I forgot to randomize the start player, so each matchup would have the same start player in all 100,000 games. This consistently added a 1-2% boost to the win rate of the first player. While this is a statistically significant boost, I would not consider it significant enough to call it a "huge advantage" as was stated here: http://boardgamegeek.com/thread/1285474/does-starting-player...

* I still greatly enjoy playing this game. We now mostly play with the 10-card variant to add some variety, but we still enjoy the base game rules as well.

The Links:
The Excel Spreadsheet (Google Docs):
https://docs.google.com/spreadsheets/d/1sdBp44isSlEUe36Yl19K...

The C++ code (for anyone who wants it):
https://drive.google.com/file/d/0B0tn769LYQglS05VUzlZRHRPVzA...

It's pretty ugly, but I threw it together in about 30 minutes and it's moderately commented.
  • [+] Dice rolls
Mark Turner
United Kingdom
Farnham
Surrey
flag msg tools
badge
Avatar
mbmbmbmbmb
Thanks for this!

I haven't gone through your code, but strikes me that this is an entirely plausible and pretty impressive first stab at crunching the numbers. One question is whether you have suffiently accounted for the greater flexibility offered by the one die strategy. One of its strengths, I feel, is that there are several ways to make it work: ie, the essence is the 'one die', rather than any specific cards, whereas with cheese factory etc you have a fairly fixed goal.

I also suspect the ten card variant - while far from perfect - does mix things up quite a bit, and offers more scope for hedging strategies.

What your work does strongly suggest, however, is what we all suspected: that all strategies are far from equal, and that there are one or two overwhelmingly dominant set-ups. The game then becomes more of a race to get as many of those cards and then hedge with the limited cards on offer. Once everyone cops to the dominant strategies, there is a lot of blind luck here.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
woosh ito
Brazil
flag msg tools
badge
Avatar
mbmbmbmbmb
Do you wanna be my new best friend?
7 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
United States
Farmington
Arkansas
flag msg tools
Hobby aquariums are just like board games: except wet, fishy, and you can't play them.
badge
Avatar
mbmbmbmbmb
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
You're the third person to compare me to Rain Man today. Speaking of which...

woosh_ito wrote:
Do you wanna be my new best friend?

You'll have to kill my current best friend first. I'll GeekMail you the details.
19 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Neil Christiansen
United States
Mount Pleasant
Michigan
flag msg tools
badge
OOK! OOK! OOK!
Avatar
mbmbmbmbmb
Do people really play open access to all cards anymore?

After playing the 10/9/8 card access for 4/3/2 players, we never looked back. Not even for teaching games.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Oliver Paul
Iceland
Reykjavik
None
flag msg tools
Avatar
mbmbmbmbmb
chris1nd wrote:
Do people really play open access to all cards anymore?

After playing the 10/9/8 card access for 4/3/2 players, we never looked back. Not even for teaching games.


I do. Granted, I don't have the expansion yet, but I tried the random card variant a few times, I thought it worked very poorly, as the tableau got clogged up with a bunch of high cards, which nobody wanted early in the game.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Gillum the Stoor
msg tools
Avatar
mbmbmbmbmb
I'm not sure if I understand your Excel completely, but it looks like the Convenience Store strategy did reasonably well (especially with 2-3 players), but you don't mention it at all in your "Results" section.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
You're understanding it correctly. The Convenience Store strategy did pretty well overall, as did a couple other strategies. I just pointed out the most extreme results in this thread. I pointed out the Cheese Factory strategy because it did extremely well across all categories, but that's not to say that it's the best strategy.

You have to decide which is more important: winning matchups or win percentages, as they often differ. You can see this between the Cheese Factory and the Convenience Store strategies. The Cheese Factory has a perfect 100% for 2-player matchups, but has a lower overall win percentage than the Convenience Store. That's because the Convenience Store wins by a larger margin in the matchups where it does win. Deciding which one is better in 2 player games isn't nearly as easy as 3-player games, where the Cheese Factory pulls out ahead by a significant margin in both categories.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matt Crawford
United States
Pacifica
California
flag msg tools
Avatar
mbmbmbmbmb
This is awesome, thanks for all the work.

So the next question I would have is, if everyone knows the Cheese Factory is the best strategy, what strategy beats it? That is, if you run simulations where 3 players are using Cheese Factory, and the 4th player is using something else, what are the results?

Two interesting questions there:
(a) does it hurt a strategy if too many people are using it, and you can't get the buildings you need?
(b) if people are fighting for the Cheese Factory strategy, what's the best counter?

I understand we'll never answer the questions exhaustively with a simple simulation, but it's still interesting to think about and see the results.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Clyde W
United States
Washington
Dist of Columbia
flag msg tools
Red Team
badge
#YOLO
Avatar
mbmbmbmbmb
gatchaman wrote:
This is awesome, thanks for all the work.

So the next question I would have is, if everyone knows the Cheese Factory is the best strategy, what strategy beats it? That is, if you run simulations where 3 players are using Cheese Factory, and the 4th player is using something else, what are the results?
A valid question, but, seriously, people play this game with 3 or 4 players? Downtime man! It'll kill ya. Best With 2 for sure.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
I find that this game is interactive and simple enough that the downtime isn't an issue with our 3-player group. We have yet to try 4 players, though.

I just tried your scenario, Matt, and tested each non-Cheese Factory strategy against 3 Cheese Factory opponents. Here's the data:

Convenience Store: 55650
Cheese Factory: 15459
Cheese Factory: 14472
Cheese Factory: 14419

1 Die Spread: 69128
Cheese Factory: 10617
Cheese Factory: 10264
Cheese Factory: 9991

Bakery: 54719
Cheese Factory: 15614
Cheese Factory: 14912
Cheese Factory: 14755

Furniture Factory: 23981
Cheese Factory: 26483
Cheese Factory: 25160
Cheese Factory: 24376

Fruit & Veg Market: 30225
Cheese Factory: 24401
Cheese Factory: 23035
Cheese Factory: 22339

Mines + Blue Spread: 64655
Cheese Factory: 12186
Cheese Factory: 11987
Cheese Factory: 11172

Blue 1 die: 22000
Cheese Factory: 27728
Cheese Factory: 26482
Cheese Factory: 23790

Only the Furniture Factory and Blue 1 Die still lose to the Cheese Factory consistently. I suspect this is because the Blue 1 Die strategy doesn't get any of the Ranches it wanted, yet keeps rolling 2's that feed the other players. I suspect the Furniture Factory just kept losing because it's awful.

Here's the data for 3 players:
Convenience Store: 45782
Cheese Factory: 27845
Cheese Factory: 26373

1 Die Spread: 45097
Cheese Factory: 28889
Cheese Factory: 26014

Bakery: 44924
Cheese Factory: 28304
Cheese Factory: 26772

Furniture Factory: 13078
Cheese Factory: 44532
Cheese Factory: 42390

Fruit & Veg Market: 26113
Cheese Factory: 37817
Cheese Factory: 36070

Mines + Blue Spread: 33967
Cheese Factory: 34848
Cheese Factory: 31185

Blue 1 die: 12731
Cheese Factory: 47175
Cheese Factory: 40094

A similar story is told, except the games are much closer, with the Cheese Factory winning a couple more matchups. So clearly the Cheese Factory strategy will start to break down if the Ranches get grabbed up, but you still need to play a decent strategy yourself if you want to win. Apparently the One Die Spread is the way to go in this case.
7 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Matt Crawford
United States
Pacifica
California
flag msg tools
Avatar
mbmbmbmbmb
Cool, thanks for running that! So if what you want is getting snatched up, you really need to switch strategies. That's good.

Re: downtime, I honestly couldn't tell if clydeiii was kidding or not. :-) Turns are like 10 seconds long in this game, and you collect on other people's turns anyway. Plus the majority of people who voted say that the game is best with 4 players, whereas 2 players is not even recommended by a lot of people.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Neil Christiansen
United States
Mount Pleasant
Michigan
flag msg tools
badge
OOK! OOK! OOK!
Avatar
mbmbmbmbmb
Downtime? There is very little downtime with 4 players. YMMV.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Leon Z.
United States
California
flag msg tools
badge
Avatar
mbmbmbmbmb
If I read this right, the AI only buys cards that fit into the strategy card list? Is that how people actually play?

The optimal cheese factory strategy would almost never happen in real life; ranch being a good early game card even if you don't plan on buying cheese factory down the line.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ben Parker
Australia
Elanora Heights
NSW
flag msg tools
badge
Avatar
mbmbmbmbmb
I prefer the gameplay to settlers, for example, but I think it needs an expansion badly (not out in Australia yet) and some form of randomising that doesn't break the game. Has anyone else tried the expansion's setup rules on the base game? Does it break it? You know, dealing random cards out till you get to a certain number and that's how many of those cards are available to buy.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
ryocho wrote:
If I read this right, the AI only buys cards that fit into the strategy card list? Is that how people actually play?


I would hope that more experienced players don't play like that unless they are experimenting with a new strategy. I feel there are a lot of decisions to be made in this game outside of your main source of income. If you play multiplayer solitaire like the bots did here then it's not going to be as interesting of a game.

On the other hand, this was just a test to gauge the effectiveness of these strategies against each other. I could add some logic to buy up the buildings your opponent seems to be focusing on, but after a while it'd be hard to determine if that player won because their strategy was good or the opponents just got disrupted. I am open to ideas if you have any.

For the Cheese Factory strategy I turned on some debugging data and took a look at the final building counts. The Cheese Factory strategy seemed to only need 3 Ranches to win. If it couldn't get 3 then it wasn't nearly as dominant, although it would still win sometimes.

bygberbrown wrote:
I prefer the gameplay to settlers, for example, but I think it needs an expansion badly (not out in Australia yet) and some form of randomising that doesn't break the game. Has anyone else tried the expansion's setup rules on the base game? Does it break it? You know, dealing random cards out till you get to a certain number and that's how many of those cards are available to buy.


We just got the expansion a couple days ago and it definitely changes how the game is played. You can still sit with a single die strategy if you want, but it's a lot harder to win with now. There is a lot more interaction as well. Even without it I definitely prefer Machi Koro to Settlers as well, but I can see why others might prefer Settlers.

Before that we used the 10 pile rule with just the base game. The only issue we ever had was that sometimes we would get a flop of all two-dice cards, which made the beginning very slow. I recommend the variant somebody posted of using X wheat fields and bakeries as 2 of the piles, with X being the number of players. That still gives you options no matter what the flop is. I highly recommend trying it.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Leon Z.
United States
California
flag msg tools
badge
Avatar
mbmbmbmbmb
Flamer Shaftglutton wrote:
I could add some logic to buy up the buildings your opponent seems to be focusing on, but after a while it'd be hard to determine if that player won because their strategy was good or the opponents just got disrupted. I am open to ideas if you have any.


Anyway, I really appreciate your work with this. And feel free to disregard everything below since it's almost pointless to talk about the original rules when almost everyone plays the 10 card variant.

As you mentioned, the simulation is biased for the Cheese Factory strategy because it doesn't have to share ranches with other strategies. I think if you were to implement some counters to the AI you would get very different results.

A easy way to implement that would be to add a 2nd buy list, the list is generated by
- every time a player buys 2 of the same card, that card is added to all other players' 2nd buy list. (players learning others' strategies as the game goes on)

or

- all cards from other strategy in this game is added to the 2nd buy list when the game begins (players already know about others' strategy)

Also I would suggest checking for scarcity as well as cost when going through the buy list (buying that last ranch is probably more important than getting the 1st cheese factory)
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Travis Archer
United States
Madison
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
Now that I've got the basic data I was looking for, I'm going to try implementing some of these ideas to make a more robust AI. All cards will still have a weight, but I'll add a system where the weights change throughout the game based on how many of that card has been bought (and conversely, how many are left).

The trick is that I'm going to have to give each player a number T that describes how much of their decision is based on cutting other people off. At T=100% they will cut off every opponent at every chance, ignoring their own strategy most of the time, and at T=0% they will completely ignore everyone else (which is how they operate now). Getting that number just right will be important, but I think it can be done. I'd be interested to see if different strategies have different optimal T values.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Sias Mey
msg tools
mbmbmbmb
I am a little sad to see a game I enjoy reduced to a bunch of numbers like this :-P.

Then again, I would hope that the designers did a similar test suite during development and didnt just rely on human testers to balance the cards.

Its always important in a card game to have some cards that are better than others to create some tension about which cards to go for.

If it was all 100% balanced and 2,7 had a 50/50 chance against 5,8,9 it would be a completely solitaire game. The fact that 2,7 is slightly dominant means everybody tries for or tries to prevent that dominance.

Looking forward to what your AI's find. Would also be quite interested to see if a different RNG for your dice finds a different result. Just because I know the lengths Casinos and Gaming sites go through to get a RNG that works for them.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ben Parker
Australia
Elanora Heights
NSW
flag msg tools
badge
Avatar
mbmbmbmbmb
ChioZA wrote:
I am a little sad to see a game I enjoy reduced to a bunch of numbers like this :-P.

Then again, I would hope that the designers did a similar test suite during development and didnt just rely on human testers to balance the cards.

Its always important in a card game to have some cards that are better than others to create some tension about which cards to go for.

If it was all 100% balanced and 2,7 had a 50/50 chance against 5,8,9 it would be a completely solitaire game. The fact that 2,7 is slightly dominant means everybody tries for or tries to prevent that dominance.

Looking forward to what your AI's find. Would also be quite interested to see if a different RNG for your dice finds a different result. Just because I know the lengths Casinos and Gaming sites go through to get a RNG that works for them.


I think these numbers may have something to do with how quickly I got sick of it, though. I tended to use the single-die spread strategy, and got really stuck in my ways whenever the card pool is exactly the same like this.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Sias Mey
msg tools
mbmbmbmb
Maybe, this game very quickly developed into an "activity" for me, rather than a deeply involved thinking game.

But, thats what I believe it was supposed to be. Its a light game which is easy to teach and fairly easy to disect. So even first time players have a decent chance to get thinking on it very quickly.

No, I dont play game after game against my girlfriend, but... as a first game the the evening. I love it.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Dan Gallagher
Canada
Peterborough
Ontario
flag msg tools
mbmbmbmbmb
Convenience Store>Shopping Mall Rush>Bakery and Café off-buys in to core development rush is VERY hard to beat in 2 player.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Kaitlyn Smith
United States
Florida
flag msg tools
Avatar
mbmbmbmbmb
clydeiii wrote:
gatchaman wrote:
This is awesome, thanks for all the work.

So the next question I would have is, if everyone knows the Cheese Factory is the best strategy, what strategy beats it? That is, if you run simulations where 3 players are using Cheese Factory, and the 4th player is using something else, what are the results?
A valid question, but, seriously, people play this game with 3 or 4 players? Downtime man! It'll kill ya. Best With 2 for sure.



You can use the downtime to consider who the spies are in your BGG Avalon game. I'll help you out, it's never Kaitlyn.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls