Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 6 7 [8] 9 10 ... 13  All

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

0 Members and 1 Guest are viewing this topic.

Quadell

  • Scout
  • ****
  • Offline Offline
  • Posts: 44
  • Respect: +107
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #175 on: April 11, 2012, 10:36:28 am »
0

I'm trying to simulate a Gardens-Workshop-Moat strategy (if Moat is the only low-cost third kingdom card available), and I can't stop it from playing Moat instead of Workshop, which is disastrous for the strategy. How can I tell the simulator to prefer to play Workshop over Moat?
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #176 on: April 11, 2012, 10:41:35 am »
+1

There is always a better kindom card than Moat, namely Estate.

Anyway, what you want is

Code: [Select]
{
  name: 'Workshop, Gardens and Moat'
  author: 'Quadell'
  requires: ["Workshop", "Gardens", "Moat"]
  gainPriority: (state, my) -> [
    "Gardens"
    "Workshop"
    "Silver"
    "Moat"
    "Estate"
    "Copper"
  ]
 
  actionPriority: (state, my) -> [
    "Workshop"
    "Moat"
  ]
}
Not debugged, tested or even optimzied...
Logged

Quadell

  • Scout
  • ****
  • Offline Offline
  • Posts: 44
  • Respect: +107
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #177 on: April 11, 2012, 11:12:51 am »
0

Thanks! That works, and it will be useful to know how to do this in future tests. In this case it appears to be moot, as you point out, since this alone is pretty strong:
Code: [Select]
{
  name: 'Simplest Workshop-Gardener'
  author: 'Quadell'
  requires: ["Workshop", "Gardens"]
  gainPriority: (state, my) -> [
    "Workshop"
    "Gardens"
    "Estate"
    "Copper"
  ]
}

It beats Big Smithy, Double Jack, any simple cursing strategy, etc. You can improve this with Great Hall, Village, or Fishing Village, and probably others, but it looks to me like most $2-$3 cards (including Moat) just make it worse. Anyway, thanks again!
Logged

Quadell

  • Scout
  • ****
  • Offline Offline
  • Posts: 44
  • Respect: +107
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #178 on: April 12, 2012, 10:12:42 am »
0

Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +877
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #179 on: June 09, 2012, 06:53:04 pm »
+2

While Isotropic was down I finally finished my "aiPlayValue" branch (remember when I said I was working on this sometime in, oh, 2011) and merged it in. The AI's default preference for playing each card is now defined on the card, with a function called "ai_playValue", returning a number from -100 (avoid playing at all costs) to 1000 (OMG PLAY IT NOW).

This is a mechanism that generalizes: cards can define an "ai_xValue" function, for some x, and that function will be consulted by default when making decision x about that card. The decision named 'play' replaces the 'action' and 'treasure' decisions.

I used this mechanism for Throne Room and King's Court too, with a decision named "multiplied" that returns a value over 1000 if it's preferable to play the card with a multiplier. We could in fact define all the default decisions for a card on the card object, which is great for experimenting with variant cards!

Part of the point here was also to make it play faster, because it no longer has to evaluate the enormous actionPriority function all the time. In fact, the result is about a 10% speedup.

The bigger bottleneck is actually the "gainsToEndGame" function, which is called all the time by lots of different decisions. The value is saved in a cache, but apparently the cache is cleared way too often, so that would be the thing to look at next for efficiency. But other nice things to accomplish would be:

  • Implement and update the Optimized Big Money + action strategies
  • Create a meta-strategy that chooses the best OBM strategy
  • Make a nice way to add a variant card to the game
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #180 on: June 12, 2012, 03:56:49 pm »
0

But other nice things to accomplish would be:

  • Implement and update the Optimized Big Money + action strategies
  • Create a meta-strategy that chooses the best OBM strategy
  • Make a nice way to add a variant card to the game

I ignored all these and implemented a version of Develop. Runs at the moment, but needs some more testing before pull request.

edit: and there's no default play rules for Develop in the AI, and I'm not sure if these make any sense ;)
« Last Edit: June 12, 2012, 04:00:01 pm by DStu »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #181 on: June 17, 2012, 10:53:47 am »
0

So, I think I got a first version for Develop, including a little example bot on how to use it with Develop/Festival/Watchtower that loses to BM.

ai_playvalue still missing, not sure what's a good number...

edit: Sent a pull request, but I think it get messed with the old IGG-one which is still not solved...
« Last Edit: June 18, 2012, 02:26:44 pm by DStu »
Logged

blueblimp

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2849
  • Respect: +1559
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #182 on: August 06, 2012, 05:23:27 pm »
0

Grand Market has two values for ai_playValue:
Code: [Select]
makeCard "Grand Market", c.Market, {
  cost: 6
  coins: 2
  actions: 1
  cards: 1
  buys: 1
  # Grand Market is the only card with a non-constant mayBeBought value.
  mayBeBought: (state) ->
    not(c.Copper in state.current.inPlay)
  ai_playValue: (state, my) -> 795
  ai_playValue: (state, my) -> 880
}
In some versions of CoffeeScript, this causes a syntax error. In particular, version 1.3.3, which is the latest. (Although the current code in CoffeeScript's GitHub seems to let it pass, so I'm not sure what's going on there.) Anyway, I assume this is a typo, but I don't know whether it's supposed to be 795 or 880.
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +877
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #183 on: August 08, 2012, 03:11:38 am »
0

880 was supposed to be the multipliedPlayValue.

Anyway, I've implemented Sage, Poor House, and Graverobber! Here's a silly example:

Code: [Select]
# Sajak buys two Jacks of All Trades and a Sage.
{
  name: 'Sajak'
  author: 'rspeer'
  requires: ["Jack of All Trades", "Sage"]
  gainPriority: (state, my) -> [
    "Province" if my.getTotalMoney() > 15
    "Duchy" if state.gainsToEndGame() <= 5
    "Estate" if state.gainsToEndGame() <= 2
    "Gold"
    "Jack of All Trades" if my.countInDeck("Jack of All Trades") < 2
    "Sage" if my.countInDeck("Sage") < 1
    "Silver"
  ]
}
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +877
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #184 on: August 08, 2012, 03:13:18 am »
0

... On the other hand, it turns out that one Jack and a Sage is better than DoubleJack, 53% to 47%.
Logged

h1402686

  • Alchemist
  • ***
  • Offline Offline
  • Posts: 39
  • Respect: +32
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #185 on: December 01, 2012, 10:42:09 am »
+1

I've just been reading annotated game 2 (yes I am way behind), in which [spoiler alert] one of the players manages to buy 4 colonies in 15 turns using no kingdom cards other than apprentices. Doubtless there was some luck involved, but in solitaire play I can't get anywhere close. I must be choosing the wrong cards to trash with the apprentice. There's also some discussion in the comments about how this could have been done even more efficiently by mixing in other kingdom cards. This simulator looks like the best platform for exploring this. However, I know that it will be a while before I can learn how to use this simulator and do the exploration so I thought I'd post here in the hopes that someone will get interested and explore the question first.

EDIT: I believe Dominiate rather than Geronimoo's simulator is the correct platform here because it seems to allow you to override which cards get trashed.
« Last Edit: December 01, 2012, 10:43:12 am by h1402686 »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #186 on: December 01, 2012, 10:59:26 am »
0

Discussed this briefly (without Colonies) here last week.  I haven't done much optimization, but you should get a feeling on how to use the simulator in this case...
Logged

^_^_^_^

  • Minion
  • *****
  • Offline Offline
  • Posts: 502
  • Crazy, You Have Been Warned
  • Respect: +111
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #187 on: February 17, 2013, 11:15:20 pm »
0

Interestingly enough, this makes it appear that double Ambass is about equal in power to Witch/Chapel. W/C has only a slightly higher winning percentage.

Double Ambassador: 1640.5 wins (47.4%) ChapelWitch: 1817.5 wins (52.6%)
Logged
"Chicken Chicken Chicken"-Doug Z
"Chicken Chicken Chicken"-Donald X
The cost to buy me is 5Copper. What's Your Cost?

fprefect

  • Chancellor
  • ***
  • Offline Offline
  • Posts: 21
  • Respect: +18
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #188 on: September 09, 2013, 04:57:42 am »
0

Hello alltogether,

Has anyone got the coffeescripts run on Windows with node.js? For mee it sais always 'package coffee-script not available'. And yes: I installed coffee-script and added the paths to the PATH variable...

PS: Compiling the js files for the web gui works, but all the bots are not in the pull down menu...

fprefect
Logged

rspeer

  • Witch
  • *****
  • Offline Offline
  • Posts: 469
  • Respect: +877
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #189 on: September 21, 2013, 01:49:45 am »
+2

You might be able to tell I've kind of burned out on this project. Mostly because I get too few opportunities to play a good game of Dominion these days. I can feel everything I used to know about Dominion being pushed out of my mind to make room for other things. Sorry about that.

I believe my instructions for CoffeeScript on Windows are out of date. NodeJS for Windows exists now. I don't know exactly how to get from zero to CoffeeScript using that fact, but there's probably a much better way than using the non-Node thing I linked to.
Logged

ragingduckd

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #190 on: September 21, 2013, 03:17:21 am »
+2

You might be able to tell I've kind of burned out on this project. Mostly because I get too few opportunities to play a good game of Dominion these days. I can feel everything I used to know about Dominion being pushed out of my mind to make room for other things. Sorry about that.

I believe my instructions for CoffeeScript on Windows are out of date. NodeJS for Windows exists now. I don't know exactly how to get from zero to CoffeeScript using that fact, but there's probably a much better way than using the non-Node thing I linked to.

1. Install a virtual machine
2. Put linux on it
3. Follow rspeer's instructions

rspeer, I've been fiddling with this some and I just wanted to say thanks. It's a really elegant framework. Works right out of the box and easy to learn by example.
Logged
Salvager Extension | Isotropish Leaderboard | Game Data | Log Search & other toys | Salvager Bug Reports

Salvager not working for me at all today. ... Please help! I can't go back to playing without it like an animal!

ragingduckd

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #191 on: September 21, 2013, 09:23:36 am »
+7

I've added Rebuild to dominiate. Also Journeyman and Rogue, but hey! Rebuild! :D

I've also implemented a few basic Rebuild strategies, but there's certainly plenty of room for improvement:

http://gokologs.drunkensailor.org/static/dominiate/play.html
Logged
Salvager Extension | Isotropish Leaderboard | Game Data | Log Search & other toys | Salvager Bug Reports

Salvager not working for me at all today. ... Please help! I can't go back to playing without it like an animal!

achmed_sender

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 234
  • Shuffle iT Username: achmedsender
  • Respect: +202
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #192 on: September 21, 2013, 11:37:56 am »
0

I've added Rebuild to dominiate. Also Journeyman and Rogue, but hey! Rebuild! :D

I've also implemented a few basic Rebuild strategies, but there's certainly plenty of room for improvement:

http://gokologs.drunkensailor.org/static/dominiate/play.html

Cool
At least I'm now relieved that things like Wharf/Bank wins over Rebuild (even with Jack) in a Province game

EDIT: I'm surprised that Witch BM can beat Rebuild-Single
« Last Edit: September 21, 2013, 11:41:04 am by achmed_sender »
Logged

Watno

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Watno
  • Respect: +2982
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #193 on: September 21, 2013, 11:57:04 am »
+1

BM+Monument is dead even with the simple Rebuild Strategy, and so is DoubleJack.
DoubleMountebank beats it 60-40. i fear I havwe to start thinking about what to do again when I see Rebuild on the board.

Are you planning on adding all cards to the simulator, AI?

EDIT: How does the opening post of this thread only have 2 respect?
Logged

WanderingWinder

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5275
  • ...doesn't really matter to me
  • Respect: +4381
    • View Profile
    • WanderingWinder YouTube Page
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #194 on: September 21, 2013, 12:00:53 pm »
0

EDIT: How does the opening post of this thread only have 2 respect?
Because when it was posted, the respect system didn't exist.

Robz888

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2644
  • Shuffle iT Username: Robz888
  • Respect: +3388
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #195 on: September 21, 2013, 07:37:06 pm »
0

BM+Monument is dead even with the simple Rebuild Strategy, and so is DoubleJack.
DoubleMountebank beats it 60-40. i fear I havwe to start thinking about what to do again when I see Rebuild on the board.

My thoughts exactly. Gulp.
Logged
I have been forced to accept that lackluster play is a town tell for you.

WanderingWinder

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5275
  • ...doesn't really matter to me
  • Respect: +4381
    • View Profile
    • WanderingWinder YouTube Page
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #196 on: September 21, 2013, 07:43:30 pm »
0

BM+Monument is dead even with the simple Rebuild Strategy, and so is DoubleJack.
DoubleMountebank beats it 60-40. i fear I havwe to start thinking about what to do again when I see Rebuild on the board.

My thoughts exactly. Gulp.
I've been saying for a while that some simple BM strategies are the way to compete with rebuild. However, I don't exactly buy that this simulator is playing rebuild near optimally....

ragingduckd

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #197 on: September 21, 2013, 08:47:48 pm »
0

BM+Monument is dead even with the simple Rebuild Strategy, and so is DoubleJack.
DoubleMountebank beats it 60-40. i fear I havwe to start thinking about what to do again when I see Rebuild on the board.

My thoughts exactly. Gulp.
I've been saying for a while that some simple BM strategies are the way to compete with rebuild. However, I don't exactly buy that this simulator is playing rebuild near optimally....

The Rebuild bots I wrote aren't even close to optimal. They pay no attention to the cards in their draw pile, the Duchy split, the VP totals, etc. It's easy to write nearly-optimal BM strategies, but it'll take a lot more Dominiate code to produce a bot that plays a halfway decent Rebuild game. If anyone does write a better version, send me the Dominiate code and I'll add it to the server.

Comparing DoubleJack or Monument-BM to RebuildSimple wouldn't be meaningful even if the bot was smarter. RebuildSimple doesn't use any terminals. Adding just one Jack gives you the RebuildJack strategy, and even that's enough to beat DoubleJack 60-40.
Logged
Salvager Extension | Isotropish Leaderboard | Game Data | Log Search & other toys | Salvager Bug Reports

Salvager not working for me at all today. ... Please help! I can't go back to playing without it like an animal!

WanderingWinder

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5275
  • ...doesn't really matter to me
  • Respect: +4381
    • View Profile
    • WanderingWinder YouTube Page
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #198 on: September 21, 2013, 08:53:18 pm »
0

BM+Monument is dead even with the simple Rebuild Strategy, and so is DoubleJack.
DoubleMountebank beats it 60-40. i fear I havwe to start thinking about what to do again when I see Rebuild on the board.

My thoughts exactly. Gulp.
I've been saying for a while that some simple BM strategies are the way to compete with rebuild. However, I don't exactly buy that this simulator is playing rebuild near optimally....

The Rebuild bots I wrote aren't even close to optimal. They pay no attention to the cards in their draw pile, the Duchy split, the VP totals, etc. It's easy to write nearly-optimal BM strategies, but it'll take a lot more Dominiate code to produce a bot that plays a halfway decent Rebuild game. If anyone does write a better version, send me the Dominiate code and I'll add it to the server.

Comparing DoubleJack or Monument-BM to RebuildSimple wouldn't be meaningful even if the bot was smarter. RebuildSimple doesn't use any terminals. Adding just one Jack gives you the RebuildJack strategy, and even that's enough to beat DoubleJack 60-40.
It's also worth noting that some of those 'baseline' strategies have colonies included - so it's much less surprising they're beating Rebuild ideas which never buy colony.

ragingduckd

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Re: Dominiate: a Dominion simulator that runs on the Web
« Reply #199 on: September 22, 2013, 09:40:27 am »
0

Are you planning on adding all cards to the simulator, AI?

No. Only the ones I'm most interested in and the most easily programmed. I plan to do Cultist next.
Logged
Salvager Extension | Isotropish Leaderboard | Game Data | Log Search & other toys | Salvager Bug Reports

Salvager not working for me at all today. ... Please help! I can't go back to playing without it like an animal!
Pages: 1 ... 6 7 [8] 9 10 ... 13  All
 

Page created in 0.053 seconds with 21 queries.