Dominion Strategy Forum

Dominion => Simulation => Topic started by: philosophyguy on January 14, 2012, 05:27:43 pm

Title: Simulators and endgame play
Post by: philosophyguy on January 14, 2012, 05:27:43 pm
One of the areas I feel least confident about my ability to use a simulator effectively is in tweaking the endgame play (ie, when to buy Duchies and Estates). For those that are comfortable using simulators, I have a couple of questions about this:

1) When you are assessing the viability of an strategy, how important is the endgame play, in general? In other words: if I use a very simple endgame strategy for a custom bot and a baseline opponent, will the simulator lead me astray in determining whether the custom bot is at least a viable strategy?

2) Under what circumstances does endgame play make a huge difference? In other words, what kinds of games/strategies require me to get (either) bot's endgame strategy right in order to rely on the simulator's verdict?
Title: Re: Simulators and endgame play
Post by: Geronimoo on January 14, 2012, 05:47:06 pm
If your bot is a Big Money strategy than you can probably copy/paste the default endgame of the Big Money Ultimate without much error. When you're building an engine bot, the endgame buy rules can get a little tricky. For instance most Wharf engines will aim for double Province turns, so set these 2 buy rules for Province:

buy Province
  "if $available>=16"
buy Province
  "if count in deck(Province>0)"

and use the

buy Duchy/Estate
   "if #buys/gains needed to end game <=..."

If you've got a mega-turn strategy it gets trickier because you might need to wait to go green until you have enough engine parts, or/and enough buys/money.

Rush strategies are also different: their endgame often starts very soon (Workshop/Gardens).

Finally, mirror engine strategies that will end up in three-piling are the most complex and I haven't really done those that much because they're a real pain. There should however be enough settings available to create these endgames.

And if you're stuck, just post your bot here and I'll have a look (and probably DG and WW)
Title: Re: Simulators and endgame play
Post by: DG on January 14, 2012, 09:36:33 pm
The end game strategy can make quite a difference, perhaps 10%. Finding the exact time a script should start buying provinces is troublesome, so just making sure there is some gold in the deck is a shortcut. Getting the number of provinces left in the supply to start buying duchies is quick. Just try out a few value. For colony games use "buys/gains needed to end the game" instead of "colonies remaining in supply" and make sure the duchies are not bought too soon.

A simulator bot will have no concept of a three pile ending unless you script it, so the bots will buy out supply piles when they're behind and ignore ways to close out games when they're ahead. Unfortunately you can only customize the script effectively when you know the competing bots and know which piles will be emptied. Aside from 3 pile endings, there are some times when a badly losing deck can stop buying provinces and buy platinum to push for a win on colonies. Variable vp cards nearly always need special conditions.

I'll also suggest that all scripts always have access the same vp cards, so that if you're testing a tunnel strategy against a big money baseline then the baseline can buy tunnels too. It makes a significant difference. The same can also be said for kingdom card treasures.

Quote
if I use a very simple endgame strategy for a custom bot and a baseline opponent, will the simulator lead me astray in determining whether the custom bot is at least a viable strategy?

Not really. The worst case would be when you miss games ending on cheaper vp cards, perhaps duchy, estate, and curse. There are plenty of kingdom cards that make a difference but hopefully you can spot them - treasury, rabble, hoard, etc. Engine decks need watching carefully since too many green cards can kill a deck entirely. If you're checking there is gold in the deck before buying a province then make sure the bot will buy the gold and not be stuck on banks or wharves instead.
Title: Re: Simulators and endgame play
Post by: DG on January 14, 2012, 09:46:04 pm
A useful feature for a simulator would actually be auto-optimisation of a single value. For example, you'd put in a condition such as  "Buy province when total $ in deck > X" and X limit to between 12 and 21, then the simulator would test all the values within the limits for 1000 games and insert the optimised value. This could obviously only be done for one parameter at a time.

Maybe we can pass that one over to the open source simulator.
Title: Re: Simulators and endgame play
Post by: buggibum on January 14, 2012, 10:56:29 pm
If you like to optimize the ai of an endgame bot you have to add new variables:

For instance:
- Buys, algorithm considers the buys he and his opponents have because of their decks
- ai knows when to trash provinces with apprentice/upgrade for instance to get new provinces to fasten the ending
- ai can compete with the opponents strategy. if opponent goes for garden, ai makes protecting buys of gardens.
...

Endgame right now is too complex for a real competitive ai i guess.