Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: Engine building walkthrough  (Read 2229 times)

0 Members and 1 Guest are viewing this topic.

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +868
    • View Profile
    • Geronimoo's Dominion Simulator
Engine building walkthrough
« on: March 04, 2013, 09:10:56 am »
+19

Geronimoo, how do you iterate through the simulator options to determine the best way to build an engine on a board?

I'm sure philosphyguy isn't the only one who has trouble building engines in my simulator. So I decided to write this interactive walkthrough where I'll try to give you all some insight into advanced bot building.

A while ago I played a game on Goko against nomnomnom. The board featured Caravan, City, Cutpurse, Navigator, Woodcutter, Worker's Village and Lighthouse as notable cards. I thought there was potential for a City engine because of Caravans running out and no decent Big Money option available. I went for it opening Cutpurse/Silver. My opponent opened Navigator/Silver. Then we both started spamming Caravans. I got one Gold somewhere and started on the Cities once the Caravans ran out. Then I hit $8 and I realized I didn't have a +buy yet and my opponent was already greening, so I gave up on the engine and started greening. I lost and discussed a little with nomnomnom about the engine potential. He thought it was too slow, I thought it might be possible to make it succesful. I'll be using this game's board to give you a step by step walkthrough of how I went about building an engine bot in the simulator.

Before I start to write a bot script I try think about how I would roughly play the engine, then create an extremely simple bot and let it play against a benchmark (in this case my opponent's strategy: Navigator Big Money with Caravan support). The BM deck is easy to create so I won't discuss it (you can download all the bots in the attachment and load them into the simulator via File->Load then view them by clicking on "Created by User" in the bot selector window). The best way to learn how to use the simulator well is to play with it so please don't be lazy and try the exercises. Good luck and have fun!

First exercice: Try to work out in your head (or on paper) how you, human, would play the City engine. How would you open? What's your plan for the mid game collecting engine components. How about the end game? I'll give you some time. If you already have some experience with the simulator, you can try to write a simple script.


...



...



...



Solution:This is how I tackled the first exercise: take a standard Big Money bot and add Cities, a single Cutpurse, Caravans, Silvers and Lighthouses in that order. this deck wants to start greening only when the City pile is empty, so add that condition to the Province buy rule. Notice that I didn't add a source of +buy yet although I know the optimal strategy will very likely include it. I prefer to see a very basic strategy at work to easily spot and solve the major problems, then add more components. This is the "first trial" bot which you'll find in the "Created by user" tab. To test this bot, simply use the "Quick Simulation button". This first bot has major problems with a 0% win rate against the Navigator + Caravan bot. The issue is easy to find in the sample game logs.

Second exercise: try to fix the "first trial" bot so it has a win rate > 0%. This requires only one click in the editor! (hint: add a condition to the Gold buy rule)

...


...


...


Solution:To solve the second exercise you'll have to scan the "Sample Game" logs to find the problem. You'll find the Gold buy rule causes the bots to have massive piles of Gold and not much else at end of game. Simple solution: add a condition to the Gold rule to buy only 1. This seems reasonable because Cities would add money in the end game ("second trial"). This bot has a win rate of 5%. Yeah, but we still have a long way to go.

Third exercise: by looking at the game logs try to find the cause of the low win rate. This fix requires only one click in the editor! (hint: look at the Caravan and City buy rules order)

...


...


...


Solution:The bot is buying Provinces before the Cities are at level 2 (+$1 and +1 buy). How's that possible? Oh right, the Caravans aren't empty yet. To solve this issue simply move up the Caravan buy line above the City buy line in the editor. This is the "third trial" bot. The win rate doubles to 14%! Success! Looking at the sample game logs again I scroll down to turn 10 and see these lines:


   Cutpurse + Caravan + City (third trial)(Plr 1) has $12 to spend and 1 buy
   Cutpurse + Caravan + City (third trial)(Plr 1) buys a Caravan

   
Further down it's spending $15 and more on single Cities. This bot desperately needs a source of +buy before the Cities are fully leveled up. Now comes the hard part: where to put this +buy...

Fourth exercise: add a source of +buy to the bot. You finish the exercise if the win rate has increased.(hint: add a Woodcutter buy rule)

...


...


...


Solution:Again I want to keep things very simple so I just let my bot open Cutpurse/Woodcutter instead of Cutpurse/Silver. This is the "fourth trial" bot. The win rate has tripled now: 41%. That's massive and by now it should be clear that the engine is viable and it's just a matter of tuning to make it win. Looking over the sample logs you'll see that the bot still has a lot of wasted economy in the mid game.

Fifth exercise: try to fix some of the wasted economy (hint: does the bot need Gold? Maybe add some more +buy)

...


...


...



Solution:Now we're really into the fine tuning stages. Lots of wasted economy = too much treasure? Maybe I don't need the Gold? And I'll let the bot buy a Worker's Village once the Caravans are gone. This bot ("fifth trial") wins more than it loses, so my mission is done and I have proven the engine is better than the Big Money deck. The bot still has a lot of room for improvement though.

Sixth exercise: Can you think of something else we could do to improve the bot besides adding +buy? (hint: the bot has lots of spare actions thanks to City, so you can freely add terminal actions to the deck in the mid game)

...


...


...

Solution:Back to the samples. I notice that the bot has lots of spare actions in the mid game thanks to Cities so I could probably let it buy extra Cutpurses for more attack and extra Woodcutters for more buys ("sixth trial" bot).

Now the bot has the correct opening (Cutpurse/Woodcutter) and the mid game is handled well (empty the Caravans asap, then empty  Cities while adding more terminal actions). It's time to focus on the end game. Looking over several logs, it seems the bot will often buy the Penultimate Province and lose.

Seventh exercise: Try to handle the end game better (hint: let the bot buy the Penultimate Province only if it can also buy the last Province)

...


...


...


Solution:"Seventh trial" The trick here is to let the bot buy the Penultimate Province only if it has >$16 to spend. I also simplified the Duchy and Estate buying rules so once the bot starts greening it doesn't buy non-green cards anymore. This increases the win rate to two thirds.

Eighth exercise: Can you do better than Geronimoo and improve the bot even further? Post your solutions here! Thanks for listening!
Logged

philosophyguy

  • Minion
  • *****
  • Offline Offline
  • Posts: 575
  • Respect: +299
    • View Profile
Re: Engine building walkthrough
« Reply #1 on: March 05, 2013, 07:07:31 pm »
0

This is a really helpful walkthrough; thank you! Two questions:

1) I can't seem to access the attachments. Would it be possible for you to post them on your simulator site?

2) When building an engine bot, how do you handle the greening rules? Do you make a rough version of the bot with just Province buys and then tweak in Duchies and Estates later? Do you use the BM rules as a default starting point?
Logged
Pages: [1]
 

Page created in 0.04 seconds with 20 queries.