Dominion Strategy Forum

Dominion => Simulation => Topic started by: Geronimoo on August 21, 2011, 09:01:00 am

Title: Simulator minor fixes
Post by: Geronimoo on August 21, 2011, 09:01:00 am
I released a new version with some minor fixes (http://dominionsimulator.wordpress.com/2011/08/21/some-minor-fixes/) Download it here (http://users.telenet.be/jeroenaga/DominionSimulator.jar).

Also I added a new bot (NGN - Plenty Horny) that can be used on the board of WanderingWinder's latest article (http://dominionstrategy.com/2011/08/04/guest-article-planning-and-playing-a-new-strategy/). It will crush the Duchy/Duke strategy (COMBO - Duchy/Duke/HT).
Title: Re: Simulator minor fixes
Post by: Thisisnotasmile on August 21, 2011, 09:40:02 am
Thank you for making it resizable!
Title: Re: Simulator minor fixes
Post by: DStu on August 23, 2011, 02:25:10 am
A little bug report from me:

Version 1.1.0

I have problems with the copy/paste-Button, especially with the Paste-part of it. It works fine in the beginning, but when I there already are 2 bots in the simulator and I want to replace one by one from my clipboard, I can not use Copy/Paste as this would put the present bot in the clipboard.
When I first delete the present bot and press the Copy/Paste button afterwards, I get a NullPointerException.

Code: [Select]
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at be.aga.dominionSimulator.gui.DomGui.actionPerformed(DomGui.java:326)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Title: Re: Simulator minor fixes
Post by: DG on August 24, 2011, 10:02:58 am
The simulator seems to store the sample game logs in a hidden directory with a variety of other temporary files. Are these files ever cleaned out by the operating system or the simulator?
Title: Re: Simulator minor fixes
Post by: Graystripe77 on August 24, 2011, 01:28:41 pm
Can you make a list of 'gain' rules separate from buy rules, for cards like workshop and ironworks?
Title: Re: Simulator minor fixes
Post by: Geronimoo on August 24, 2011, 01:55:14 pm
@DG: the game logs are indeed save to your hard drive in your default temp-directory. They are not cleaned up by the simulator. No other files are saved. They can easily be found (and deleted) because they all start with "SimulatorSampleGame...".

@Graystripe: can you give an example where what's in your buy rules isn't the appropriate card to gain for Workshop or Ironworks?
Title: Re: Simulator minor fixes
Post by: DG on August 24, 2011, 02:50:58 pm
If there is ever any supporting documentation for the simulator, I'll request that information about these files is included. They can easily go under the radar and clog up people's disk space. A menu option to delete sample games would be good if that's easy to do.
Title: Re: Simulator minor fixes
Post by: Graystripe77 on August 24, 2011, 04:49:02 pm
In a strategy I like to play, I go big money while using 1-2 ironworks to gain caravans. I never buy the caravans.
Title: Re: Simulator minor fixes
Post by: rinkworks on August 24, 2011, 05:02:25 pm
@Graystripe: can you give an example where what's in your buy rules isn't the appropriate card to gain for Workshop or Ironworks?

I suspect the buy rules are exactly what you want for Workshop, but with Ironworks the bonuses can change the decision.  If you have $7 to spend, you might want to grab a Silver for the extra $1 even if Silver isn't your first choice for $4 or less.  If Great Hall or Island is on the table, the chances of wanting to use Ironworks to grab one of those -- without ever wanting to actually *buy* one -- is pretty high.
Title: Re: Simulator minor fixes
Post by: michaeljb on August 24, 2011, 05:40:06 pm
In a strategy I like to play, I go big money while using 1-2 ironworks to gain caravans. I never buy the caravans.

Maybe set the buy rules for Caravans so that it's only bought with 0 treasures in play? I imagine this would idea would also work for restricting Ironworks to getting Great Halls.

Code: [Select]
   <buy name="Caravan">
      <condition>
         <left type="countCardsInPlay" attribute="Copper"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Silver"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Gold"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Platinum"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
Title: Re: Simulator minor fixes
Post by: Graystripe77 on August 24, 2011, 05:47:16 pm
In a strategy I like to play, I go big money while using 1-2 ironworks to gain caravans. I never buy the caravans.

Maybe set the buy rules for Caravans so that it's only bought with 0 treasures in play? I imagine this would idea would also work for restricting Ironworks to getting Great Halls.

Code: [Select]
   <buy name="Caravan">
      <condition>
         <left type="countCardsInPlay" attribute="Copper"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Silver"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Gold"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
      <condition>
         <left type="countCardsInPlay" attribute="Platinum"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>

Hmmm, haven't tried that, thanks.
Title: Re: Simulator minor fixes
Post by: Geronimoo on August 24, 2011, 05:48:33 pm
You can also use the "available $" - condition to differentiate between buying and gaining a card (through Remodel, Ironworks etc)

Here's an easy example of a bot that will gain Great Halls with his Ironworks, but will never buy Great Halls:

Code: [Select]
<player name="_Ironworks">
   <buy name="Province"/>
   <buy name="Duchy">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="5.0"/>
      </condition>
   </buy>
   <buy name="Estate">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="2.0"/>
      </condition>
   </buy>
   <buy name="Gold"/>
   <buy name="Ironworks">
      <condition>
         <left type="countCardsInDeck" attribute="Ironworks"/>
         <operator type="smallerThan" />
         <right type="constant" attribute="1.0"/>
      </condition>
   </buy>
   <buy name="Great_Hall">
      <condition>
         <left type="countAvailableMoney"/>
         <operator type="equalTo" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
</player>
Title: Re: Simulator minor fixes
Post by: michaeljb on August 24, 2011, 11:15:16 pm
And of course, there's a simpler solution lol  :D