rspeer / dominiate

A simulator for Dominion card game strategies
http://rspeer.github.com/dominiate
MIT License
121 stars 43 forks source link

Pirate Ship bad decision bug #61

Open Jorbles opened 12 years ago

Jorbles commented 12 years ago

Pirate Ship when played doesn't choose to use it's money option until it reaches $5, which leads to it doing things like this:

== DoublePirateShip's turn 9 == DoublePirateShip plays Pirate Ship. ...attacking the other players. ...DoubleJack reveals [Copper, Jack of All Trades]. ...DoublePirateShip trashes DoubleJack's Copper. ...DoubleJack discards [Jack of All Trades]. ...DoublePirateShip takes a Coin token (4 on the mat). DoublePirateShip plays Silver. DoublePirateShip plays Silver. DoublePirateShip plays Copper. Coins: 5, Potions: 0, Buys: 1 DoublePirateShip buys Silver. (DoublePirateShip shuffles.) DoublePirateShip draws 5 cards: [Silver, Pirate Ship, Copper, Estate, Estate].

And this: == DoublePirateShip's turn 11 == DoublePirateShip plays Pirate Ship. ...attacking the other players. ...DoubleJack reveals [Silver, Silver]. ...DoublePirateShip trashes DoubleJack's Silver. ...DoubleJack discards [Silver]. ...DoublePirateShip takes a Coin token (5 on the mat). DoublePirateShip plays Silver. DoublePirateShip plays Copper. DoublePirateShip plays Copper. Coins: 4, Potions: 0, Buys: 1 DoublePirateShip buys Silver. DoublePirateShip draws 5 cards: [Silver, Copper, Silver, Copper, Copper].

Attacking other players when it should be buying Provinces.

bilts commented 12 years ago

I don't think this is a bad decision, at least not in a pure BM-Pirate Ship game.

When you choose money instead of attacking, you're not only giving up the token this turn, but you're one token poorer on all subsequent turns. Further, you're less likely to hit treasure in later attacks than in earlier ones in many cases.

I played with the parameters a little. Always buying a Province when possible loses slightly to the current strategy. As does starting to buy Provinces with fewer than 5 tokens.

You can mess with the method yourself. Just add this to your script (similar to gainPriority):

  pirateShipPriority: (state, my) -> [
    'coins' if state.current.mats.pirateShip >= 5 and state.current.getAvailableMoney()+state.current.mats.pirateShip >= 8
    'attack'
  ]

That's the default. Change the if-condition to match how you think it should work and see if it can beat the default.