Dominion Strategy Forum

Please login or register.

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

Author Topic: Help decide on a TR/KC priority list  (Read 4461 times)

0 Members and 1 Guest are viewing this topic.

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Help decide on a TR/KC priority list
« on: September 17, 2011, 06:45:34 pm »
0

Below is the Action-playing priority list in Dominiate. It can be overridden by specific strategies, but most strategies will leave it alone, so we want a reasonable play order for all situations.

One question, of course, is if you have any suggested changes to this default priority order so far. But another pertinent question is: assume I'm implementing Throne Room and King's Court soon. There will be a similar action list for them, except now you've got a variable called "multiplier" that's either 2 or 3. How should the action list change?

What goes at the top of the list for what to play with a KC/TR? Wait, I know the answer to that, it's King's Court. Followed by Throne Room.

But what comes next? Followers? Familiar? Grand Market? In other words, if you have the choice of playing any action card with a King's Court, how would you decide? (Checking for things like whether there are curses left makes sense, of course.)

Here's the current list for non-multiplied actions:
Code: [Select]
    # First priority: cards that succeed if we play them now, and might
    # not if we play them later.
    "Menagerie" if my.menagerieDraws() == 3
    "Shanty Town" if my.shantyTownDraws(true) == 2
    "Tournament" if my.countInHand("Province") > 0

    # Second priority: cards that give +2 actions.
    "Trusty Steed"
    "Festival"
    "University"
    "Farming Village"
    "Bazaar"
    "Worker's Village"
    "City"
    "Walled Village"
    "Fishing Village"
    "Village"

    # Third priority: cards that give +1 action and are almost always good.
    "Bag of Gold"
    "Grand Market"
    "Hunting Party"
    "Alchemist"
    "Laboratory"
    "Caravan"
    "Market"
    "Peddler"
    "Conspirator" if my.inPlay.length >= 2
    "Great Hall"
    "Wishing Well"
    "Lighthouse"

    # Fourth priority: terminal card-drawers, if we have actions to spare.
    "Smithy" if my.actions > 1
    "Watchtower" if my.actions > 1 and my.hand.length <= 4

    # Fifth priority: card-cycling that might improve the hand.
    "Familiar" # after other non-terminals in case non-terminal draws KC/TR
    "Pawn"
    "Warehouse"
    "Cellar"

    # Sixth priority: non-terminal cards that don't succeed but at least
    # give us something.
    "Tournament"
    "Menagerie"
    "Shanty Town" if my.actions == 1

    # Seventh priority: terminals. Of course, Nobles might be a non-terminal
    # if we decide we need the actions more than the cards.
    "Nobles"
    "Treasure Map" if my.countInHand("Treasure Map") >= 2
    "Followers"
    "Mountebank"
    "Witch"
    "Sea Hag"
    "Tribute" # after Cursers but before other terminals, there is probably a better spot for it
    "Goons"
    "Wharf"
    # Tactician needs a play condition, but I don't know what it would be.
    "Tactician"
    "Militia"
    "Princess"
    "Explorer" if my.countInHand("Province") >= 1
    "Steward"
    "Moneylender" if my.countInHand("Copper") >= 1
    "Bridge"
    "Horse Traders"
    "Coppersmith" if my.countInHand("Copper") >= 3
    "Watchtower" if my.hand.length <= 3
    "Smithy"
    "Council Room"
    "Watchtower" if my.hand.length <= 4
    "Merchant Ship"
    "Baron" if my.countInHand("Estate") >= 1
    "Monument"
    "Adventurer"
    "Harvest"
    "Explorer"
    "Woodcutter"
    "Coppersmith" if my.countInHand("Copper") >= 2
    # Play an Ambassador if our hand has something we'd want to discard.
    "Ambassador" if my.ai.wantsToTrash(state)
    "Trading Post" if my.ai.wantsToTrash(state) + my.countInHand("Silver") >= 2
    "Chapel" if my.ai.wantsToTrash(state)
    "Trade Route" if my.ai.wantsToTrash(state)
    "Conspirator"
    "Moat"
    "Watchtower" if my.hand.length <= 5
    "Ironworks" # should have higher priority if condition can see it will gain an Action card
    "Workshop"
    "Coppersmith"
    "Watchtower" if my.hand.length <= 6

    # Eighth priority: cards that have become useless. Maybe they'll decrease
    # the cost of Peddler or something.
    "Treasure Map" if my.countInDeck("Gold") >= 4 and state.current.countInDeck("Treasure Map") == 1
    "Shanty Town"
    "Chapel"

    # At this point, we take no action if that choice is available.
    null

    # Nope, something is forcing us to take an action.
   
    # Last priority: cards that are actively harmful to play at this point,
    # in order of increasing badness.
    "Watchtower"
    "Trade Route"
    "Treasure Map"
    "Ambassador"
Logged

DG

  • Governor
  • *****
  • Offline Offline
  • Posts: 4069
  • Respect: +2608
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #1 on: September 17, 2011, 07:04:38 pm »
0

Before you make throne-throne a priority, remember that the throne forces you to play an action card in hand. Throne, throne, wooductter, ambassador, colony might be a bit embarrassing.
Logged

Fangz

  • Apprentice
  • *****
  • Offline Offline
  • Posts: 260
  • Respect: +12
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #2 on: September 17, 2011, 07:11:53 pm »
0

Number 1: Possession.

I do think these things change depending on whether there's a KC situation or a KC-KC situation. In KC KC, you should go for drawers first, so you can find more actions to play. Otherwise... man this is too difficult.
Logged

rod-

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 213
  • Respect: +49
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #3 on: September 18, 2011, 01:01:11 am »
0

Throning or kinging a treasure map is something that should only be done if
a) You're in the unlikely situation where you have a whole ton of them in hand and that actually works (which i dont think it does?)
b) You're not going to have any actions left after your throne/king chain ends. 

Basically i just think the priority should be next to zero, that's a play that i have never made and never seen made.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #4 on: September 18, 2011, 03:31:54 am »
0

Yep, perhaps the more interesting problem is whether, and when, to play the multiplier at all. And the interesting thing is that the time you want to play KC/TR is rather different from the action priority. The "safe" cards with +1/+2 actions are generally less interesting to multiply than cards that are terminals and have a correspondingly bigger effect.

I think the general cases for playing KC/TR will form their own priority order, perhaps something like this:

1. Play with a King's Court
2. Play with a powerful terminal when there are actions to spare
3. Play with a Throne Room if there are two/three good actions to play
4. Play with a powerful non-terminal when it's the only action remaining
5. Play non-multiplied actions that might draw a better card to play it with
6. Play with a non-bad terminal when it will actually be the final action
7. Play with some other action where the multiplier improves it
8. Play with some other action where the multiplier is useless but not harmful
9. Don't play it
10. (if it's a Throne Room) Play it with the least bad remaining action
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #5 on: September 18, 2011, 03:39:03 am »
0

What goes at the top of the list for what to play with a KC/TR? Wait, I know the answer to that, it's King's Court. Followed by Throne Room.

But what comes next? Followers? Familiar? Grand Market? In other words, if you have the choice of playing any action card with a King's Court, how would you decide? (Checking for things like whether there are curses left makes sense, of course.)

+1 for the problems with TR. Despite this you often also want TR>KC, as TR->KC is 2x3 vs 3x2 for KC->TR. When you only have 5 hands and no at least +2 better +3 cards in hand, it's very likely that you don't get 3 actions on hand for playing with KC->TR.

And also for KC only it's very dependend on the rest. Often after KC->KC, highest priority has the Smithy(+), for finding more KCs and more actions. Of course that's not true when playing KC->? without more actions left.

So for some very pseudo Pseudocode

// Here stood some TR, which was not really correct. Ignore TRs for the moment.
KC
If (actionsLeft or (more KCs open) ) and (I want to draw more cards*)  Smithies.
If (needmoreActions**) Cantrips*** > Villages > whatevergivesActions
else defaultActionPriorities

*,**,*** of course being the hard part. And that's still not how you would really play it.
*:   Check if there's something left to draw at all, and what's left in your piles.
**: If there's something in your hand that you still want to play but there is no KC's left, or if it's very likely that you would draw something of it if the action also draws
***: Including Conspirator, even when it's not (yet) activated.

That would be a first try, that would play a lot cards and probably generated a lot coins, one now still must care for getting enough buys for all these coins, probably by getting +buys a higher prio in the default list if there is much money avaiable, which would be reasonable anyway.

But I'm not sure if I would like to code something like that...
« Last Edit: September 18, 2011, 03:46:09 am by DStu »
Logged

Anon79

  • Apprentice
  • *****
  • Offline Offline
  • Posts: 264
  • Respect: +39
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #6 on: September 18, 2011, 03:49:38 am »
0

Before you make throne-throne a priority, remember that the throne forces you to play an action card in hand. Throne, throne, wooductter, ambassador, colony might be a bit embarrassing.
In which case, play the Ambassador first, returning 0 woodcutters each time (hi opponent, would you like these 2 lovely terminal silvers?), and *then* play your woodcutter.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #7 on: September 18, 2011, 03:53:43 am »
0

Before you make throne-throne a priority, remember that the throne forces you to play an action card in hand. Throne, throne, wooductter, ambassador, colony might be a bit embarrassing.
(hi opponent, would you like these 2 lovely terminal silvers?).

If it's a strong KC board, yes, I would usually like 2 KCable silvers+buy.
Logged

ackack

  • Explorer
  • *****
  • Offline Offline
  • Posts: 302
  • Respect: +19
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #8 on: September 19, 2011, 06:04:38 pm »
0

And also for KC only it's very dependend on the rest. Often after KC->KC, highest priority has the Smithy(+), for finding more KCs and more actions. Of course that's not true when playing KC->? without more actions left.

This is a very important point and a good illustration of why I'm skeptical that hard priorities are going to work well. At the very least, I think you need a conditional to recognize when you already have actions to spare or when you have effective extra actions because you've KCed a KC. You'll also want to recognize when you have situations where e.g. KCing a Lab draws nothing and you'd rather spend it on something valuable. I realize that an actual position evaluator doesn't exist. But I think a proxy along the lines of "maximize estimated handsize provided I have effective actions available following this play" (along with some of the sanity checks to make sure you don't do anything stupid) is probably feasible and would do better than a pure priority scheme.
Logged

Epoch

  • Tactician
  • *****
  • Offline Offline
  • Posts: 420
  • Respect: +37
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #9 on: September 19, 2011, 06:30:42 pm »
0

I don't understand why your priority list puts +2 action cards at such high priority.  I'd count any +2 Cards or more card as better to KC than Village, if you have >1 Action after your KC'd card drawer.

Is it correct that right now, if your hand is KC/Village/Smithy/treasurex2, your current priority rules will play KC-Village, then Smithy?  I think it's obviously true that the better play is Village, KC-Smithy.
Logged

Jimmmmm

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1733
  • Shuffle iT Username: Jimmmmm
  • Respect: +1943
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #10 on: September 19, 2011, 08:41:10 pm »
0

I don't understand why your priority list puts +2 action cards at such high priority.  I'd count any +2 Cards or more card as better to KC than Village, if you have >1 Action after your KC'd card drawer.

Is it correct that right now, if your hand is KC/Village/Smithy/treasurex2, your current priority rules will play KC-Village, then Smithy?  I think it's obviously true that the better play is Village, KC-Smithy.

And also to save your KC until the last possible moment in the hope of getting two KCs in your hand.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #11 on: September 20, 2011, 02:53:20 am »
0

I don't understand why your priority list puts +2 action cards at such high priority.  I'd count any +2 Cards or more card as better to KC than Village, if you have >1 Action after your KC'd card drawer.

Is it correct that right now, if your hand is KC/Village/Smithy/treasurex2, your current priority rules will play KC-Village, then Smithy?  I think it's obviously true that the better play is Village, KC-Smithy.

I don't have +2 action cards at a high priority. I don't even mention them in my preliminary KC/TR list except to lump them in with other nonterminals. I think you're looking at the priority list for non-multiplied actions that I posted at the top of the thread.

And there aren't any current rules for KC/TR, only future rules; that's why this thread exists.

ackack, replacing the entire priority function with a value function, which keeps actions > 0 and estimates the hand size, is a possibility. I feel that there will be a whole lot of cards it won't be able to distinguish between by card-drawing value alone (for example, KC-Saboteur is way better than KC-Village), and the most intuitive way to express that is with a priority list, so I lean toward having a priority list with a lot of conditionals in it. Don't shy away from conditionals -- conditionals are great and really easy in Dominiate.
« Last Edit: September 20, 2011, 03:02:24 am by rspeer »
Logged

Epoch

  • Tactician
  • *****
  • Offline Offline
  • Posts: 420
  • Respect: +37
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #12 on: September 20, 2011, 10:34:37 am »
0

I don't have +2 action cards at a high priority. I don't even mention them in my preliminary KC/TR list except to lump them in with other nonterminals. I think you're looking at the priority list for non-multiplied actions that I posted at the top of the thread.

Yes, sorry.  I thought that was your current set of rules for KC stuff.  My bad.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #13 on: October 26, 2011, 05:08:13 am »
0

A month later, this is finally implemented. Dominiate now supports KC/TR, and has a multipliedActionPriority list (configurable, of course) of actions it wants to multiply.

In addition to choosing a card, it can choose "wait", meaning it'll try playing other nonterminals instead, until it's left with the KC/TR and one other action, it's left with all terminals, or it gets a better option.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #14 on: October 26, 2011, 05:27:49 am »
0

I should note, though, that it doesn't always avoid getting itself into trouble with a Throne Room -- in particular, it doesn't look ahead enough to decide whether TRing a TR would be a good idea.

That actually helped me discover and fix some bugs that had never come up before (because they were in branches of the code that not even the SillyAI would want to play).
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #15 on: October 26, 2011, 05:34:19 am »
0

Nice work.

Don't you think that TR should be higher than KC? I would guess that most time, you want to prefer 2 action x3 over 3 actions x2.
And it mitigate some of the problem of being forced to play a action that you don't want in this case, as KC-TR forces you to play (up to three) actions you don't want, whereas with TR-KC you don't have to play any.

On the other hand, there are some times where you don't want to play the TR at all, like having KC-KC and TR and 3 actions. Without TR, you play all of them 3 times, with TR, you play all of them 2 times and have 2 unused KC left.
So maybe it's really to difficult and one should ignore the combination KC+TR at the moment.
Logged

Jimmmmm

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1733
  • Shuffle iT Username: Jimmmmm
  • Respect: +1943
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #16 on: October 26, 2011, 07:57:13 am »
0

On the other hand, there are some times where you don't want to play the TR at all, like having KC-KC and TR and 3 actions. Without TR, you play all of them 3 times, with TR, you play all of them 2 times and have 2 unused KC left.
So maybe it's really to difficult and one should ignore the combination KC+TR at the moment.

Couldn't you just go TR - KC - KC and have a spare KC left over in case you draw more actions?
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #17 on: October 26, 2011, 08:04:49 am »
0

On the other hand, there are some times where you don't want to play the TR at all, like having KC-KC and TR and 3 actions. Without TR, you play all of them 3 times, with TR, you play all of them 2 times and have 2 unused KC left.
So maybe it's really to difficult and one should ignore the combination KC+TR at the moment.

Couldn't you just go TR - KC - KC and have a spare KC left over in case you draw more actions?

At the start of your turn yes, but not if you draw the TR after having played the KCs. Say KC-KC:(3xSmithy)+((TR:2xX)-(TR:2xY)-(TR:2xnothing))+(3xnothing) instead of
KC-KC-(3xSmithy)-(3xX)-(3xY).

PS: should paint a tree, but am to lazy
Logged

ghostofmars

  • Young Witch
  • ****
  • Offline Offline
  • Posts: 141
  • Respect: +67
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #18 on: October 26, 2011, 08:10:43 am »
0

I have a question as to how the "wait" works in practice.
Let's say I have the following hand
KC,Lab,Witch
this could be played
KC -> Lab -> Witch
or
Lab -> KC -> Witch
which would the simulator choose?
I would usually choose the latter one, except for very action heavy decks.

Do I understand it correctly, that by using the "normal" action selection for the KC, the +2 actions would be chosen before the +1 action/+x cards. If this is the case, this is most likely not what you want. KC on Lab is much better than KC on Village.

I think you can also improve the Horn of Plenty treasurePriority, as the current version cannot gain any 2 cost card. Furthermore the order of Bank, HoP should probably depend on the buyPriority list. Only if playing the Bank earlier allows me to buy a better card, I should play it before the HoP. Otherwise, the other way is better, as it increases the value of the Bank.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #19 on: October 26, 2011, 08:42:11 am »
0

Oh, I realized that when the current Action is chosen, it looks if the Actions will get multiplied by KC/TR, and if it's the case it rates TR>KC
Code: [Select]
"Throne Room" if wantsToPlayMultiplier and my.countInHand("King's Court") > 0
"King's Court" if wantsToPlayMultiplier
"Throne Room" if wantsToPlayMultiplier
What I don't understand why you test on countInHand("KC")>0, because if countInHand("KC")==0, the first TR will give an undefinded, the KC is not in hand so can't get played, so we play TR anyway, which we would have gotten if we hadn't tested on countInHand in the first line and deleted the third.
Logged

Jimmmmm

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1733
  • Shuffle iT Username: Jimmmmm
  • Respect: +1943
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #20 on: October 26, 2011, 08:48:55 am »
0

On the other hand, there are some times where you don't want to play the TR at all, like having KC-KC and TR and 3 actions. Without TR, you play all of them 3 times, with TR, you play all of them 2 times and have 2 unused KC left.
So maybe it's really to difficult and one should ignore the combination KC+TR at the moment.

Couldn't you just go TR - KC - KC and have a spare KC left over in case you draw more actions?

At the start of your turn yes, but not if you draw the TR after having played the KCs. Say KC-KC:(3xSmithy)+((TR:2xX)-(TR:2xY)-(TR:2xnothing))+(3xnothing) instead of
KC-KC-(3xSmithy)-(3xX)-(3xY).

PS: should paint a tree, but am to lazy

Right, I'm with you now.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +875
    • View Profile
Re: Help decide on a TR/KC priority list
« Reply #21 on: October 26, 2011, 10:01:07 am »
0

Oh, I realized that when the current Action is chosen, it looks if the Actions will get multiplied by KC/TR, and if it's the case it rates TR>KC
Code: [Select]
"Throne Room" if wantsToPlayMultiplier and my.countInHand("King's Court") > 0
"King's Court" if wantsToPlayMultiplier
"Throne Room" if wantsToPlayMultiplier
What I don't understand why you test on countInHand("KC")>0, because if countInHand("KC")==0, the first TR will give an undefinded, the KC is not in hand so can't get played, so we play TR anyway, which we would have gotten if we hadn't tested on countInHand in the first line and deleted the third.

You're right. I was thinking I was making sure that it would prefer KCing an action to TRing it if it had the choice. But you correctly point out that it'll just TR the KC anyway before it ever considers other actions.

I'll make the suggested simplification, which saves us a call to countInHand.
Logged
Pages: [1]
 

Page created in 0.084 seconds with 20 queries.