Dominion Strategy Forum

Dominion => Simulation => Topic started by: Jorbles on November 23, 2011, 07:28:23 pm

Title: Improvement on BankWharf
Post by: Jorbles on November 23, 2011, 07:28:23 pm
I often tend to buy Duchies at 4 instead of 5 and was wondering how that simulated. Interestingly it improved on BankWharf in Province games and Colony games (though only very slightly in Colony games). It did not improve the DoubleJack algorithm.

Code: [Select]
# Play Big Money including Banks, except buy Wharf with every $5 buy.
# This differs from Geronimoo's BankWharf in that Duchies are bought
# when there are only 4 Provinces left, instead of when there are only 5 left.
{
  name: 'BankWharfD4'
  author: 'Jorbles'
  requires: ['Bank', 'Wharf']
  gainPriority: (state, my) -> [
    "Colony" if my.countInDeck("Platinum") > 0
    "Province" if state.countInSupply("Colony") <= 6
    "Duchy" if state.gainsToEndGame() <= 4
    "Estate" if state.gainsToEndGame() <= 2
    "Platinum"
    "Bank"
    "Gold"
    "Wharf"
    "Silver"
    "Copper" if state.gainsToEndGame() <= 3
  ]
}
Title: Re: Improvement on BankWharf
Post by: DG on November 23, 2011, 08:30:25 pm

As a general rule, I find the simulators prefer buying duchies with 4 provinces remaining in a 2 player game and you can test up and down from there. In colony games the duchies should sometimes only bought with 2 colonies/provinces left in the supply. There is also quite a lot of advantage to be gained from the right purchasing conditions based on the supply piles, difference in vp scores, and so on. However, you're generally more interested in comparing different scripts for their action and treasure purchasing so you might as well have a simplified vp strategy in all the scripts and concentrate on the kingdom cards.
Title: Re: Improvement on BankWharf
Post by: Jorbles on November 24, 2011, 12:37:11 pm
Is it not better to optimize the simple strategies that we're comparing things to though? I get that we want things to be simple, but we're likely going to be tweaking whatever scripts we're building to optimize so shouldn't the default comparison scripts also be optimized?
Title: Re: Improvement on BankWharf
Post by: DG on November 24, 2011, 01:27:47 pm
Quote
I get that we want things to be simple, but we're likely going to be tweaking whatever scripts we're building to optimize so shouldn't the default comparison scripts also be optimized?
It depends what you want to do with your script. If you want to make a fantastic optimized script then yes, compare it against other optimized scripts. If you want to see whether buying an oasis or a silver might have improved a game from yesterday then perhaps it is a good idea to use a simple model. Detailed optimizations need to be reworked if you make high level changes. More conditions can often lead to more logic errors.
Title: Re: Improvement on BankWharf
Post by: rspeer on November 24, 2011, 02:01:46 pm
Awesome.

I can probably get to it later, but if you're really motivated, you could go on GitHub (https://github.com/rspeer/dominiate/), make a fork, and edit the strategy right there. I'd be happy to have each strategy be as good as it can be.
Title: Re: Improvement on BankWharf
Post by: Jorbles on November 24, 2011, 07:32:09 pm
I think I put the fork in, but I'm not very experienced with github.
Title: Re: Improvement on BankWharf
Post by: rspeer on November 27, 2011, 01:23:34 am
You did it right. It's now up on the site. Thanks.