Guest Article: Annotated Game #1 Response Followup

The following guest article is written by Jeroen Aga (Geronimoo on Isotropic).

Last time I left you with the conclusion that combining Mountebank with Warehouse is superior to the combination with Caravan (but only by a very slim margin). Judging from the comments my readers are either very smart, very educated or very both, neither of which I am, so I’ll try to avoid drawing any conclusions and let you guys figure it out yourselves from my observations with the simulator. Here’s the second (and final?) part of my analysis of theory’s first annotated game:

Emulating real player’s strategies

I re-read theory’s game annotation and programmed the strategies I found into two (ro)bots. Here are the little fellows (aren’t they adorable?):

theory-bot

The theory bot emulates theory’s behavior in the annotated game and vice versa for the Yaron bot. I tried to get their behavior as close as possible to that of the real players.

Here are the bot’s buy rules. I didn’t include the other Kingdom cards like Secret Chamber and Harem to keep things simple. Their impact on this game seemed minor anyway. I’ve also omitted the play rules because they are almost trivial:

Buy Rules (theory-bot):
-buy a Province (if you’ve bought at least a Gold)
-buy a Duchy (if there are only 5 Provinces left)
-buy an Estate (if there are only 2 Provinces left)
-buy a City (if there are only 7 Cities left)
-buy a Mountebank (buy maximum 2)
-buy a Gold
-buy a Warehouse (if you’ve bought at least a Province)
-buy a Caravan (if you’ve bought at least Warehouse and Silver)
-buy a Warehouse (if you’ve bought at least a Silver)
-buy a Silver
-buy nothing

Remember these buy rules will be read by the simulator top-to-bottom and he will do the first thing he’s capable of and then stop reading; extra buys will make him repeat this process. Unless you’re thinking in zeroes and ones this is hard to read, so here’s what these buy rules come down to:

  • the theory-bot will open with Silver/Warehouse (Mountebank/nothing on $5/$2)
  • It will get Mountebank as soon as possible (over Gold).
  • After the first Warehouse it will buy Caravans over them
  • No more than one Silver will be bought
  • when he sees the Yaron-bot going for the Cities he jumps on them as well (like in the real game after Yaron has 3 of them).
  • Warehouses will be bought over Caravans as soon as the end game starts (when VP’s are being bought).

yaron-bot

Buy Rules (yaron-bot):
-buy a Province (if you’ve bought at least a Gold)
-buy a Duchy (if there are only 5 Provinces left)
-buy an Estate (if there are only 2 Provinces left)
-buy a Mountebank (buy maximum 1)
-buy a City
-buy a Gold
-buy a Warehouse (if you’ve bought at least a Province)
-buy a Caravan
-buy a Warehouse (if you’ve bought at least a Silver)
-buy a Silver
-buy nothing

In words:

  • the yaron-bot will open with Silver/Caravan (and Mountebank/nothing on $5/$2)
  • It will get one Mountebank as soon as possible (over Gold).
  • He then jumps on the Cities (over Golds)
  • Caravans will be bought over Warehouses
  • No more than one Silver will be bought
  • Warehouses will be bought over Caravans as soon as the end game starts

The difference comes down to the yaron-bot opening with Caravan/Silver instead of Warehouse/Silver and immediately jumping on the cities while the theory-bot starts buying Cities later. I think this emulates the actual game quite nicely.

Here’s the resulting clash (10,000 simulations):

The yaron-bot gets crushed! It seems to be stuck buying out the City pile while the theory-bot is already buying Provinces. Level 0 Cities are identical to Villages and don’t improve your buying power until they level up which explains the long flat line on yaron-bot’s graph. When the Cities get into first gear (one empty pile) the yaron-bot finally starts to outbuy the theory-bot, but it only profits from super-charged Cities for two turns before the game ends (mostly on piles).

Improving the bot’s strategies
Let’s play around with our bots a little. This is what happens when we let the theory-bot completely ignore the Cities:


As this graph shows and some posters speculated, theory shouldn’t have been afraid of yaron’s so-called City advantage and could have completely ignored the City pile.  By ignoring cities, his winning percentage increases from 70% to 89%.

When I helped out the poor yaron-bot by letting it buy Golds over Cities its win rate improved to 35% against theory’s Cityless strategy. So, still a big dog!

Answering our initial question

Finishing up, let’s make both strategies identical with one small difference: theory-bot uses his Warehouse/Silver opening and yaron-bot goes for Caravan/Silver. The rest of the buy rules are identical (so no more Cities since they are probably not part of a winning strategy):

As expected the Warehouse/Silver opening has a tiny edge over the Caravan/Silver opening in the complete strategy where players are buying a mix of Caravans, Warehouses and Mountebanks. This complete strategy has about a 20% edge over the Warehouse-only and Caravan-only Mountebank strategies from part I.

I’ll be “ready” for you to crush me on isotropic!

This entry was posted in Annotated Games, Guest Articles. Bookmark the permalink.

17 Responses to Guest Article: Annotated Game #1 Response Followup

  1. Bulb says:

    Great analysis! Can your next project be a website where users can submit their own bots to compete against yours?🙂

    • rrenaud says:

      That would be pretty cool.

    • Personman says:

      Maybe making a whole website is too much work, but what if this blog started holding a weekly competition? You post a spread, everyone emails you a set of buy rules, and then you run them all against each other pairwise and see who comes out on top!

      • Matthew Ryan says:

        This is a fantastic idea! We could all learn a lot from this. Reminds me of the “Tit-for-Tat” vs. other Prisoner’s Dilemma strategies in evolutionary simulation that Hofstadter wrote about in Metamagical Themes.

        I’d say the editor should feel free to aggregate similar entries into a single representative bot that in the editor’s judgment best represents that strategy.

      • theory says:

        This sounds very interesting. Thanks for the idea🙂

  2. timchen1017 says:

    A technical (but I-think-important) question about the last setup:
    When does the caravan-silver opener buy the first warehouse? It seems to me it only buys the warehouse when it has exactly $3 later in the game, which may not be the ideal play. How would the result change if we force the third buy at $3 or $4 a warehouse while opening with silver+caravan?

  3. guided says:

    My first thought when looking at the theory-bot buy rules was “What???? He should just ignore the Cities entirely!” So I’m glad you simulated that case too😉

    In 2p, letting your opponent unilaterally rush the City pile is a pretty sure path to victory in most cases. You only need to join the rush if (a) you really need the +2 actions, or (b) some other pile will be emptied quickly enough to allow the City player a comeback. It’s possible theory-bot could be improved by ignoring the Caravans as well, simply to avoid helping yaron-bot empty the pile.

  4. chesskidnate says:

    Just curious what happens if you change Yaron’s rules to getting a maximum of 3 mountebancs but after having two mountebancs grabs a city then a mountebanc. I was thinking this way you might get more use for the extra city actions(you might have to change the warehouse play slightly to allow it to keep only as many mountebancs as it can play) and would help to run out curses quicker

    • Paragon says:

      This.

      It is pretty clear that one person buying citys won’t empty the city pile fast enough. But will an extra mountebank or two in play empty the curse pile fast enough? I would lean toward buy two mountbanks then force citys because a 3rd mountbank might hinder your ability to hit $5 consistantly, but I could see “mountebank, mountebank, city, mountebank, city, city, etc” working as well as long as you draw your terminal actions reasonably.

    • guided says:

      Ah, yes, I hadn’t thought much yet about tweaking yaron-bot’s strategy, but if he’s buying Cities anyway he definitely wants multiple Mountebanks. Two Mountebanks is usually much better than one even if you DON’T have surplus actions to play multiples in one turn….

  5. RepGenie says:

    Great stuff, again. I have a couple questions. Is it general consensus that the end game starts once the first province is bought (assuming it’s a non-colony game)? And, related to that, is it a standard rule-of-thumb to start grabbing duchies with 5 provinces left? Assuming so, that points out a major flaw in my play (one of many, no doubt).

    • guided says:

      There’s no hard and fast rule about what constitutes the “endgame”, but loosely I would say your deck has entered the endgame once your focus shifts from primarily deck building to primarily VP scoring.

      In a 2p game, a decent rule of thumb for very simple treasure-based decks when both players are looking to score Provinces is to start buying Duchies over Golds once there are 5 Provinces left. This will not be sound strategy for every deck, and particularly not complex action-chaining decks with extra buys.

      In practice, “Duchy or some other card?” is rarely a simple question, and you should use your best judgment about whether it’s more important to get 3 VPs or to improve your deck.

  6. Charles says:

    I would recommend adding what delta-VP means to the graphs (change in VP per turn). I spent some time understanding how how the lower line in the first graph was winning by so much. Until of course I went back to the previous post that has the same style graphs, but have a note of that the axis means.

  7. Geronimoo says:

    So you guys want to play with my simulator? It seems I have a new challenging project on hands🙂

    So, what would you guys want? Would this be web-based or do you prefer a stand-alone application? What should the GUI (graphical user interface) look like? Do you want graphs or are winning percentages enough to start with? etc…

    This will take some time because I’ve only coded about 20 cards and there’s no possibility of user created buy rules yet so I’ll need to refactor quite a bit.

    The simulator is written in JAVA so if you have some experience in that area, you can join me on this project. Just get in touch with the administrator and he can forward you to me.

    • Paragon says:

      Yes we want to play!

      I’d rather see functionality and features over GUI and web interface. Focus on making it fully functional before you worry about the pretty stuff. 🙂

    • hoff says:

      I want you to let us submit an arbitrary buy strategy as a code snippet.🙂

  8. Mabopamz says:

    I think Cities are a viable strategy after all. Here’s a bot that beats the Mountebank/Warehouse bot (which I’ll call the “theory bot”) that comes with Geronimoo’s simulator 71% of the time:

    – Buy Mountebank (max 2)
    – Buy City
    – Buy Province
    – Buy Duchy (if 4 or fewer Provinces left)
    – Buy Estate (if 2 or fewer Provinces left)
    – Buy Caravan
    – Buy Warehouse if CountInDeck(Warehouse) < CountAllCardsInDeck/11
    – Buy Peddler
    – Buy Warehouse
    – Buy Silver

    Some thoughts on this bot:
    – If you're going for Cities ($5), the $2 from Mountebank and the $1 from the Coppers your opponent will be stuffing you with aren't bad. With Warehouse and Caravan sifting your deck and making your hands bigger _you don't need to buy any money_. This is a case in which the Copper from Mountebank seems to actually be helpful.
    – Not buying any money extends even to the opening! Open Warehouse/Caravan instead.
    – Don't get distracted by Provinces–you need to focus on making sure two piles run out, with one of them probably being Cities. Buy City instead of Province or Gold. Once you get your City engine going, you're going to get almost all of the remaining Provinces anyway.
    – Being able to buy a ton of Peddlers is an important advantage of having activated Cities. Without Peddlers, the City bot only wins 60% of the time.
    – The game is likely to go long enough to activate your Cities for several reasons: Curses and Coppers will slow your opponent down, the Curse pile will generally run out, and you're not helping end the game by buying any Provinces.

    However, this bot isn't as good as the 71% makes it seem. It can buy 9 Peddlers even if it's behind on points, and the theory bot will never buy the last Peddler to end the game (are there situations in which a simulator could easily detect that buying a certain card will win the game that turn, even if that's not what the bot's logic would otherwise do?). This turns out not to matter much. Making the City bot stop buying Peddlers once there are only 4 left doesn't change the results that significantly. But what does matter is that the Caravans will often run out, too. The theory bot will sometimes miss chances to buy the last Caravan and win instantly. More often it misses chances to win by buying the last City (once Curses and Caravans have already run out). Add logic to buy the last City to the theory bot, and then add some logic to defend against it into the City bot, and the City bot wins only 60% of the time.

    I'm not sure which strategy would win in the end. It's a complicated dance in which the City bot needs to ensure that two piles run out well before a third can be run out. To capture this well would require some pretty gnarly buy lists. There may also be a viable Duchy rush strategy against the City bot: if you can run out Duchies, Curses, and Caravans, you'll beat the City bot. This would also be a gnarly buy list.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s