Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: Geronimoo's Dominion Simulator on Github  (Read 5950 times)

0 Members and 1 Guest are viewing this topic.

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +868
    • View Profile
    • Geronimoo's Dominion Simulator
Geronimoo's Dominion Simulator on Github
« on: January 25, 2012, 03:48:53 pm »
+13

https://github.com/Geronimoo/Geronimoo-s-Dominion-Simulator

So yeah, I've finally decided to open source my simulator. Since the official app will have a very simple AI (according to Jay) my simulator can be a good alternative: seemingly strong AI because of strong buy scripts and decent built-in play rules. Now we only need to write the playing interface that uses simulator engine. I already started with a basic GUI, but I suck and hope someone else is better at that stuff.

This is my first open source project (and setting up Github was a pain despite all the tutorials), so any advice is going to be helpful...
Logged

^_^_^_^

  • Minion
  • *****
  • Offline Offline
  • Posts: 502
  • Crazy, You Have Been Warned
  • Respect: +111
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #1 on: January 25, 2012, 04:08:50 pm »
0

Question: I downloaded the zip file and unzipped it but I can't seem to figure out how to use the simulator itself. The ReadMe also comes up blank o.O.
Logged
"Chicken Chicken Chicken"-Doug Z
"Chicken Chicken Chicken"-Donald X
The cost to buy me is 5Copper. What's Your Cost?

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #2 on: January 25, 2012, 04:11:37 pm »
0

+100
Logged

ftl

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2056
  • Shuffle iT Username: ftl
  • Respect: +1345
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #3 on: January 25, 2012, 04:17:37 pm »
0

Awesome!!!

BTW, your code is very nice.

Logged

ftl

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2056
  • Shuffle iT Username: ftl
  • Respect: +1345
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #4 on: January 25, 2012, 04:18:49 pm »
0

Question: I downloaded the zip file and unzipped it but I can't seem to figure out how to use the simulator itself. The ReadMe also comes up blank o.O.

If you want to just use the simulator, you don't need to get the source code, just go to http://dominionsimulator.wordpress.com/ and click on the 'launch the simulator' button in the top left.
Logged

ecq

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 224
  • Respect: +162
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #5 on: January 25, 2012, 07:14:12 pm »
0

Awesome!  Thanks for this.

DomDeck#doOverhandShuffle and DomDeck#doRiffleShuffle intrigue me.
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +868
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Geronimoo's Dominion Simulator on Github
« Reply #6 on: January 26, 2012, 04:29:57 am »
0

DomDeck#doOverhandShuffle and DomDeck#doRiffleShuffle intrigue me.
I coded these to find out if the shuffling IRL has an impact on the win rate. This was after I didn't reach the final in a real life tournament. I got last place in a match where according to simulations I had a 65% win rate and the girl finishing second had only 3%. I noticed I rigorously riffle shuffled while my opponents did 2 overhand shuffles (which isn't really shuffling), so I thought their less shuffled decks might have improved their win rate.
I found out the different shuffling has an impact, but sometimes more randomness was better and sometimes not. Also, I think my implementation of these shuffling techniques could be improved to better copy a human shuffling. Feel free to play with it/improve it/incorporate it into the editor.
Logged

ecq

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 224
  • Respect: +162
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #7 on: January 26, 2012, 11:05:30 am »
+1

DomDeck#doOverhandShuffle and DomDeck#doRiffleShuffle intrigue me.
I coded these to find out if the shuffling IRL has an impact on the win rate. This was after I didn't reach the final in a real life tournament. I got last place in a match where according to simulations I had a 65% win rate and the girl finishing second had only 3%. I noticed I rigorously riffle shuffled while my opponents did 2 overhand shuffles (which isn't really shuffling), so I thought their less shuffled decks might have improved their win rate.
I found out the different shuffling has an impact, but sometimes more randomness was better and sometimes not. Also, I think my implementation of these shuffling techniques could be improved to better copy a human shuffling. Feel free to play with it/improve it/incorporate it into the editor.

The bigger issue, especially in a tournament setting, comes when the human is aware of his or her shuffling patterns. 

It's easy to keep track of the general location of cards if you're just doing a couple of overhand shuffles.  If you're conscious about it, you can use the information when making game decisions.  You can also use different shuffles to impact game play.  Is your Mountebank near the bottom of your discard pile?  Make sure that part of the deck ends up in the middle so it doesn't miss the next shuffle.  Lots of terminal collisions recently?  Shuffle thoroughly.  Terminals nicely spread out?  Give the deck a couple of quick overhand shuffles.

Anyhow, I don't mean to derail this thread.  I think it's really cool that you were looking into this, and it's really cool that you've open-sourced the simulator so the rest of us can reason about these things.
Logged

theory

  • Administrator
  • *****
  • Offline Offline
  • Posts: 3603
  • Respect: +6125
    • View Profile
    • Dominion Strategy
Re: Geronimoo's Dominion Simulator on Github
« Reply #8 on: January 26, 2012, 12:24:21 pm »
0

Also, I assume Geronimoo implemented a mostly random overhand shuffle, and that is a kindly but perhaps naive assumption to make of your opponents.
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +868
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Geronimoo's Dominion Simulator on Github
« Reply #9 on: January 31, 2012, 02:49:14 am »
0

So is anyone going to help me out with the playing interface? I'm a bit stuck there...
Logged

ecq

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 224
  • Respect: +162
    • View Profile
Re: Geronimoo's Dominion Simulator on Github
« Reply #10 on: February 16, 2012, 11:19:08 am »
0

So is anyone going to help me out with the playing interface? I'm a bit stuck there...

I've been looking at the code here and there.  Programming in my spare time will be so much easier when Isotropic shuts down :P.  I think there are two things that make the play interface challenging, one legal/ethical and one technical.

On the legal/ethical side, writing a play interface that could be an alternative to the official app is begging for a cease and desist letter.  Currently the simulators will almost certainly be allowed to stick around because they don't compete with the official product but supplement it.  Transforming one into a single-player game seems like it crosses a line.

On the technical side, looking through the code, it seems like it's pretty hard to do.  The problem is that the card definitions are very tightly coupled with how they're played.  So, for instance, the ApprenticeCard class not only defines what Apprentice does but it also picks a card to trash.  It needs to give +1 action, ask the current player to pick a card to trash, then give +cards.  The current player would be a Java interface that could be implemented by a bot containing the current trashing logic or some code that prompts a human player for a card to trash.  Implementing this would mean gutting the code, though.

I don't think you should add a playing interface on account of the legal/ethical point; however, I do think that separating card definitions from play decisions is a good thing to do for other reasons (maintainability, interop, ability to swap out play styles, user-defined AIs, etc).
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +868
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Geronimoo's Dominion Simulator on Github
« Reply #11 on: February 17, 2012, 08:10:58 am »
0

Thanks for looking into it ecq. I don't think the legal/ethical thingy is an issue as long as we're not using the official card images.

The technical thingy is what's been keeping me from working further on it. I realized as you did that all the cards need to be refactored so the play decisions are no longer part of the card, but rather a stand alone AI-class(es).

I'm very curious to see how strong the AI will be of the official app, but if it's rather basic as suggested by Jay, the simulator engine should be a very strong alternative and it's going to be worth it to do all the refactoring.

If in the meantime anyone should start the work, I'll be happy to help, but for now I'm a bit bored with it.
Logged
Pages: [1]
 

Page created in 0.046 seconds with 22 queries.