Dominion Strategy Forum
Dominion => Simulation => Topic started by: ancientcampus on July 23, 2015, 03:25:02 pm
-
Hey, does anyone have the code to implement the penultimate province rule on rspeer's Dominate simulator? Thanks!
-
I've never been quite sure what people mean by PPR and I strongly recommend against using whatever you think it means over actually thinking the endgame through because in many cases buying the PP is what maximizes your win % even if it "seems risky", but I guess it would be something like this:
gainPriority: (state, my) -> [
"Province" if my.ai.buyProvince(state, my)
[...]
getScore: (state, my) ->
for status in state.getFinalStatus()
[name, score, turns] = status
if name == my.ai.toString()
myScore = score
else
opponentScore = score
return myScore - opponentScore
buyProvince: (state, my) ->
scoreDiff = my.ai.getScore(state, my)
boolDiff = (scoreDiff < 0 and scoreDiff > -3)
boolPP = (state.countInSupply("Province") == 2)
return not (boolDiff * boolPP)
The "> -3" part is there because if a Duchy doesn't even put you ahead, your best shot is almost certainly (in a silly BM mirror at least) to buy both Provinces, something that's impossible without buying the penultimate one.
Some brief testing on 40k games of JourneymanBM showed including this PPR rule made no significant difference, which is about what I'd expect because it's so highly situational.
-
I've never been quite sure what people mean by PPR and I strongly recommend against using whatever you think it means over actually thinking the endgame through because in many cases buying the PP is what maximizes your win % even if it "seems risky"
Very good advice. Thanks for the code! Interesting to hear it made no difference in Journeyman BM.
-
Journeymen are good at hitting 8 coins in the endgame so the PPR is less relevant. Generally the PPR will add 1-2% to the win rate in a big money game. That not might seem much but remember that the PPR can only be applied in a small percentage of games anyway. The PPR is likely to provide a reasonable advantage in the games where it can be applied.
-
If anywhere, it would be here.
http://rspeer.github.io/dominiate/docs/basicAI.html
Ctrl-F doesn't seem to find any mentions of Province that mention PPR, so odds are it's just not in there.
EDIT: Unless you mean code to implement it for a new strategy that isn't already coded in. Then just go with what SCSN said.