Hello!
My future wife and I are huge Dominion fans. We’ve played several games a day over the last few years, and only recently decided to take a break.
During that time, I’ve learned I’m a better engineer than Dominioner and devised a secret scheme to program my way out of losing more often than not. I was quickly discovered and that began a journey of building a program that could take any situation or any set of cards and produce an optimal outcome. “Should only take a couple days”.
That was quite a while ago, but today I feel it’s in a state that it needs feedback from someone who isn’t in my head.
DominionSim is a WPF app with a C++ core. It’s built to be multi-threaded and with a UI that’s easy to describe game situations. It will run best on a high end, multi-core PC.
Internally, each turn has its action possibilities enumerated and by cloning the game, the action can be played and new possibilities can be enumerated. It doesn’t cheat by knowing the cards of the opponent or what exactly it will draw. But it does track cards it’s played and can reasonably guess what draw will come next to decide on what to play.
How is it different from Geronimoo’s simulator? There is no hard coded action or trash priority list. There are some hard coded responses to cards (like trashing opponents cards with Thief), but most situations are dealt by enumerating possibilities and choosing the one which gives the best result according to the player’s code.
My goal with DominionSim is to
explore interaction of cards which will generate human usable results. It's not there yet, but the essence is coming along.
So what stuff can it do?
- Solve a turn for likely best play.
- Analyze a game outcome from beginning, or any point in between
- Analyze a turn for possible outcomes
- Flexible language for coding priority gain, trash and play action lists with code complete.
- Everything is customizable. Change any pile content to anything. No limits on player count, starting cards, cards on the board, etc.
- Live output. Quickly iterate on games and use links to jump between states and tools.
- Undo, redo, save and restore all state or individual brains using XML.
- (FUTURE) Generate a new strategy that beats existing ones using genetic algorithms
- (FUTURE) Provide great turn prediction for what to do next (without actually playing the turn)
- (FUTURE) Flexible graphing
Stuff in progress:
- Only the first set of cards at this moment.
- Some cards generate large number of choices (Cellar) and can hang the game in extreme situations.
- Borrowed some strategies from Geronimoo’s simulator to seed the brains, but long way off from a robust set.
- It’s not done, this is beta, find the bugs.
Issues can be posted here or on git hub. Here's where to get it:
https://github.com/ChrisDS1/DominionSim/releasesThanks to anyone who gives it a try and gives feedback! This has been fun to build and I hope can be more than a science experiment that I've filled my free time with. Thanks to Geronimoo’s simulator for the inspiration to make this one.
Analyzing game outcomes:
Flexible language with code complete. Priority list can value Play-ing a card or Trash-ing a card over Gain-ing one.
Play Witch to win the game instead of gaining Province:
Analyze turns to find possible outcomes from drawing:
Find great results from complicated hands. Here it finds a way to play cards to get enough actions, then generate Silvers with Woodcutter, then draw them with Witch.