Dominion Strategy Forum

Please login or register.

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

Author Topic: Formula for modified card frequencies  (Read 5086 times)

0 Members and 1 Guest are viewing this topic.

ragingduckd

  • Board Moderator
  • *
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Formula for modified card frequencies
« on: September 05, 2014, 03:52:28 pm »
+20

For casual and unrated games, SCSN and I like to modify the frequency with which particular cards are chosen.  We like to play games with Black Market or Tactician, but we're not so big on the sort of game that IGG or Cultist leads to.  As for the cards that are either very weak or very strong and randomizing, it's nice to see them on occasion but maybe not as often as in full random.

Here's the formula that generates modified frequencies we like:

Code: [Select]
10 ( 9*(Black Market + Procession + Hermit + Inn + Watchtower + Mint + Tactician + Bishop + Prince)
+ 3*( ALL / (Black Market + Procession + Hermit + Inn + Watchtower + Mint + Tactician + Bishop + Prince)
          / (Pirate Ship + Thief + Transmute + Adventurer + Scout + Coppersmith + Harvest + Cache + Noble Brigand + Taxman + Rebuild + Minion + Tournament + Possession + Pearl Diver + Swindler)
          / (Ill-Gotten Gains + Cultist + Fool's Gold) )
+ 1*(Pirate Ship + Thief + Transmute + Adventurer + Scout + Coppersmith + Harvest + Cache + Noble Brigand + Taxman + Rebuild + Minion + Tournament + Possession + Pearl Diver + Swindler) )

This formula:
  • excludes (IGG, Cultist, and FG) entirely
  • chooses (Black Market, Procession, etc.) 3x as often as normal
  • chooses (Pirate Ship, Thief, etc.) and (Rebuild, Tournament, etc) 1/3 as often as normal.
We find this tends to generate a wider range of strategies than full random.  We often find ourselves saying "well that was a weird game." :)

The same technique can bias the kingdom towards engines (add villages to the 3x list) or away from attacks (add them to the 1/3x list).  What's nice is that you don't have to completely force or eliminate those cards like "Village, 9 * (ALL / Attack)" would.

To emphasize different cards or change their frequencies, you can tweak the script that generates the formula:

Code: [Select]
#!/bin/bash

# Choose these cards 300% as often as normal
more="(Black Market + Procession + Hermit + Inn + Watchtower + Mint + Tactician + Bishop + Prince)"

# Choose these cards 33% as often as normal
less="(Pirate Ship + Thief + Transmute + Adventurer + Scout + Coppersmith + Harvest + Cache + Noble Brigand + Taxman +  Rebuild + Minion + Tournament + Possession + Pearl Diver + Swindler)"

# Never choose these cards
never="(Ill-Gotten Gains + Cultist + Fool's Gold)"

# Choose all other cards at the normal rate
normal="( ALL / $more / $less / $never )"

# Note: The kingdom generator can't specify non-integer rates (e.g. 1/3 for the "less" cards).
#       Instead, we can multiply all the rates by 3 so that they're all integers.  The kingdom
#       generator will effectively reverse the scaling.  That is
#
#       300% --> 9x for the "more" cards
#        33% --> 1x for the "less" cards
#         0% --> 0x for the "never" cards
#       100% --> 3x for the "normal" cards (everything else)
#
echo "10 ( 9*$more + 3*$normal + 1*$less )"

If you don't have a POSIX shell, you can use a site like this one to run it.  Changing which cards that it draws more or less often is straightforward, but changing the frequencies is a little trickier.  I've given very brief explanations in the script comments, but feel free to ask for help here or in PM.
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!

allanfieldhouse

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 234
  • Respect: +374
    • View Profile
Re: Formula for modified card frequencies
« Reply #1 on: September 08, 2014, 01:59:48 pm »
0

Cool! Now to get something like this incorporated into an "Advanced" mode of the Salvager Kingdom Generator...
Logged

michaeljb

  • Board Moderator
  • *
  • Offline Offline
  • Posts: 1422
  • Shuffle iT Username: michaeljb
  • Respect: +2114
    • View Profile
Re: Formula for modified card frequencies
« Reply #2 on: September 10, 2014, 12:27:12 am »
+3

Cool! Now to get something like this incorporated into an "Advanced" mode of the Salvager Kingdom Generator...

Coming soon to a beta near you....
Logged
🚂 Give 18xx games a chance 🚂

AdamH

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2833
  • Shuffle iT Username: Adam Horton
  • You make your own shuffle luck
  • Respect: +3879
    • View Profile
    • My Dominion Videos
Re: Formula for modified card frequencies
« Reply #3 on: September 10, 2014, 03:35:59 pm »
+2

Cool! Now to get something like this incorporated into an "Advanced" mode of the Salvager Kingdom Generator...

Coming soon to a beta near you....

Allow me to ask a potentially stupid question.

This is all your opinion on what makes a kingdom "good" or what you like. I'm super-glad that you've found this out and it sounds really useful, for AI.

What is being added to the extension sounds like it would just implement this particular formula? Or am I misunderstanding and the new beta thing would be allowing people to put in their own formulas for what they consider fun.

It just would seem weird to me if we put in AI's personal preferences into the extension. I feel like we had a similar discussion with onigame's kingdom generator.
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

qmech

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1918
  • Shuffle iT Username: qmech
  • What year is it?
  • Respect: +2320
    • View Profile
Re: Formula for modified card frequencies
« Reply #4 on: September 10, 2014, 04:28:24 pm »
+3

What is being added to the extension sounds like it would just implement this particular formula? Or am I misunderstanding and the new beta thing would be allowing people to put in their own formulas for what they consider fun.

Edit: I should mention that in the kingdom generator interface, when adding cards to the more/less/exclude lists, enter the card names separated by + or ,

Quote from: github
In the current implementation the user is locked into ragingduckd's
definitions of "more" and "less", but we could change the UI to allow
the user to add any number of fields, setting each of those fields to
any frequency relative to the "normal" frequency that applies to the
rest of the cards.

It's currently AI's scheme, but you can choose which cards go in which category.
Logged

AdamH

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2833
  • Shuffle iT Username: Adam Horton
  • You make your own shuffle luck
  • Respect: +3879
    • View Profile
    • My Dominion Videos
Re: Formula for modified card frequencies
« Reply #5 on: September 10, 2014, 05:22:43 pm »
0

OK, that sounds reasonable, as long as a particular set of cards (like AI's preferences, for example) isn't put in there by default. Good stuff.
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

michaeljb

  • Board Moderator
  • *
  • Offline Offline
  • Posts: 1422
  • Shuffle iT Username: michaeljb
  • Respect: +2114
    • View Profile
Re: Formula for modified card frequencies
« Reply #6 on: September 10, 2014, 09:50:58 pm »
+2

I didn't think the OP here had received nearly 20 respect by saying "I don't always play casual, but when I do, I don't like playing with IGG, Cultist, or Fool's Gold; I only sometimes like playing with Thief; but I really like Black Market; here's how you can play casual that way too!"

More like, "I don't always play casual, but when I do, I don't like playing with some cards; I only sometimes like playing with some other cards; but there are still other cards I really like to play with; here's how you can play casual that way too!"

I'm a bit surprised that the first assumption was that I had implemented the former.

As is usually the case, I could have been more clear in my commit message or my post in the other thread, but at least the concerns seem to be put to rest now.

For what it's worth, my ultimate vision for this feature has an "include" and "exclude" row, and no other rows by default. There would be some kind of (+) button that adds another row where you set the relative frequency you desire for cards in that row, be it 300%, 33%, 50%, or even 9001%. But since I was more interested in getting something coded quickly that could be added to Salvager ASAP, I just went for the simpler exclude/more/less.
Logged
🚂 Give 18xx games a chance 🚂

ragingduckd

  • Board Moderator
  • *
  • Offline Offline
  • Posts: 1059
  • Respect: +3527
    • View Profile
Re: Formula for modified card frequencies
« Reply #7 on: September 11, 2014, 12:30:42 am »
+3

michaeljb's implementation is now in the beta (v2.5.5.0).  Here's what it looks like:

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!

SirD

  • Bishop
  • ****
  • Offline Offline
  • Posts: 100
  • Life is supposed to be fun
  • Respect: +55
    • View Profile
Re: Formula for modified card frequencies
« Reply #8 on: October 08, 2014, 07:40:31 am »
0

I love it! This is great.
Logged
Greetings,
SirDagen

Merudo

  • Ambassador
  • ***
  • Offline Offline
  • Posts: 32
  • Respect: +29
    • View Profile
Re: Formula for modified card frequencies
« Reply #9 on: November 02, 2014, 07:30:53 pm »
0

I'm surprised you dislike Tournament so much. I have not seen a lot of hate for that card yet, and in my experience it's always a fun card to have in the Kingdom.

I'd put Scrying Pool in there instead...
« Last Edit: November 02, 2014, 07:35:18 pm by Merudo »
Logged

sudgy

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3431
  • Shuffle iT Username: sudgy
  • It's pronounced "SOO-jee"
  • Respect: +2707
    • View Profile
Re: Formula for modified card frequencies
« Reply #10 on: November 02, 2014, 07:32:14 pm »
0

I'm surprised you dislike Tournament so much. I have not seen a lot of hate for that card yet, and in my experience it's always a fun card to have in the Kingdom.

It's pretty much my only hated card...
Logged
If you're wondering what my avatar is, watch this.

Check out my logic puzzle blog!

   Quote from: sudgy on June 31, 2011, 11:47:46 pm
Pages: [1]
 

Page created in 0.053 seconds with 21 queries.