Dominion Strategy Forum

Dominion => Simulation => Topic started by: Schneau on April 23, 2012, 01:31:24 pm

Title: Simulator API
Post by: Schneau on April 23, 2012, 01:31:24 pm
I do research in evolutionary computation (http://en.wikipedia.org/wiki/Evolutionary_computation), and am interested in evolving Dominion bots. I was wondering if either of the simulators have an API that I could use. In particular, I would want to be able to send the simulator two bots and the number of games to play, and get back basic statistics such as winning percentages, average number of turns, etc.
Title: Re: Simulator API
Post by: DStu on April 23, 2012, 01:42:56 pm
Don't think so, but it shouldn't be too difficult to hook into Dominiate at https://github.com/rspeer/dominiate/blob/master/play.coffee to let it take some parameters.  I think about doing it from time to time, but didn't need it until now...
Title: Re: Simulator API
Post by: ftl on April 23, 2012, 03:40:09 pm
Geronimoo's simulator is open-sourced at the moment; if you know Java, you could just use the code, I think?
Title: Re: Simulator API
Post by: blueblimp on April 23, 2012, 06:19:40 pm
Both simulators are open source, so that is a good place to start.

Geronimoo's simulator github page: https://github.com/Geronimoo/Geronimoo-s-Dominion-Simulator (https://github.com/Geronimoo/Geronimoo-s-Dominion-Simulator)
Dominate's github page: https://github.com/rspeer/dominiate (https://github.com/rspeer/dominiate)
Title: Re: Simulator API
Post by: DG on April 23, 2012, 07:05:47 pm
This link might interest you as well  http://boardgamegeek.com/thread/647682/masters-thesis-on-dominion-ai (http://boardgamegeek.com/thread/647682/masters-thesis-on-dominion-ai).
Title: Re: Simulator API
Post by: Schneau on April 23, 2012, 08:28:15 pm
Sweet, thanks for the help all around. I'll have to contact the guy who wrote the AI in DG's link, it sounds like he does research similar to mine.
Title: Re: Simulator API
Post by: ecq on April 26, 2012, 04:35:28 pm
I've looked in this direction as well. Some thoughts:

Geronimoo's simulator is ridiculously fast.  Currently the code is fairly tightly coupled to the UI and card play rules, but I don't think it'd be too difficult to extract a jar that you could send XML files to and have it play the games with bots specified in those files.

Dominiate is much slower.  Since bots are CoffeeScript programs, I think it'd be much easier to implement EC algorithms using the simulator, but it will spend a longer time crunching numbers.

Neither is all that great when it comes to tricky cards like Menagerie and Possession.  For that reason, and for EC in general, it will be much easier to pick a well-defined problem.  Something along the lines of optimizing Big Money + X, what sequence to buy victory cards vs money, etc.

For two similar bots, the margin of victory for one over the other can be pretty low.  You may need thousands of games to be sure you're looking at signal and not noise in the win/loss percentages.

I've personally looked into implementing a pure Dominion API for this type of thing (also for bot competitions), but I'd want it to be something that both Dominiate and Geronimoo's simulator could use, and Geronimoo's is just too damn fast to replace.
Title: Re: Simulator API
Post by: Schneau on April 26, 2012, 04:45:01 pm
Neither is all that great when it comes to tricky cards like Menagerie and Possession.  For that reason, and for EC in general, it will be much easier to pick a well-defined problem.  Something along the lines of optimizing Big Money + X, what sequence to buy victory cards vs money, etc.
This is the kind of thing I was planning on starting with.

And thanks for your other comments. I'm thinking of using Geronimoo's simulator both because it's fast and I'm much more familiar with Java than Javascript or Coffeescript.