House Fish Balloon
  • Games
    • 1961
    • 1971
    • Trickdraw
  • Coming Soon
    • Friends Collection
    • Fashion Cents
    • Borbs
  • Blog
    • The World of Saloondria
    • HFB Tales Archive
    • Behind the Games
  • Shop
  • & | More
    • About Us
    • Contact
    • Press Resources

Behind the Games

How to Win Machi Koro, using Machine Learning

8/7/2022

0 Comments

 
by Michael Kuroda
Picture
  • What is Machi Koro?
  • What am I doing?
  • The Setup
  • AI Strategy
  • Initial Results
  • Best Strategy based on Win Time
  • Best Strategy based on 1v1 Matches
  • 2 Player Results
  • As for Adaptability
  • How to Win at Machi Koro

TL;DR

Just want to read a summary? That's cool too! I ran a Python algorithm and found that four strategies outperform everything else. And those are Cheese Factory, Bakery, Convenience Store, and One-Die-Spread. Scroll down to two Player Results to see how they win against each other and when to use them.

What is Machi Koro?

Picture
Machi Koro is a fast-paced game for 2-4 players. Each player wants to develop the city on their own terms in order to complete all of the landmarks under construction faster than their rivals. On their turn, each player rolls one or two dice. If the sum of the dice rolled matches the number of a building that a player owns, they get the effect of that building; in some cases opponents will also benefit from your dice (just as you can benefit from theirs). Then, with money in hand a player can build a landmark or a new building, ideally adding to the wealth of their city on future turns. The first player to construct all of their landmarks wins!

What am I doing?

Ever since playing this game for the first time, I realized that this is not at all a balanced game. Expecting to progress from a simple one-die early game to a two-die mid game with reasonably balanced mid-game industries, then to a late game of grabbing up Stadiums and finally the sought-after Landmark cards, I was quickly struck down from that expectation. One player bought 6 Cheese Factories in the first 6 turns, 2 Ranches, and a Train Station in the next few turns, and nothing after that. While I was busy grabbing my Mines and Business Centers, the player rolled a 7. They received 36 coins in one turn. Then they rolled a 7 again, and received another 36 coins. Without even worrying about late game industries, they simply bought all four landmark cards at their leisure. All because they owned two secondary industry cards.
So, after being inspired by a post on BoardGameGeek, I decided to run my own tests on the game. After all, user Travis Archer suggests that Cheese Factory wins nearly 75% of all 2 person games, and almost 50% of all 4 person games, making it severely overpowered. Is Cheese Factory really that powerful? Or was I unlucky in my first playthrough? I decided to run my own code to test it out.

The Setup

First of all, I sought to replicate Archer's results in my own Monte Carlo Algorithm. This required the inputting of each major strategy and each card. Here are the following strategies:
View my Code on Github
Note: I also included a Genetic Algorithm section. I was incapable of getting any reasonable results (nothing could beat Cheese Factory even 10% of the time after several hours of running the program). As a result, I will not discuss it in this post.
Picture
Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be deterministic in principle. 
  • One Die Spread: Focused on adaptability over everything, this strategy buys just  few of each base card, and tries to win the game by making a little money each turn.
  • Convenience Store: Focusing on the Shopping Mall, the Convenience Store strategy gets 1 additional coin for every one of its establishments.
  • Furniture Factory: Focuses on maximizing the lesser-used Furniture Factory Card. 
  • Fruit and Vegetable Market: Focuses on maximizing the Fruit and vegetable market. A low cost card with a low roll chance, but a high payout if landed. 
  • Mine Spread: Why receive points on your turn only? The mine spread loves it when anyone rolls all sorts of numbrs.
  • Nothing Strategy: Screw playing the game, this player just saves up for his Radio Tower, Train Station, Shopping Mall, and Amusement Park.
  • Cheese Factory: The infamous 75% win rate strategy. Makes a ton of money on the most likely roll. 
Meet the Contenders:

AI Strategy

I made a few deviations from Archer's Code. Most notably, I changed the buying algorithm pretty severely. Rather than purchase the most valuable card a person can purchase, my AI purchases each card in order of desirability. In other words, it needs to buy the popular cards first, otherwise it may end up dead in the water with only its now-useless secondary industries. In other other words, I have a list of things, and the AI buys each thing in the order of the list, unless the card is unavailable or if it cannot afford the card.
Each player has a value list made up of two sections; on their roll, and on other player's roll. If Player A purchases a Wheat field, they will receive 1 value at 1 their roll, and 1 other player's roll. If Player B purchases a Cafe, they will receive 1 on other player's 3 roll, and everyone else will lose 1 on their 3 roll. ​
Once buying could be solved, the rest of the algorithm is very straightforward. The computer rolls a dice, and doles out money depending on what values each player has on that number.  We just need to simulate this about 80 times per player, until the game ends, and over the course of 10,000 games. With a running tally of who wins and when they win, we can find our Results.

Initial Results (Beating random strategies)

First of all, I had to replicate Archer's results myself. This was surprisingly easy, as it just required fixing all of the bugs in my code* and putting together a single algorithm. Playing against random strategies, the Cheese Factory performed very well. Note: As my algorithm runs a bit differently, I was able to focus my one die strategy on buying Ranches first, or buying Bakeries first. This has a non zero impact on its win rate. Although its not significant enough for me to continuously adjust it throughout the following steps.

*Exaggeration, fixing bugs is never easy.
Picture
Picture
But this is not a very realistic game state, unfortunately. This blog post is about Winning Machi Koro more consistently, not beating up some low performing strategies. If you want to beat the Fruit and Vegetable Market, for example, you can use almost anything. 

Best Strategy Based on Win Time

Picture
This box and whiskers plot shows how long it takes various strategies to win the game. The AI they play against is randomly generated and is incapable of winning the game. Initial tests saw heavy selection bias, as it would only show the winning version of each strategy's times. Meanwhile, having no opponent would leave strategies that rely on card stealing, or opponent rolls would be left useless.
in this plot, we can see which strategies perform best given no competition. In theory, you should always play the Bakery strategy if nobody else is buying bakeries. Ranch is a very close second. Both of them will collapse if the other players decide to purchase 3-4 Bakeries or Ranches, however.

Best Strategy based on 1v1 matchups

Picture
Pitting strategies against each other in 1v1 matchups yields some different results. Based entirely on how often a strategy wins a matchup, the Convenience Store strategy suddenly pulls ahead. This strategy relies a little bit on the Bakery, but it also uses the rarely used Convenience Store to boost its revenue with the Shopping Mall. This strategy is extremely strong in 1v1 matches, and only regularly loses to an unopposed Cheese Factory. Meanwhile the One Die Spread is a interesting contender here. Its strategy never gets destroyed, but it doesnt purchase enough key industries to destroy the other power strategies.
Picture
Illustrated version of the chart above. Each building's opacity is equal to its win% over the other strategy. (50%-100%) As I tested two One-Die-Spreads, I had two different results on only the Cheese Factory/One-Die-Spread Matchup.

2 Player Results

Picture
With two players in the game, no strategy of the three major strategies wins consistently. However, all three of them outperform everything else aside from the One-Die-Spread. 
The Cheese Factory strategy is the second fastest and regularly beats anything that diversifies. But Cheese Factory is extremely RNG focused, and will lose to the more consistent Bakery 53-60% of the time. And the Bakery can easily be destroyed by any strategy that takes up its precious bakeries, such as the Convenience Store, about 60-65% of the time. Cheese Factory beats the Convenience store around 60% of the time.

As for Adaptability

The most concerning results of the previous sections is that there is no easy way to beat the three major strategies in a 1v1 matchup. A one die spread can sometimes outperform the Cheese Factory and Bakery strategies, but even buying two of a strategy's main card is not certainly going to stop them. You can buy more than that, but then you will eventually be playing the same strategy as they are. And if you do attempt to play the more adaptable One-Die-Spread, you can still get squashed by the Convenience Store strategy.
Picture
This is where multiple players come into play. While a One-Die-Spread is the worst of the major strategies in a 2 person game, it actually gets significantly better once the other strategies are pitted against each other. Two Cheese Factory players will make each other irrelevant. Two bakeries have the same effect. Even the Convenience store gets destroyed when its key cards are lost. The One-Die-Spread does not suffer from this problem at all. As long as you are focusing on a group of different strategies with more players, you can actually pull ahead of most.
Picture

How to Win Machi Koro

Picture
Picture
Picture
Picture
To consistently win at Machi Koro, just keep the three major strategies in mind. If you are in a two player game, just play the winning strategy against the person who starts going for another strategy. Stealing their cards doesn't usually work unless you take half of the available pile, at which point you might as well follow the same strategy. 

However, with three or more players, keep your options open and go for a strategy if you can. If nobody is taking ranches, destroy them all with the Cheese Factory. If nobody is taking Bakeries, then beeline victory with the Bakery. And if nobody is taking wheat fields, do not for the love of God buy the Fruit and Vegetable market because that strategy is more of a lottery ticket than a real strategy. You can instead try the One-Die-Spread as a safe option against known strategy players.
0 Comments



Leave a Reply.

    Picture

    Archives

    March 2023
    September 2022
    August 2022
    July 2022
    June 2022
    December 2021

    Categories

    All
    Author: Blake Propach
    Author: Michael Kuroda
    Category: Game Design
    Category: Tutorial

    RSS Feed

the House
About Us
Our Friends
​
Work With Us​
the Fish
Behind the Games
HFB Tales Archive
Fish School Discord
the Balloons
1961: A Cold War Card Game
The World of Saloondria
& More
Contact
​Policies​
Retailer Resources
Press Resources

© 2023 House Fish Balloon, LLC.
info@housefishballoon.com
​Site powered by love.

Stay in touch!
  • Games
    • 1961
    • 1971
    • Trickdraw
  • Coming Soon
    • Friends Collection
    • Fashion Cents
    • Borbs
  • Blog
    • The World of Saloondria
    • HFB Tales Archive
    • Behind the Games
  • Shop
  • & | More
    • About Us
    • Contact
    • Press Resources