So you’ve tried a few of the built-in strategies and let them battle each other. That’s cool and all, but the real fun starts when you create your own strategies or modify an existing one so it performs better. I’m going to show you now how to turn a weak bot into a fine tuned monster. Just follow my lead:

The Editor

First find a strategy you want to fine tune. Select the  Chancellor/Stash (under type Combo) for player 1 and Envoy for player 2 and let them battle each other (Accurate Simulation).

The combo of Chancellor and Stash apparantly can’t even beat a single Envoy. We’re going to try to fine tune the Chancellor bot so it beats Envoy. Click the Edit/Create button next to the Chancellor bot.

The first time you open the editor you might get a little disoriented, but it’s all very straightforward really. Let’s simplify things a little. Click the Toggle view of buy conditions. What you see now is a list of all the cards this bot “might” buy during a game.

All the likely candidates are present: Chancellor, Stash, Silver and Province. The simulator will use this buy list during a game to determine when to buy stuff. If a card is higher up in the buy list, it will be considered first as a possible purchase. What might be confusing at first is that a card like Estate is higher up than Gold. Does this mean the simulator will buy Estates over Gold even if it has $6 to spend? Yes! … And No! To see when exactly the bot will start to buy Estates over Golds you have to click the Toggle view of buy conditions button again.

The buy conditions have become visible again and you can see the simulator will start to buy Estates over Golds once the game is very close to over (when there are 2 or less Provinces left in the supply). Some cards don’t have any buy conditions (like Gold), but that doesn’t mean they will always be bought. There are some hidding buy conditions that I’ve programmed so you don’t have to:

  1. do I have enough money to buy this card
  2. is the card still in the supply
  3. won’t buying the card cause me to lose the game (also because of 3 empty piles)
  4. others (like preventing a Grand Market buy when you have played Coppers)

Changing the buy rules

Now you understand how the buy rules work, get to work modifying them! The best way to start is seeing how a bot actaully plays the game and finding flaws in its decisions. You do this by clicking the Sample Game button which will show a log of a random game played by the simulator. Here’s an example of one game that ended poorly for our bot:

Looking over the log the simulator quickly had $6 and bought a Gold and never really had $5 after that to buy Stashes. It wasn’t actually playing the combo, but just a Big Money strategy with 1 random Chancellor and it lost to the far superior Envoy. How can we ensure that our bot actually plays the combo?

Simple! We remove the Gold from our buy rules by clicking the red cross:

Save the strategy by clicking Save strategy as button and fire up the simulator again (Accurate). The result of this match should be even (46%-46%). Now we’re going to improve the bot further by playing around with the buy conditions.

Modifying Buy conditions

Let’s make the simulator buy more than 1 Chancellor. Open the editor again and find the buy rule for Chancellor and change it like this:

Buy Chancellor

if count in deck(Chancellor) < 3

Save and simulate again…. This will improve the results a little for our bot, but  not by as much as we expected. Let’s look into a Sample game:

So the bot opens Chancellor/Chancellor while we would probably rather see it open Chancellor/Silver to prevent the terminal actions from clashing in the early game. There are several ways to enforce this behavior in the editor. Let’s try it like this:

Use the Duplicate button and arrow buttons to create the new buy rules and move them into the correct position in the buy rule list (you can also use the Add a Buy rule button, but I find it more cumbersome). To add the buy conditions click the small “+” button. If you’ve made a mistake you can always delete lines by clicking the red cross or the rubbish bin.

Done? Ok, save your work and simulate again. Your bot will now always open Chancellor/Silver with a $4/$3 and beat Envoy around 50-41. Success!!!

You can tune your bot further using the multitude of buy conditions. Here’s my best performing Chancellor/Stash bot. Copy the following code and use the Copy/Paste button:

<player name="COMBO - Chancellor/Stash improved">
 <buy name="Province"/>
 <buy name="Duchy">
 <left type="countCardsInSupply" attribute="Province"/>
 <operator type="smallerOrEqualThan" />
 <right type="constant" attribute="5.0"/>
 <buy name="Estate">
 <left type="countCardsInSupply" attribute="Province"/>
 <operator type="smallerOrEqualThan" />
 <right type="constant" attribute="2.0"/>
 <buy name="Stash">
 <left type="countCardsInDeck" attribute="Stash"/>
 <operator type="smallerThan" />
 <right type="constant" attribute="4.0"/>
 <buy name="Chancellor">
 <left type="countCardsInDeck" attribute="Chancellor"/>
 <operator type="equalTo" />
 <right type="constant" attribute="0.0"/>
 <buy name="Silver">
 <left type="countCardsInDeck" attribute="Silver"/>
 <operator type="equalTo" />
 <right type="constant" attribute="0.0"/>
 <buy name="Chancellor">
 <left type="countCardsInDeck" attribute="Chancellor"/>
 <operator type="smallerOrEqualThan" />
 <right type="countCardsInDeck" attribute="Stash"/>
 <buy name="Silver"/>

This one beats Envoy 55-38. I just let the simulator buy Chancellor only if it has less Chancellors in the deck than Stashes and won’t let him buy more than 4 Stashes.

Do it yourself

Now you should be able to create and fine tune your own bots. Good luck and have fun!

  1. November 5, 2011 at 7:23 pm

    How may I tell the bot what decisions to make on cards like chapel, forge, upgrade and the like?
    Is there a way to define a kind of ‘decision rules’ similar to the buy rules?

    • Geronimoo
      November 6, 2011 at 10:51 am

      These decisions are pre-programmed. Check out the play rules pages to see how each card is handled.

  2. henhonkin
    June 14, 2012 at 11:45 pm

    when i’m saving my own built strategies, shut the program down and restart, my strategies are gone. Is there a way to fix it if it’s a bug or something similiar or if it’s actually planned how can i save my strategies ?
    Thanks in advance for an answer

    • June 15, 2012 at 9:17 am

      Go to “File”, then “Save players” and it will store your self built strategies in an XML file.

  3. Kenny
    July 19, 2012 at 10:53 pm

    I was very confused when I first went to the Edit/Create page, because I didn’t see any place where buy rules appeared. After looking a little more closely, I realized that the buy rules section is displaying only as a single line, while the Description/Start State/Board section is big enough to read. When I move the pointer over the line and two-finger scroll, I can scroll through the buy rules section, but I can’t actually see enough of it to edit! Do you know if there’s a way to resize these sections of the window? I can resize the window as a whole, but this doesn’t fix the buy rules section.

    (I’m on a Macbook Pro running Lion, in case that’s relevant.)

    • July 20, 2012 at 12:38 am

      Never heard of this problem. Might be due to the Mac OS. No idea, really and I can’t test that myself.

      • Tuiã
        March 1, 2014 at 11:09 pm

        The same happens in Linux Mint 16…

    • dgh
      August 10, 2012 at 12:52 pm

      The same thing happens to me. The Edit/Create page is only a centimeter tall. Also on a Mac.

      • May 4, 2016 at 7:17 am

        I have the same issue. my workaround was to create an .xml file as shown above, and import that instead. it’s a bit of a hack, because i can’t see all the available options, only those used previously in that xml, and also can’t hide the buy conditions etc. still, it has me simulating 🙂

  4. dominator123
    April 20, 2013 at 12:32 pm

    I notice that ‘count in deck’ doesn’t include hand/play area. So it bought more schemes than I needed. Can you fix that?

  5. August 30, 2016 at 12:49 am

    When I go to edit I don’t see any window but it tells me I have to close the editor before doing anything else. When I go to create, There are two “add a buy rule” (one with the underlined A of Add and one with the underlined B of Buy). Whenever I click either nothing happens, even if I toggle buy conditions. Any tips?

    • August 30, 2016 at 8:42 am

      I haven’t encountered that behavior before. Maybe enlarge the window and see what happens?

  6. Mirror
    January 6, 2017 at 1:43 pm

    i think you have done a great job with this simulator.
    But im not sure how your copy/past of the optimized Chancellor/Stash bot was meant.

    If i hit the copy/past button in the simulators main page it is exporting the present file to a location i don’t find. But i can’t “import” your copied code.

    My workaround at the moment is:
    1) File->Save Bots ( choose a folder on the harddrive where i want so save the files. For example save it under name DominionSimulator1)
    2) Open the DominionSimulator1.xml file with a text editor
    3) Copy the modified bot code (without the line numbers) into the file between the line and

    But if use File->Load Bots there is an error message:
    “Bot creation failed! Make sure you have a valid XML in your clipboard”

    So help would be appreciated because i dont think im the only one having troubles.

    Best regards

    • January 6, 2017 at 2:57 pm

      Click the Chancellor/Stash button to open the strategy selection window. In the lower left corner click “Clear Selection”. Now click “Copy/Paste” and it should paste what’s in your clipboard.

  1. August 21, 2011 at 2:54 pm

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: