Dominion Strategy Forum

Dominion => Game Reports => Topic started by: h1402686 on April 26, 2015, 03:49:40 pm

Title: Worth buying King's Court?
Post by: h1402686 on April 26, 2015, 03:49:40 pm
Earlier today I played a game (http://www.gokosalvager.com/static/logprettifier.html?20150426/log.516cccebe4b082c74d79df9b.1430066568491.txt) with Colonies and this Kingdom:

(http://wiki.dominionstrategy.com/images/2/2f/Embassy.jpg) (http://wiki.dominionstrategy.com/index.php/Embassy) (http://wiki.dominionstrategy.com/images/e/ec/Festival.jpg) (http://wiki.dominionstrategy.com/index.php/Festival) (http://wiki.dominionstrategy.com/images/f/f6/Rogue.jpg) (http://wiki.dominionstrategy.com/index.php/Rogue) (http://wiki.dominionstrategy.com/images/e/ed/Tactician.jpg) (http://wiki.dominionstrategy.com/index.php/Tactician) (http://wiki.dominionstrategy.com/images/8/8d/King's_Court.jpg) (http://wiki.dominionstrategy.com/index.php/King's Court)
(http://wiki.dominionstrategy.com/images/2/26/Herbalist.jpg) (http://wiki.dominionstrategy.com/index.php/Herbalist) (http://wiki.dominionstrategy.com/images/c/c6/Lookout.jpg) (http://wiki.dominionstrategy.com/index.php/Lookout) (http://wiki.dominionstrategy.com/images/c/c8/Caravan.jpg) (http://wiki.dominionstrategy.com/index.php/Caravan) (http://wiki.dominionstrategy.com/images/f/f6/Silk_Road.jpg) (http://wiki.dominionstrategy.com/index.php/Silk Road) (http://wiki.dominionstrategy.com/images/f/f7/Bazaar.jpg) (http://wiki.dominionstrategy.com/index.php/Bazaar)
Code: [Select]
Herbalist, Lookout, Caravan, Silk Road, Bazaar, Embassy, Festival, Rogue, Tactician, King's Court
After words I spent a while running sims to see if it's worth buying King's Court or just pursuing more or less a money strategy. Since I invested a decent chunk of time in it I thought people might be interested in the results: the King's Court bot wins, but only at 54%. Here are some lessons from the bot:


Here's the simple (no King) bot:
Code: [Select]
{
  name: 'Embassy'
  requires: ['Embassy', 'Herbalist', 'Silk Road']
  gainPriority: (state, my) -> [
    "Colony" if my.countInDeck("Platinum") > 0
    "Province" if state.countInSupply("Colony") <= 6 \
               or state.countInSupply("Province") <= 6

    "Duchy" if 0 < state.gainsToEndGame() <= 5
    "Silk Road" if 0 < state.gainsToEndGame() <= 5
    "Estate" if 0 < state.gainsToEndGame() <= 2
    "Platinum"
    "Gold"
    "Embassy" if my.countInDeck("Embassy") < 2 \
             and my.numCardsInDeck() >= 14
    "Embassy" if my.countInDeck("Embassy") < 1
    "Festival"
    "Bazaar"
    "Caravan"
    "Silver"
    "Copper" if state.gainsToEndGame() <= 3
  ]
}

And here's the King bot:
Code: [Select]
{
  name: 'KingEngine'
  requires: ['Herbalist', "King's Court", 'Bazaar', 'Caravan', 'Lookout', 'Rogue', "Festival", "Embassy"]
  gainPriority: (state, my) -> [
    "Colony" if my.countInDeck("Platinum") > 0
    "Colony" if my.getTotalMoney() >= 40
    "Colony" if state.countInSupply("Colony") <= 6 \
             or state.countInSupply("Province") <= 6

    "Province" if state.countInSupply("Colony") <= 6 \
               or state.countInSupply("Province") <= 6
   
    "Silk Road" if 0 < state.gainsToEndGame() <= 5 and my.getVP("Silk Road") >= 3
    "Duchy" if 0 < state.gainsToEndGame() <= 5
    "Silk Road" if 0 < state.gainsToEndGame() <= 5
    "Duchy" if 0 < state.gainsToEndGame() <= 5
    "Estate" if 0 < state.gainsToEndGame() <= 2
    "Platinum" if my.getTotalMoney() < 40
    "King's Court" if my.countCardTypeInDeck("Action") >= 7
    "Gold" if my.getTotalMoney() < 40
    "Rogue" in my.countInDeck("Rogue") == 0
    "Embassy" if my.countInDeck("Embassy") + my .countInDeck("Rogue") < \
            my.countInDeck("Bazaar") + my.countInDeck("Festival") + 2
    "Bazaar" if my.countInDeck("Festival") >= 2
    "Festival"
    "Bazaar"
    "Caravan"
    # "Lookout" if my.countInDeck("Lookout") == 0 # Hurts, even after bug fix: http://forum.dominionstrategy.com/index.php?topic=619.msg486204#msg486204
    "Silver" if my.getTotalMoney() < 40 or state.gainsToEndGame() <= 3
    "Copper" if state.gainsToEndGame() <= 3
    "Herbalist" if my.countInDeck("Herbalist") < 0 and my.countInDeck("Gold") + my.countInDeck("Platinum") > 0
  ]
}
Title: Re: Worth buying King's Court?
Post by: SCSN on April 26, 2015, 03:56:32 pm
Not skipping Lookout and building a double Tactician engine with King's Court should win 95-100% of the time against either of those strategies.

Of course if you only specify buy order the bot is going to play terribly.
Title: Re: Worth buying King's Court?
Post by: dondon151 on April 26, 2015, 03:58:13 pm
You can't really simulate King's Court strategies.
Title: Re: Worth buying King's Court?
Post by: DStu on April 26, 2015, 04:10:57 pm
You can't really simulate King's Court strategies.

You can, it's just lots of work.

:e seriously.  You probably really want to specify your playPriority if you are building this kind of deck, but this can get really messy to decide when to play KC, and what to KC,...
Title: Re: Worth buying King's Court?
Post by: DG on April 26, 2015, 05:00:30 pm
A big problem for simulation here is the lookout. A script doesn't really know when to stop playing them. There's a whole lot of shuffle management, choice of cards for the king's court, and a variety of other stuff too. A high decision kingdom.
Title: Re: Worth buying King's Court?
Post by: Kirian on April 26, 2015, 05:10:00 pm
This is the sort of engine board that makes one salivate.
Title: Re: Worth buying King's Court?
Post by: h1402686 on April 26, 2015, 05:43:07 pm
Here (http://www.gokosalvager.com/static/logprettifier.html?/20150426/log.516cccebe4b082c74d79df9b.1430083353181.txt)'s a double Tactician game I just played against the computer.

I didn't think through the possibility of double Tactician, and it sounds like experts feel that it is the best. It does leave you quite vulnerable to Rogue, though, right?

Some things I learned:

Things I believe but am less sure of:
[/list]
Title: Re: Worth buying King's Court?
Post by: h1402686 on April 26, 2015, 05:55:53 pm
I'm not sure double Tactician is so dominant here. If I have my EmbassyBot play itself in Geronimoo's simulator, which reports average game length, the reported average is 20.4 turns. That's looks like a mean--a median would not end in 0.4. The distribution of game lengths must be skewed right, so the median is probably under 20 turns. And in my log (http://www.gokosalvager.com/static/logprettifier.html?/20150426/log.516cccebe4b082c74d79df9b.1430083353181.txt), where I think I had decent shuffle luck, I buy my first Colony on turn 15. So double Tactician is a little ahead, but the Embassy bot is not as good as my King bot, which in turn is not as good as a human who can use Lookout intelligently. And that's without considering the havoc a Rogue will wreak.
Title: Re: Worth buying King's Court?
Post by: Rabid on April 26, 2015, 06:53:20 pm
Cool kingdom, thanks for posting it.
I got quite good draws, and a small sample, but this gives you something to compare the bots to:

http://www.gokosalvager.com/static/logprettifier.html?/20150426/log.505ef45ca2e6714a97eee20c.1430088568869.txt
Title: Re: Worth buying King's Court?
Post by: ehunt on April 27, 2015, 05:10:02 am
I think the Double Tactician discussion is a little bit of a distraction -- the point is that if the simulator isn't telling you to buy king's courts and action cards, the simulator is wrong. I don't know that Double Tactician is necessary -- what you need is to reliably have a starting hand that has draws in it so that you can line your kc's with each other, and a kinged caravan + deck thinning (e.g. what Rabid does in the sample game) might be enough.

The disadvantage to double tactician is that it takes a little longer to set up and you lose the monetary benefits of whatever cash you have left in your deck. Now how much cash should that be? Not much. I think you should always prefer more action cards to platinum in this game -- a kinged festival gives more money than a platinum and if you get 5 KC you should be able to king every action you play (by kinging kings). But on the other hand, your opponent is going to be throwing silvers at you via embassy.

The two big advantages of double tactician are:
1) reliability: a kinged caravan keeps a kings court from being reshuffled, and gives you two "extra cards" less the next turn.
2) the first tactician in the early game might be the key to spiking an early kc, which can be key for snowballing into a win; then once you have the first tactician, the second is probably worth it.


tl;dr kc engine w/double tact and kc engine w/o double tact are close; i suspect w/o is better but see arguments both ways. either of them is going to consistently beat a strategy that doesnt revolve around kc megaturns.
Title: Re: Worth buying King's Court?
Post by: Chris is me on April 27, 2015, 07:56:52 am
When I saw the thread title, I assumed it was going to be a kingdom with King's Court and a bunch of weak actions without much coin or buy... King's Court is a no brainer on this board. It's not even close.

KC / KC / Festival / Festival / Festival, for example, is 18 coin right there. You have Lookout to trash, which isn't the best, but it will work. You have Tactician which helps you line up your King's Courts, and you have Embassy and Caravan for draw. What else could you even need to make this a King's Court board?
Title: Re: Worth buying King's Court?
Post by: DStu on April 27, 2015, 08:05:09 am
What else could you even need to make this a King's Court board?

Bridge  ;)
Title: Re: Worth buying King's Court?
Post by: SCSN on April 27, 2015, 01:53:39 pm
Here's a very basic and rough engine script that utilizes Lookout and beats both scripts in the OP:

Code: [Select]
# "Simulators can't play engines!"
{
  name: 'KC-Engine'
  author: 'SheCantSayNo'
  requires: ['Lookout', 'Caravan', 'Bazaar', 'Festival', 'Embassy', "King's Court"]
  gainPriority: (state, my) -> [   
    "Festival" if my.countInDeck("King's Court") > 1 and my.countInDeck("Festival") == 0
    "King's Court" if my.countInDeck("King's Court") < 5
    "Colony"
    "Province" if state.gainsToEndGame() <= 3
    "Bazaar" if my.countInDeck("Bazaar") < 3   #5-2 opening
    "Embassy" if my.countInDeck("Embassy") == 0 
    "Caravan" if my.countInDeck("Caravan") < 1       #4-3 opening
    "Lookout" if my.countInDeck("Lookout") < 1       #4-3 opening
    "Festival" if my.countInDeck("Festival") < 2
    "Festival" if my.ai.drewDeck(state, my) == 1   
    "Duchy" if state.gainsToEndGame() <= 2
    "Bazaar"
    "Caravan" if state.gainsToEndGame() > 2
    "Silver" if state.gainsToEndGame() > 2
    "Estate" if state.gainsToEndGame() <= 2
  ]

drewDeck: (state, my) ->
    draw = my.cardsInDeck
    for card in my.hand
        draw--
    for card in my.inPlay
        draw--
    if draw == 0
        return 1
    else
        return 0

multipliedPriority: (state, my) -> [
      "King's Court"
      "Caravan" if my.ai.drewDeck(state, my) == 0
      "Bazaar"  if my.ai.drewDeck(state, my) == 0
      "Festival"     
      "Embassy" if my.ai.drewDeck(state, my) == 0
      "Bazaar"
      "Caravan"
      "Lookout" if state.gainsToEndGame() >= 6
]

playPriority: (state, my) -> [   
       "King's Court"
       "Lookout" if state.gainsToEndGame() >= 4
       "Caravan"
       "Bazaar"
       "Festival"
       "Embassy"     
       "Silver"
       "Copper"
   ]
}

Try skipping Lookout to see how much poorer it does.
Title: Re: Worth buying King's Court?
Post by: DStu on April 27, 2015, 02:28:16 pm
Here's a very basic and rough engine script that utilizes Lookout and beats both scripts in the OP:

Code: [Select]
# "Simulators can't play engines!"
{
  name: 'KC-Engine'
  author: 'SheCantSayNo'
  requires: ['Lookout', 'Caravan', 'Bazaar', 'Festival', 'Embassy', "King's Court"]
  gainPriority: (state, my) -> [   
    "Festival" if my.countInDeck("King's Court") > 1 and my.countInDeck("Festival") == 0
    "King's Court" if my.countInDeck("King's Court") < 5
    "Colony"
    "Province" if state.gainsToEndGame() <= 3
    "Bazaar" if my.countInDeck("Bazaar") < 3   #5-2 opening
    "Embassy" if my.countInDeck("Embassy") == 0 
    "Caravan" if my.countInDeck("Caravan") < 1       #4-3 opening
    "Lookout" if my.countInDeck("Lookout") < 1       #4-3 opening
    "Festival" if my.countInDeck("Festival") < 2
    "Festival" if my.ai.drewDeck(state, my) == 1   
    "Duchy" if state.gainsToEndGame() <= 2
    "Bazaar"
    "Caravan" if state.gainsToEndGame() > 2
    "Silver" if state.gainsToEndGame() > 2
    "Estate" if state.gainsToEndGame() <= 2
  ]

drewDeck: (state, my) ->
    draw = my.cardsInDeck
    for card in my.hand
        draw--
    for card in my.inPlay
        draw--
    if draw == 0
        return 1
    else
        return 0

multipliedPriority: (state, my) -> [
      "King's Court"
      "Caravan" if my.ai.drewDeck(state, my) == 0
      "Bazaar"  if my.ai.drewDeck(state, my) == 0
      "Festival"     
      "Embassy" if my.ai.drewDeck(state, my) == 0
      "Bazaar"
      "Caravan"
      "Lookout" if state.gainsToEndGame() >= 6
]

playPriority: (state, my) -> [   
       "King's Court"
       "Lookout" if state.gainsToEndGame() >= 4
       "Caravan"
       "Bazaar"
       "Embassy"     
       "Silver"
       "Copper"
   ]
}

Try skipping Lookout to see how much poorer it does.

To even forgot to play festival of not multiplied. Or was this on intention?
Title: Re: Worth buying King's Court?
Post by: h1402686 on April 27, 2015, 09:17:00 pm
Interestingly, although @SheCantSayNo's bot beats either of my original bots 60-40, its average VP is lower at every turn. The games in which SheCantSayNo's bot is ahead must tend to end early.

(http://s16.postimg.org/6vzu07bfp/Dominiate_results.png)
Title: Re: Worth buying King's Court?
Post by: JW on April 27, 2015, 09:44:45 pm
Interestingly, although @SheCantSayNo's bot beats either of my original bots 60-40, its average VP is lower at every turn. The games in which SheCantSayNo's bot is ahead must tend to end early.

(http://s16.postimg.org/6vzu07bfp/Dominiate_results.png)

You should look at the average VP score of each bot on turn 10, 11, etc. just in games that end on that turn.

If you compare a money bot to an engine bot that can end the game while it is ahead, the money bot is ahead throughout the game each time it wins. The engine bot is probably ahead only for the final turn for most of the games it wins. But the engine bot ends the game on the turn it gets ahead, which is worth way more than being ahead on turns 3-15 only to lose later on!

Title: Re: Worth buying King's Court?
Post by: DStu on April 27, 2015, 11:03:54 pm
Interestingly, although @SheCantSayNo's bot beats either of my original bots 60-40, its average VP is lower at every turn. The games in which SheCantSayNo's bot is ahead must tend to end early.

(http://s16.postimg.org/6vzu07bfp/Dominiate_results.png)

You should look at the average VP score of each bot on turn 10, 11, etc. just in games that end on that turn.

If you compare a money bot to an engine bot that can end the game while it is ahead, the money bot is ahead throughout the game each time it wins. The engine bot is probably ahead only for the final turn for most of the games it wins. But the engine bot ends the game on the turn it gets ahead, which is worth way more than being ahead on turns 3-15 only to lose later on!

That's true. But the graph is drdndard dominiate output, and it's the first time I saw this effect there, that the winning bot has constantly lower average vp. Do nice demonstration of the principle.
Title: Re: Worth buying King's Court?
Post by: Beyond Awesome on April 28, 2015, 01:34:07 am
It doesn't matter how much VP you have at the end. Winning is winning.
Title: Re: Worth buying King's Court?
Post by: theJester on April 28, 2015, 07:13:53 am
This would be a good engine even without KC. And with KC around, it's vastly superior to any money strategy.
Title: Re: Worth buying King's Court?
Post by: Kirian on April 28, 2015, 11:13:13 am
It doesn't matter how much VP you have at the end. Winning is winning.

Who was it that said the object of Dominion is not to have the most points at the end of the game, but to end the game while you have the most points?
Title: Re: Worth buying King's Court?
Post by: Awaclus on April 28, 2015, 11:17:14 am
It doesn't matter how much VP you have at the end. Winning is winning.

Who was it that said the object of Dominion is not to have the most points at the end of the game, but to end the game while you have the most points?

Tables.
Title: Re: Worth buying King's Court?
Post by: DStu on April 28, 2015, 11:17:25 am
It doesn't matter how much VP you have at the end. Winning is winning.

Who was it that said the object of Dominion is not to have the most points at the end of the game, but to end the game while you have the most points?
To be fair, the engine bot is still doing the first one. It is just not having the most points the most time before the game ends.
Title: Re: Worth buying King's Court?
Post by: dondon151 on April 28, 2015, 04:06:09 pm
The two big advantages of double tactician are:
1) reliability: a kinged caravan keeps a kings court from being reshuffled, and gives you two "extra cards" less the next turn.
2) the first tactician in the early game might be the key to spiking an early kc, which can be key for snowballing into a win; then once you have the first tactician, the second is probably worth it.

2) isn't true; you can get $7 after a couple of shuffles of just Lookout trashing and buying Caravan on $4, Bazaar on $5.

TC is really analysing this kingdom with the wrong approach if he keeps comparing bots playing sub-optimal strategies.