Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 11 12 [13]  All

Author Topic: Dominiate: a Dominion simulator that runs on the Web  (Read 61810 times)

0 Members and 1 Guest are viewing this topic.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1481
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #300 on: March 14, 2015, 03:38:05 am »
0

Geronimoo's is java and works on Linux, certainly also works on mac
Logged

h1402686

  • Alchemist
  • ***
  • Offline Offline
  • Posts: 39
  • Respect: +31
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #301 on: April 26, 2015, 01:29:42 pm »
+1

I can't get Dominiate to play Lookout. The code in cards.coffee looks like the simulator should be happy to play Lookout until it gets close to the end of the game:

Code: [Select]
makeCard "Lookout", action, {
  ...

  ai_playValue: (state, my) ->
    if state.gainsToEndGame >= 5 or state.cardInfo.Curse in my.draw
      895
    else
      -5

}

Yet the following bot buys Lookout, but never plays it:

Code: [Select]
{
  name: 'LookBug'
  requires: ['Lookout']
  gainPriority: (state, my) -> [
    "Colony" if my.countInDeck("Platinum") > 0
    "Province" if state.countInSupply("Colony") <= 6 \
               or state.countInSupply("Province") <= 6
    "Duchy" if 0 < state.gainsToEndGame() <= 5
    "Estate" if 0 < state.gainsToEndGame() <= 2
    "Platinum"
    "Gold" if my.countInDeck("Gold") < 2
    "Lookout"
    "Silver"
  ]
}
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1481
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #302 on: April 26, 2015, 01:47:05 pm »
0

Found the bug.

My version is too far behind to patch fastly, but patch is in ai_value from Lookout
Code: [Select]
-- if state.gainsToEndGame >= 5 or state.cardInfo.Curse in my.draw
++ if state.gainsToEndGame() >= 5 or state.cardInfo.Curse in my.draw

gainsToEndGame is a function.
Logged

h1402686

  • Alchemist
  • ***
  • Offline Offline
  • Posts: 39
  • Respect: +31
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #303 on: April 26, 2015, 02:08:57 pm »
0

Thanks, DStu. Is there a way I can patch it for myself if I'm running from a browser? Just dumping the fixed makeCard code into the "Player 1" window in my browser doesn't work.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1481
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #304 on: April 26, 2015, 02:15:30 pm »
0

Thanks, DStu. Is there a way I can patch it for myself if I'm running from a browser? Just dumping the fixed makeCard code into the "Player 1" window in my browser doesn't work.

I don't thin you can patch, but you can workaround:

Code: [Select]
{
  name: 'LookBug'
  requires: ['Lookout']
  gainPriority: (state, my) -> [
    "Colony" if my.countInDeck("Platinum") > 0
    "Province" if state.countInSupply("Colony") <= 6 \
               or state.countInSupply("Province") <= 6
    "Duchy" if 0 < state.gainsToEndGame() <= 5
    "Estate" if 0 < state.gainsToEndGame() <= 2
    "Platinum"
    "Gold" if my.countInDeck("Gold") < 2
    "Lookout"
    "Silver"
  ]

  actionPriority: (state, my) ->
    if state.gainsToEndGame() > 5 or ...
       "Lookout"
   
}

so just add an actionPriority function to your bot, which returns a list containing the priorities you want your cards played. Note that you have to add all the cards of you bot there, as this overwrites the call of ai_value from cards (IIRC).  You might want to look into old_actionPriority in basicAI.cofffee if you have some more cards in your bot to see how they used to be prioritized.
Maybe
Code: [Select]
  actionPriority: (state, my) ->
    old_actionPriority(state,my)
does also work, at least Lookout is implemented correctly there, but there might be some newer cards (like from Guilds and Dark Ages) that are not listed there anymore.

:e corrected name of old_actionPriority.  Maybe you also have to reference it over the ai, in this case it is
Code: [Select]
my.ai.old_actionPriority(state,my)
I'm not sure what exactly the scope is from which the code is called here.

edit: OK, actionPriority seems to be not called anymore, it's now playPriority if I understand this correctly. Problem is that this one is merged with the Treasures, so you must inculde all the treasures in your list, too, otherwise the bot does not play Treasures.
« Last Edit: April 26, 2015, 02:48:56 pm by DStu »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1481
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #305 on: April 26, 2015, 03:04:32 pm »
0

Yeah, why and since when don't we call actionPriority anymor when it exists? It feels like playPriority is much more of a hassle to define costumely, as you also have to care for tje Treasures.  So why is this mixed?
Logged

h1402686

  • Alchemist
  • ***
  • Offline Offline
  • Posts: 39
  • Respect: +31
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #306 on: April 26, 2015, 03:21:13 pm »
+2

I ended up downloading the code and making the fix. As far as I can tell I couldn't push the fix so I created an issue instead: https://github.com/rspeer/dominiate/issues/85
Logged

h1402686

  • Alchemist
  • ***
  • Offline Offline
  • Posts: 39
  • Respect: +31
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #307 on: May 17, 2015, 04:47:24 pm »
+1

I made the following updates to the code:
  • Fixed the Lookout bug
  • Fixed another bug, this one related to trashing
  • Implemented Forager
I'm new to GitHub and am not sure I submitted the patch the right way, as I can't tell if anyone has seen it. So I'm posting it here as well: https://github.com/rspeer/dominiate/pull/86.

For fun, here's my first Forager result. When running SeaHag vs. a Forager/SeaHag bot, the Forager bot dominates, 89-11 (not surprisingly). Maybe more interesting, the Forager/SeaHag bot wants three Foragers and only one SeaHag. Code for the bots is attached.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1481
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #308 on: May 17, 2015, 05:12:35 pm »
0

I made the following updates to the code:
  • Fixed the Lookout bug
  • Fixed another bug, this one related to trashing
  • Implemented Forager
I'm new to GitHub and am not sure I submitted the patch the right way, as I can't tell if anyone has seen it. So I'm posting it here as well: https://github.com/rspeer/dominiate/pull/86.

For fun, here's my first Forager result. When running SeaHag vs. a Forager/SeaHag bot, the Forager bot dominates, 89-11 (not surprisingly). Maybe more interesting, the Forager/SeaHag bot wants three Foragers and only one SeaHag. Code for the bots is attached.

Looks fine.
Logged

joejoe22802

  • Pawn
  • **
  • Offline Offline
  • Posts: 3
  • Respect: +3
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #309 on: July 21, 2017, 05:49:26 pm »
0

Is this Git repo dead at this point or is there a fork that's still chugging?
Logged

Seprix

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5213
  • Shuffle iT Username: Seprix
  • Respect: +2761
    • View Profile
    • The Border Village
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #310 on: July 24, 2017, 12:27:44 pm »
+2

Is this Git repo dead at this point or is there a fork that's still chugging?

It's dead, Jim
Logged
the weed whackers will return
Pages: 1 ... 11 12 [13]  All
 

Page created in 0.075 seconds with 21 queries.