Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3 ... 6  All

Author Topic: Geronimoo's Dominion Simulator: the ultimate simulation tool  (Read 21555 times)

0 Members and 1 Guest are viewing this topic.

Geronimoo

  • Jester
  • *****
  • Offline Offline
  • Posts: 936
  • Isotropic username: Geronimoo
  • Respect: +548
    • View Profile
    • Geronimoo's Dominion Simulator
+8

Want to find out how fast your nifty Envoy/Village gets 4 Provinces and sick of trying out your strategy on solitaire isotropic?

Just simulate it!

More info can be found here:
http://dominionsimulator.wordpress.com/

This is very much a work in progress, so your input is greatly appreciated (both in finding bugs and suggesting features)
« Last Edit: September 15, 2011, 04:32:11 am by Geronimoo »
Logged

DStu

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2324
  • Isotropic username: DStu
  • Respect: +1297
    • View Profile
Re: Do it yourself!!!
« Reply #1 on: June 22, 2011, 10:43:58 am »
0

Very nice.

Of course it would be nice if you could (at least for some cards) specify "play rules" like you specify "buy rules", but I'm afraid this would more or less double the work for programming...
Logged

theory

  • Administrator
  • *****
  • Offline Offline
  • Posts: 2948
  • Isotropic username: theory
  • Respect: +4098
    • View Profile
    • Dominion Strategy
Re: Do it yourself!!!
« Reply #2 on: June 22, 2011, 10:57:51 am »
0

Play rules for 90+% of the cards would be pretty useless.

I noticed, however, that Native Village has three "PlayStrategy" options.  Any way to edit/view/create such PlayStrategies?
Logged

theory

  • Administrator
  • *****
  • Offline Offline
  • Posts: 2948
  • Isotropic username: theory
  • Respect: +4098
    • View Profile
    • Dominion Strategy
Re: Do it yourself!!!
« Reply #3 on: June 22, 2011, 11:07:51 am »
0

My feedback:

* I would have Colony be a tick-box.  This screws up a ton of buy rules, but it seems more intuitive.  Perhaps if every strategy had Buy Colony at the top, and Buy Province as "if numColoniesInSupply < 4"
* Maybe make PPR be a tick-box.

I am super excited about this program.  We've been playing with it for a little while and I think it reveals some very interesting factoids.  Namely, that Minion is a lot worse than we all thought ...
Logged

DStu

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2324
  • Isotropic username: DStu
  • Respect: +1297
    • View Profile
Re: Do it yourself!!!
« Reply #4 on: June 22, 2011, 11:11:00 am »
0

Yepp, most of the time you don't need them. But I would guess for
Remodel, Upgrade, Workshop, Ironworks etc

so everywhere where you gain some cards it would be nice to specify which you want to gain under which conditions. Or am I missing something and this is possible. I also don't really see what you mean by the "PlayStrategy Options". So clearly I'm missing something..

Logged

theory

  • Administrator
  • *****
  • Offline Offline
  • Posts: 2948
  • Isotropic username: theory
  • Respect: +4098
    • View Profile
    • Dominion Strategy
Re: Do it yourself!!!
« Reply #5 on: June 22, 2011, 11:15:52 am »
0

Thinking more about it, I'm not sure that there's any way to program in intelligent play rules for cards like Apprentice.  There's just not enough space to encompass that decision.

But I am indeed curious about how Workshop, Remodel, and Ironworks are implemented by default. 
Logged

Death to Sea Hags

  • Thief
  • ****
  • Offline Offline
  • Posts: 90
  • Isotropic username: Death to Sea Hags
  • Respect: +17
    • View Profile
Re: Do it yourself!!!
« Reply #6 on: June 22, 2011, 11:40:34 am »
0

My feedback:

* I would have Colony be a tick-box.  This screws up a ton of buy rules, but it seems more intuitive.  Perhaps if every strategy had Buy Colony at the top, and Buy Province as "if numColoniesInSupply < 4"
* Maybe make PPR be a tick-box.

I am super excited about this program.  We've been playing with it for a little while and I think it reveals some very interesting factoids.  Namely, that Minion is a lot worse than we all thought ...

This I was starting to suspect.  I kinda resent must-buy cards that drive the game to a one-dimensional race.  And I've been surprised at how often I can skip Minions (or only get 1-2) and still win.  Granted, 7+ Minions will still rofl-stomp you in a Kingdom without cursing attacks, trashing, or +Action, but still... 
Logged

Death to Sea Hags

  • Thief
  • ****
  • Offline Offline
  • Posts: 90
  • Isotropic username: Death to Sea Hags
  • Respect: +17
    • View Profile
Re: Do it yourself!!!
« Reply #7 on: June 22, 2011, 11:43:18 am »
0

Thinking more about it, I'm not sure that there's any way to program in intelligent play rules for cards like Apprentice.  There's just not enough space to encompass that decision.

Maybe heuristics could be drawn from the Councilroom data?  Search all games with Apprentice in similar Kingdoms, look for similar hands at similar game stages and deck-sizes, see how those players are ranked/how they performed in-game, generate a best-guess?
Logged

theory

  • Administrator
  • *****
  • Offline Offline
  • Posts: 2948
  • Isotropic username: theory
  • Respect: +4098
    • View Profile
    • Dominion Strategy
Re: Do it yourself!!!
« Reply #8 on: June 22, 2011, 12:06:19 pm »
0

Thinking more about it, I'm not sure that there's any way to program in intelligent play rules for cards like Apprentice.  There's just not enough space to encompass that decision.

Maybe heuristics could be drawn from the Councilroom data?  Search all games with Apprentice in similar Kingdoms, look for similar hands at similar game stages and deck-sizes, see how those players are ranked/how they performed in-game, generate a best-guess?
That'd be something for rspeer's Golem project.
Logged

Geronimoo

  • Jester
  • *****
  • Offline Offline
  • Posts: 936
  • Isotropic username: Geronimoo
  • Respect: +548
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Do it yourself!!!
« Reply #9 on: June 22, 2011, 12:23:53 pm »
0

Please be careful of drawing conclusions from simulations with cards like Minion, Apprentice, Haven... Basically any card requiring non-trivial decisions.
I programmed a set of play rules for each card but they don't cover every possible situation (far from it). As an example here are the simulator's play rules for Minion:

If I have more Minions in hand or playing it for +$2 enables me to buy a Minion or a Province, play it for $2. Otherwise play it for the attack.

This works fine for a small deck that contains only Minions and money, but if you buy it in another strategy it will not act like you want it to!
Logged

Taqman

  • Herbalist
  • **
  • Offline Offline
  • Posts: 8
  • Respect: 0
    • View Profile
Re: Dominion Simulator available for download!
« Reply #10 on: June 22, 2011, 12:51:02 pm »
0

Is there anyway we can see the play rules for each card so I know what assumptions I'm making in these sims?

This is amazing by the way.
Logged

WanderingWinder

  • Governor
  • *****
  • Offline Offline
  • Posts: 4718
  • Isotropic username: WanderingWinder
  • Respect: +3352
    • View Profile
    • WanderingWinder YouTube Page
Re: Dominion Simulator available for download!
« Reply #11 on: June 22, 2011, 02:00:33 pm »
0

I have a new favourite toy :D
Is there any way we could make "Total number of cards in my deck" an option we can play with?

Zaphod

  • Spy
  • ****
  • Offline Offline
  • Posts: 87
  • Isotropic username: Zaphod
  • Do you know where your towel is?
  • Respect: +10
    • View Profile
Re: Dominion Simulator available for download!
« Reply #12 on: June 22, 2011, 02:23:18 pm »
0

Very impressive!

Echoing Taqman's request...you can see the buy rules by clicking edit/create, but I'm not sure what the rules are for playing actions.  For example...how does it determine which cards are trashed by Chapel?  If there are two terminal action cards and only one action available, which gets played?  In what order are cards trashed with Bishop/Apprentice/etc.?  When does Minion play +2 coin and when does it toss the hand?

I hope these questions aren't annoying you too much.  I'm just curious as to how you worked the rules out, and if we have any way to tweak them, if we wish to experiment.
Logged

Graystripe77

  • Duke
  • *****
  • Offline Offline
  • Posts: 375
  • Goko username: TheHyenaFurry
  • Isotropic username: Graystripe77
  • 1.61803398874989...
  • Respect: +66
    • View Profile
    • Dreamkeeperscomic.com
Re: Dominion Simulator available for download!
« Reply #13 on: June 22, 2011, 03:10:26 pm »
0

I've been trying out the simulator, and for some reason, when i have three strategies that had been tested, and i want to take one away to test just two, there doesn't seem to be a way to do that. Help?
Logged

rspeer

  • Duke
  • *****
  • Offline Offline
  • Posts: 392
  • Isotropic username: rspeer
  • Respect: +473
    • View Profile
Re: Dominion Simulator available for download!
« Reply #14 on: June 22, 2011, 03:23:50 pm »
0

Is the source code available?

The big thing slowing me down on my AI is that I don't want to have to program heuristics for how to play every card. If there are a bunch of reasonable heuristics that Geronimoo's already written, I'd like to just use those.
Logged

WanderingWinder

  • Governor
  • *****
  • Offline Offline
  • Posts: 4718
  • Isotropic username: WanderingWinder
  • Respect: +3352
    • View Profile
    • WanderingWinder YouTube Page
Re: Dominion Simulator available for download!
« Reply #15 on: June 22, 2011, 03:31:45 pm »
0

Graystripe: pick the dropdown, and then at the very top there's a blank line. Pick that, and you've eliminated that player.

Graystripe77

  • Duke
  • *****
  • Offline Offline
  • Posts: 375
  • Goko username: TheHyenaFurry
  • Isotropic username: Graystripe77
  • 1.61803398874989...
  • Respect: +66
    • View Profile
    • Dreamkeeperscomic.com
Re: Dominion Simulator available for download!
« Reply #16 on: June 22, 2011, 03:37:05 pm »
0

Graystripe: pick the dropdown, and then at the very top there's a blank line. Pick that, and you've eliminated that player.

Well, thanks!  (Kinda feel a little stupid now)
Logged

flymolo

  • Herbalist
  • **
  • Offline Offline
  • Posts: 7
  • Isotropic username: flymolo
  • Respect: 0
    • View Profile
Re: Dominion Simulator available for download!
« Reply #17 on: June 22, 2011, 05:06:54 pm »
0

I tried to simulate Ironworks Gardens, but it's not quite right because I can't check whether I have multiple ironworks in hand or how many actions I have left if I want to add in villages, and need to gain actions to avoid terminal collision.

I don't mean to complain.  I'm a computer programmer too, and I know the dangers of wouldn't it be great if.
This is awesome, and we just want to make it better.

I'll put my time where my mouth is, if source code becomes available.  But it's your project and you are entitled to release or not release your code in any manner you wish. 
Logged

danshep

  • Navigator
  • ****
  • Offline Offline
  • Posts: 70
  • Isotropic username: danshep
  • Respect: +13
    • View Profile
Re: Dominion Simulator available for download!
« Reply #18 on: June 22, 2011, 08:34:29 pm »
0

If you are willing to share the source code, I'm a java and ruby programmer by trade and would love to build a DSL for more complex bots using jruby. Building more complex bots really requires a full programming language.

Ruby modules would be great for including card-specific strategies.

I'm thinking something like:

Code: [Select]
strategy 'Big Money A' do
  include BasicCardStrategies
  def buy_options
    return 'province' if coins > 8 && deck['gold'] > 1
    if piles['province'] <= 3
      return 'duchy' if coins > 5
      return 'estate'
    else
      return 'gold' if coins > 6
      return 'smithy' if piles['smithy'] > 0 && deck['smithy'] == 0
      return 'silver' if coins > 3
    end
  end
end
Logged

DG

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2732
  • Respect: +1203
    • View Profile
Re: Dominion Simulator available for download!
« Reply #19 on: June 22, 2011, 09:42:16 pm »
0

I'd be very careful about decisions. I've run the bot just once to look at a simple game with 1 upgrade, 1 moneylender, and money. When the bot came to a hand with upgrade, gold, silver, copper, province, it played the upgrade and drew the moneylender. It trashed the copper with the upgrade, played the moneylender with no copper, and bought a duchy. Perhaps though it should have trashed the moneylender for a duchy and bought a duchy or gold. Perhaps it should have trashed a silver for another 4 card, trashed the copper with the moneylender and bought a duchy or gold. Perhaps it should have trashed the province (for nothing) just to buy a province and empty the pile. The decisions are not trivial.

There are also too many card combinations to code individually. For example you might always play a pearl diver before an upgrade, or always play a lookout before an upgrade, but deciding the order to play a lookout and a pearl diver is not simple.
« Last Edit: June 22, 2011, 09:50:12 pm by DG »
Logged

rrenaud

  • Administrator
  • *****
  • Offline Offline
  • Posts: 952
  • Isotropic username: rrenaud
  • Uncivilized Barbarian of Statistics
  • Respect: +1032
    • View Profile
    • CouncilRoom
Re: Dominion Simulator available for download!
« Reply #20 on: June 22, 2011, 10:03:45 pm »
0

The perfect is the enemy of the good.

I'd much rather see a system where we leverage the incremental improvements of 10 or 20 skilled players gradually improving the play heuristics and getting better and better bots than us just giving up because getting it perfect is too hard.
Logged

Kirian

  • Governor
  • *****
  • Offline Offline
  • Posts: 4594
  • Goko username: Kirian
  • An Unbalanced Equation
  • Respect: +5060
    • View Profile
Re: Dominion Simulator available for download!
« Reply #21 on: June 23, 2011, 01:49:15 am »
0

Something in this screams "genetic algorithm" but, well, good luck programming that.  I can envision the idea, but I think it would be a monumental task--of which one major problem would be one of "encoding" the genes for an algorithm.

...but deciding the order to play a lookout and a pearl diver is not simple.

I'm trying to imagine a situation in which I'd play Lookout first, but I can't think of one.
Logged
How many f.DS members does it take to fully describe an edge case?  Depends on the board.

rrenaud

  • Administrator
  • *****
  • Offline Offline
  • Posts: 952
  • Isotropic username: rrenaud
  • Uncivilized Barbarian of Statistics
  • Respect: +1032
    • View Profile
    • CouncilRoom
Re: Dominion Simulator available for download!
« Reply #22 on: June 23, 2011, 01:56:25 am »
0

It's near the end game, you want to find a Platinum to buy the final Colony, you play the Lookout to draw it near, and then the Pearl Diver to take it into your deck.
Logged

rspeer

  • Duke
  • *****
  • Offline Offline
  • Posts: 392
  • Isotropic username: rspeer
  • Respect: +473
    • View Profile
Re: Dominion Simulator available for download!
« Reply #23 on: June 23, 2011, 03:48:09 am »
0

Something in this screams "genetic algorithm" but, well, good luck programming that.  I can envision the idea, but I think it would be a monumental task--of which one major problem would be one of "encoding" the genes for an algorithm.

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?
Logged

Geronimoo

  • Jester
  • *****
  • Offline Offline
  • Posts: 936
  • Isotropic username: Geronimoo
  • Respect: +548
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Dominion Simulator available for download!
« Reply #24 on: June 23, 2011, 07:58:31 am »
0

Thanks for the feedback, guys!

I added a "How it works" tab which should clear up a lot of the questions. Check it out: http://dominionsimulator.wordpress.com/how-it-works/

Most people here are wondering about the play rules and that's going to be a very very hard thing to implement properly. I see these possibilities to tackle this:

1)create a system similar to the buy rules to let people define the play rules for a card
I don't think so. Determining what cards to buy has proven to be easy using just a few paramaters, but determining the correct play for a card involves many many decisions that we humans make without thinking, but will need to be explained one by one to the simulator. Just think about a card like Forge when you played Tactician the turn before: you know have 2^9 ways to play Forge... :)
2)use some kind of AI-technique to determine the best way to play a card
I've written a Magic:the Gathering automated Sealed Deck builder that used Genetic Algorithm to find the best 23-card deck out of 90 cards and it worked great because defining the genes was easy, but my head explodes when I try to work it out for Dominion. We'll need a University Professor in AI to work this out... I also doubt my Simulator provides a good framework to set this up
3)use councilroom data to determine the best play by mimicking the play of level20+ players in similar situations
This seems even harder than 2)
4)let experienced players who know JAVA program extra play rules for the cards (at least level10s probably but I doubt we can be picky here?)
Although this will probably lead to thousands of lines of ugly code and more bugs it's the most feasible option to improve the simulator in the near future. This will of course require me to make the code available to the public which I'm still pondering about... What platform would you suggest if I decide to do that (I have no experience with open source)

Regarding the extra features suggested:
-Colony and PPR tick boxes (theory): these seem like a good idea (although I'm not sure how to implement PPR yet)
-"total number of cards in deck" buy rule feature (WanderingWinder): I'll add this in the next release, finally an easy request :)
Logged
Pages: [1] 2 3 ... 6  All
 

Page created in 0.115 seconds with 22 queries.