901
Game Reports / Re: Familiar on a strong Remodel board
« on: June 25, 2011, 02:58:44 pm »
I think if you hit the turn 4 familiar, you are would have breezed to the win.
I still like the very simple play: Talisman, Royal Seal, Copper. Buy a Treasure Map...get another one...both go on the deck.
Well, I've never seen a genetic algorithm that was worth the time it takes to run, but I am using a different machine learning technique (stochastic gradient descent) in my code to determine what to buy. It's basically just fitting a hugely multivariate function whose input is your deck and an opponent's deck, and whose output is the probability that you win against that opponent.
It seems like I could adapt this kind of thing to the play of an individual hand, by making the input be your hand, number of actions, cards in play, etc. and the output be... money? Value of cards gained/bought? Improvement in your win probability as determined by the other function? I kind of like that last one.
What I would need is a lot of data about the intermediate stages one's hand goes through. I don't think dominionstats (the CouncilRoom code) currently does this; it only tracks the changes to decks, not hands. Is there existing code that can parse this from the game logs, or would I have to write it?
#!/usr/bin/python
import random
GOOD_P_MAX = 120
AVG_P_MAX = 100
def sim(strength_list):
outcomes = [random.random() * s for s in strength_list]
winner = max(outcomes)
# ignore ties, will basically never happen with random floats anyway.
return outcomes.index(winner)
def sim_many(strength_list, N):
ret = [0 for i in strength_list]
for i in xrange(N):
ret[sim(strength_list)] += len(strength_list)
for ind, v in enumerate(ret):
ret[ind] = v / float(N)
return ret
print sim_many([GOOD_P_MAX, AVG_P_MAX], 100000)
print sim_many([GOOD_P_MAX, AVG_P_MAX, AVG_P_MAX], 100000)
# sanity check that order doesn't matter
print sim_many([AVG_P_MAX, AVG_P_MAX, GOOD_P_MAX], 100000)
I'd skip the golem and treasure map combination until you get throne-ironworks-watchtower-golem-market in hand.