Dominion Strategy Forum

Please login or register.

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

Author Topic: Simulator update request  (Read 2711 times)

0 Members and 1 Guest are viewing this topic.

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1047
  • Respect: +843
    • View Profile
    • Geronimoo's Dominion Simulator
Simulator update request
« on: August 08, 2011, 07:51:44 am »
0

I'm working on a new release of my simulator. It will include this:

  • Walled Village
  • more than 20 number options (up to 100 and 0.5 included)
  • extra buy conditions (count all cards in deck, count buys left)
  • Colony game check box

If you are desperate for a feature, let me know now and I might still include it. Also I would like everyone to send me their own created bots so I might add them in the main program provided they are:

  • significant improvement of an existing bot
  • a competitive new bot
  • a wacky strategy

Please add a small description of what your bot is trying to do (so I don't need to dissect the buy rules)
Logged

DG

  • Governor
  • *****
  • Offline Offline
  • Posts: 4070
  • Respect: +2611
    • View Profile
Re: Simulator update request
« Reply #1 on: August 08, 2011, 08:05:39 am »
0

Could starting values please be defined as part of a script as well as on the main screen? At the moment all the starting values are lost whenever any of the scripts are changed.
Logged

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4733
  • Respect: +3327
    • View Profile
Re: Simulator update request
« Reply #2 on: August 08, 2011, 08:18:02 am »
0

Why not make the number options a fill-in instead of a combo-box?

Maybe an extra buy condition: Count action cards in deck, for Vineyard?

This simple Duchy/Duke/HT combo runs surprisingly well against BMU, BM-Militia and BM-Envoy:

Code: [Select]
<player name="COMBO - Duchy/Duke/HT">
   <buy name="Duchy"/>
   <buy name="Duke"/>
   <buy name="Horse_Traders"/>
   <buy name="Silver"/>
   <buy name="Estate">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="2.0"/>
      </condition>
   </buy>
   <buy name="Copper"/>
</player>

It rushes Duchies first, because these may be more vulnerable (opponent buying them) than the Dukes. HT is a very good helper card here. I left out Golds for simplicity, because my own simulations show Gold's impact is very small if it exists at all.

This bot was somewhat based on the front page article about Duchy/Duke, although it doesn't account for an opponent switching to Dukes when they become too dangerous.

Edit: Added Copper buy rule.
« Last Edit: August 08, 2011, 08:46:44 am by Davio »
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #3 on: August 08, 2011, 08:21:20 am »
0

First thanks for the work.

I posted a Chapel-Lab-BM variante here:
http://forum.dominionstrategy.com/index.php?topic=328.msg4300#msg4300
which beats the old one by 55:38.

For features: Is is possible to save and load the vxmls to/from disk?

@Davio: Buying Coppers will improve the bot.
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1047
  • Respect: +843
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Simulator update request
« Reply #4 on: August 08, 2011, 08:38:10 am »
0

For features: Is is possible to save and load the vxmls to/from disk?

This is already available: menu option "file"
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #5 on: August 08, 2011, 08:57:28 am »
0

Oh there is a menu...

Thanks
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #6 on: August 08, 2011, 09:10:42 am »
0

Ah one thing. I don't how much work this will do, but at the moment it is more or less impossible to track your opponents deck. At least if I haven't missed something again. For 2 player, the simulator tracks more or less everything you need, but you can't apply the mathematical operations to calculate what you want.

So if I want to check if may opponent has say 5 Cities: I know HIS:=his number of cities is, SUP:= number left on supply, MINE:= my number of Cities
HIS = 10 - SUPPLY - MINE.

So I would test on
5 = SUPPLY+MINE -> not possible because you can not have SUPPLY and MINE on the same side of the equation OR
5 - SUPPLY = MINE -> not possible because you can't get the minus in front of SUPPLY and add another number
5 - MINE = SUPPLY -> same story.

So if we just get the possibility to add an additional "times (-1)" in front of the buy condition?

Another thing. Is it possible to add a "It is already clear that the game will end after this turn"-Condition? To change the behaviour if Provinces, Colonies or 3 piles are out and let the bot grap as many VP as it could. Especially with 3-pile ending it is not always clear which pile will be the last one to run out, and say if 4 piles potentially run out and you really want to test if 3 of them are empty you have 4 clauses with each 3 conditions just to test on it.





Logged

kn1tt3r

  • Minion
  • *****
  • Offline Offline
  • Posts: 585
  • Respect: +278
    • View Profile
Re: Simulator update request
« Reply #7 on: August 08, 2011, 09:33:45 am »
0

Are there also "action" conditions, like trashing conditions for example?

Say you have Chapel, Silver, Copper Copper, Bishop in hand - what does the simulator do?

And can you add trash rules for Bishop? How is it played by default?
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1047
  • Respect: +843
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Simulator update request
« Reply #8 on: August 08, 2011, 09:53:52 am »
0

All "action" conditions (play rules) are hard coded and you can not change them. For two reasons: either picking the right action is trivial, or it's impossible to pick the right action for any given situation. So a choice has been made to hard code the play rules of the card in the simplest way which will cover most common situations. This has been discussed at length already and until some AI-wizard comes along it's going to remain this way.

This hand for example:
"Chapel, Silver, Copper Copper, Bishop"

The simulator sorts the actions in hand according to their "playingPriorityNumber". Bishop's is higher so that will be played (instead of Chapel). Then the Bishop-card implementation takes over and trashes the card in hand with the highest "trashPriorityNumber" which will be Copper.
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1047
  • Respect: +843
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Simulator update request
« Reply #9 on: August 08, 2011, 09:54:29 am »
0

@DG: thx for noticing this. Resetting of the starting conditions after modifying a bot was actually a bug. Should be fixed in next release.

@Davio: the number choice used to be a textbox to fill in manually, but a combobox allows for very fast modifications just using your mouse AND it's more aesthetic

@Davio: you can already count "action cards" in your deck for Vineyard. Just use "count type in deck" and choose type "action"

@Dstu: I could also add an extra buy condition "count in (all) opponent's decks" similar to the "count in deck". About your "It is already clear that the game will end after this turn"-Condition: since the bot will not buy any cards that will result in a loss, it won't matter much if he goes nuts buying VP's if the game will end this turn because he will have already won... But maybe you had something different in mind. Please elaborate than (example???)
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #10 on: August 08, 2011, 10:13:53 am »
0

@Dstu: I could also add an extra buy condition "count in (all) opponent's decks" similar to the "count in deck".
I also needed a little more arithmetics in some other case some time ago, but I can't remember what it was and it could also have been some "how many buys do I have"-workaround. So counting the opponents deck would in any case be fine.

Quote
About your "It is already clear that the game will end after this turn"-Condition: since the bot will not buy any cards that will result in a loss, it won't matter much if he goes nuts buying VP's if the game will end this turn because he will have already won... But maybe you had something different in mind. Please elaborate than (example???)
Yeah, that's of course true. Not sure if I was overoptimizing there, but of course, if the game will end, I by construction already have won.  A "Could I end the game this turn" condition on the other hand would be usefull, but I don't think that will be so easy.
Logged

WanderingWinder

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5275
  • ...doesn't really matter to me
  • Respect: +4368
    • View Profile
    • WanderingWinder YouTube Page
Re: Simulator update request
« Reply #11 on: August 08, 2011, 10:17:52 am »
0

Play rules are going to be too complicated guys.
I want to second the -1 option so that we can get information on what's in the opponent's deck. I also definitely want a total number of cards in deck, as well as the number of empty piles and maybe the number of cards in the pile which has the 3rd-least in it, to help try to figure 3-pile endings. I figure that's probably not too hard, whereas actually trying to figure out much more for 3-pile endings is going to be a bit difficult.
As for improving existing bots, it can be done for almost every one there is (if not every one), often pretty significantly. I wouldn't worry too much about it.
As for new strategies, it would be nice to have some, but I don't think there's tons and tons. I would definitely include the Duchy/Duke at least, and if I think of more, I will post them.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #12 on: August 08, 2011, 10:22:23 am »
0

All "action" conditions (play rules) are hard coded and you can not change them. For two reasons: either picking the right action is trivial, or it's impossible to pick the right action for any given situation. So a choice has been made to hard code the play rules of the card in the simplest way which will cover most common situations. This has been discussed at length already and until some AI-wizard comes along it's going to remain this way.

(Still) don't really see it. While I see that it would be a lot work, and it is definitly nothing for the next version, I don't see where the AI-type problem comes in. What people would want to do is to customly specify the rules you have specified, and it is none of your problem how well these rules fit. "Just" deliver the standard-play rules for each card like it is now, like you have standard-buy rules for some bots, and, like in the buy-rules, give an interface/vxml where you can change them depending on some conditions.

So from my point of view the problems for the simulator are exactly the same once like the once for the buy-rules. The AI problem is the one of the user.
Logged

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4733
  • Respect: +3327
    • View Profile
Re: Simulator update request
« Reply #13 on: August 08, 2011, 10:26:20 am »
0

The Duchy/Duke strat with Gold instead of HT still performs quite well against the baselines.
I have tried tweaking the number of Provinces left for Estate buys (emptying a 3rd pile may be good for the rusher), but this had negative effects. P <= 2 proved to still be the sweet spot.

Code: [Select]
<player name="COMBO - Duchy/Duke">
   <buy name="Duchy"/>
   <buy name="Duke"/>
   <buy name="Gold"/>
   <buy name="Silver"/>
   <buy name="Estate">
      <condition>
         <left type="countCardsInDeck" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="2.0"/>
      </condition>
   </buy>
   <buy name="Copper"/>
</player>

Extra: A way to actually play against the simulator! Although this may
a) Be very hard to program
b) Cause copyright infringements, since they had made public at the time of the whole BSW vs. Isotropic image usage debate that they at some point would release their own software version


Edit: I am also missing a BM - Witch strat. Maybe it's good to have baselines of all Cursers?
I find that I use these baselines a lot when I try to edit my own strategy.

Also, the BM - Sea Hag strat has some Remodels thrown in. I don't know if that is intentionally or a leftover of some tryout strategy.


Witch:
Code: [Select]
<player name="BM - Witch">
   <buy name="Province">
      <condition>
         <left type="countCardsInDeck" attribute="Gold"/>
         <operator type="greaterThan" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <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="Witch">
      <condition>
         <left type="countCardsInDeck" attribute="Witch"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="2.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
</player>
« Last Edit: August 08, 2011, 10:35:41 am by Davio »
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #14 on: August 09, 2011, 09:09:41 am »
0

So now that I know that I can save my bots I realize that I can't. Or bette, I can't load them. In Linux, the access to the path does not seem to be correct.

Say I want to save the bots in /home/Dominion/bots.xml. I can browse to /home/Dominion and say: save at bots.xml. It than saves it at
in directory "/home" in the file "Dominion\bots.xml". So with a backslash instead of a forward one.

So far, so good, if I now want to excess the file "Dominion\bots.xml" I get a pop-up stating "error reading file", and the console that runs the simulator prompts a "INFO - /home/Dominion/bots.xml". Note the forwardslash here. Nevertheless, if I copy by hand the "Dominion\bots.xml" to "/Dominion/bots" I get the same errormessages from pop-up and console.

Looking into the files, they seem alright, content is
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<playerCollection>
<player name="BM - Masquerade">
   <buy name="Province">
      <condition>
         <left type="countCardsInDeck" attribute="Gold"/>
         <operator type="greaterThan" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Duchy">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="4.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="Masquerade">
      <condition>
         <left type="countCardsInDeck" attribute="Masquerade"/>
         <operator type="smallerThan" />
         <right type="constant" attribute="1.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
</player>

<player name="BM - Courtyard">
   <buy name="Province">
      <condition>
         <left type="countCardsInDeck" attribute="Gold"/>
         <operator type="greaterThan" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Duchy">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="4.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="Courtyard">
      <condition>
         <left type="countCardsInDeck" attribute="Courtyard"/>
         <operator type="smallerThan" />
         <right type="constant" attribute="1.0"/>
      </condition>
      <condition>
         <left type="countCardsInDeck" attribute="Silver"/>
         <operator type="greaterThan" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
   <buy name="Courtyard">
      <condition>
         <left type="countCardsInDeck" attribute="Courtyard"/>
         <operator type="smallerThan" />
         <right type="constant" attribute="2.0"/>
      </condition>
   </buy>
</player>

<player name="BM - Smithy">
   <buy name="Province">
      <condition>
         <left type="countCardsInDeck" attribute="Gold"/>
         <operator type="greaterThan" />
         <right type="constant" attribute="0.0"/>
      </condition>
   </buy>
   <buy name="Duchy">
      <condition>
         <left type="countCardsInSupply" attribute="Province"/>
         <operator type="smallerOrEqualThan" />
         <right type="constant" attribute="4.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="Smithy">
      <condition>
         <left type="countCardsInDeck" attribute="Smithy"/>
         <operator type="smallerThan" />
         <right type="constant" attribute="1.0"/>
      </condition>
   </buy>
   <buy name="Silver"/>
</player>

</playerCollection>
Logged

Geronimoo

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1047
  • Respect: +843
    • View Profile
    • Geronimoo's Dominion Simulator
Re: Simulator update request
« Reply #15 on: August 09, 2011, 09:33:54 am »
0

@DStu: this is a bug. It's never a problem in Windows, but apparently the bug comes up in Linux. I'll try to get it fixed (but not sure it will be since I don't have Linux)
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1488
    • View Profile
Re: Simulator update request
« Reply #16 on: August 11, 2011, 04:58:18 am »
0

So the simulator does not play Coppers if he can buy a GM without playing them. Can we have something similar for Mint, where it only plays Coppers and maybe Silvers if he would buy a Mint?
Logged
Pages: [1]
 

Page created in 0.229 seconds with 20 queries.