Dominion Strategy Forum

Meta => Feedback => Council Room Feedback => Topic started by: rrenaud on January 15, 2012, 06:05:43 pm

Title: New Councilroom feature: card conditional winning stats
Post by: rrenaud on January 15, 2012, 06:05:43 pm
This thing currently sucks, but hey, the perfect is the enemy of the crappy.  And/or real artists ship.  Alternatively, better now than never.  You get the point.

http://councilroom.com/supply_win

There are some bugs in the stats with the cards that are in every set (estate, gold, duchy, etc).

The UI is a terrible, painful, undesigned mess.

You can't post stable links to how your page looks.

But the stats might be interesting!  And the frontend is all javascript and there is an JSON API to get at the raw data, so some dedicated people could design a useful interface without having to run the councilroom backend.

First insight?  It looks like Remodel helps FG more than Mint does, despite Remodel's general mediocrity and the crazy strength of the Mint/FG opening.  This supports WW and Fabian's play in one of the tournament games.


Name        Condition     %+    Per gain      Any gain         Num gained
Fool's Gold None         64.6   1.02 0      0.97 0        2.7   
Fool's Gold Remodel      74.9   1.06 0.01   0.98 0.01     3.32   
Fool's Gold Mint         69.3   1.06 0.01   0.97 0.01     3.15   


I'd love suggestions for a good way to interact with the data.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Qvist on January 16, 2012, 06:47:52 am
Thanks for this. This is really nice already. I will look further into this later.
I'm still not sure about the difference between "Per gain" and "Any gain", especially with constraints.
So, when I have 8 Fool's Gold and my opponent 2 and I win. This basically means 16/10 for "per gain" and 1.0 for "any gain" right?
And when I have Fool's Gold + Remodel: "Per Gain" relates to FG or to both? "Any Gain" relates to "gained at least one of both" right?

One further addition I like to have: When I have a constraint set, additional 2 columns would be nice: "Per gain difference (PGD)" and "Any gain difference (AGD)"
So, in your example: "Fool's Gold + Remodel" would have a PGD of +0.04 and a AGD of +0.01
With these columns, sorting would be better with constraints.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: DStu on January 16, 2012, 06:54:12 am
First thanks.
How much work would it be to add the price and the expansion to the list, so that you can sort the cards by this dates?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: chwhite on January 16, 2012, 10:37:27 am
All I see when I click on the link is "This contains a very poor interface to card winning stats that depend on having up to two other cards available in the supply."

What am I missing?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: DStu on January 16, 2012, 10:41:54 am
What am I missing?

the Javascript?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: WanderingWinder on January 16, 2012, 10:49:38 am
Yup. I get just that for about 3 seconds at first too, then the familiar javascript UI pops up. Not that I've really figured out what I'm doing with it yet... but that will come with time.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: jsh357 on January 16, 2012, 10:54:02 am
All I see when I click on the link is "This contains a very poor interface to card winning stats that depend on having up to two other cards available in the supply."

What am I missing?

For me it only works in Chrome
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on January 16, 2012, 11:07:35 am
I haven't tested this on browsers besides Chrome.  Probably getting it working in Firefox shouldn't be that bad.  IE and Safari are a pain though.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: DStu on January 16, 2012, 11:08:53 am
I haven't tested this on browsers besides Chrome.  Probably getting it working in Firefox shouldn't be that bad.  IE and Safari are a pain though.

FF 9.0.1 works (with NoScript disabled)
Title: Re: New Councilroom feature: card conditional winning stats
Post by: chwhite on January 16, 2012, 11:36:16 am
I haven't tested this on browsers besides Chrome.  Probably getting it working in Firefox shouldn't be that bad.  IE and Safari are a pain though.

I'm on Firefox... but it's an old version.  Guess I should update.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on January 16, 2012, 08:33:11 pm
Quote
Availability: The number of games in which the card is present, multiplied by the number of players in each game. It represents the number of "decks" that could have purchased that card.
%+: Percentage of times the named card was gained at least once.
Per Gain: This is win rate on the card on a per gain basis. If player 1 bought the card 5 times and won, and player 2 bought the card 3 times and lost, then this would count as 5 wins and 3 losses in two player games, giving a win rate of 5 * 2 / (5 + 3) = 10 / 8 = 1.25.
Any Gain: This is a win rate that does not include multiple gains of a card in the same game. In the above 5 winning vs 3 losing example, the card would have a win rate of 1, because both players purchased it.
Num Gained: The average number of the card gained per player.

I added some descriptions of the stats to the page, and a loading message before the data arrives.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on January 16, 2012, 08:34:19 pm
I want to add general card filtering like on the win graph pages, and I can add expansion version to that filtering mechanism so it will work in both places.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on January 16, 2012, 08:35:29 pm
The conditions refer to the card merely being available in the supply.  Even if the conditional card was never purchased, the stats still count.

In the long run, if the conditional card wasn't purchased and there is no "threat avoidance" interaction (I'll skip remodel if there is a possession available, even if my opp doesn't buy it), then the conditional stats should look a lot like the unconditional stats, and that's fine with me.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: theory on February 29, 2012, 03:38:12 am
This has now been made considerably nicer and even has a crude "card quality" measure.

Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on February 29, 2012, 10:53:56 am
Now you guys can grab links:

http://councilroom.com/supply_win?&targets=Jack%20of%20all%20Trades&interaction=true&nested=false&unconditional=true


Find which cards help Treasure Map the most by sorting by change in quality:
http://councilroom.com/supply_win?&targets=Treasure%20Map&interaction=true&nested=false&unconditional=true
Chapel, Warehouse, Haven, Steward, Remodel (?), Courtyard, Tactician, Ambassador.  That list seems pretty good/reasonable.

See which two card combo from Cornucopia helps Library the most by sorting by change in quality (it seems pretty wrong, I probably need to make the ranking function better, but it says Hunting Party/Hamlet):
http://councilroom.com/supply_win?&targets=Library&interaction=Expansion%3D%3D%22Cornucopia%22&nested=true&unconditional=true

See what up to 3 card combos look the best from your most recent game:
http://councilroom.com/supply_win?&targets=Bank%2CBureaucrat%2CContraband%2CFortune%20Teller%2CMinion%2CMint%2CPotion%2CSteward%2CUniversity%2CVillage%2CWorker's%20Village&interaction=Bank%2CBureaucrat%2CContraband%2CFortune%20Teller%2CMinion%2CMint%2CPotion%2CSteward%2CUniversity%2CVillage%2CWorker's%20Village&nested=true&unconditional=true
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Axxle on February 29, 2012, 02:44:21 pm
See what up to 3 card combos look the best from your most recent game:
http://councilroom.com/supply_win?&targets=Bank%2CBureaucrat%2CContraband%2CFortune%20Teller%2CMinion%2CMint%2CPotion%2CSteward%2CUniversity%2CVillage%2CWorker's%20Village&interaction=Bank%2CBureaucrat%2CContraband%2CFortune%20Teller%2CMinion%2CMint%2CPotion%2CSteward%2CUniversity%2CVillage%2CWorker's%20Village&nested=true&unconditional=true
This sounds a little dangerous.  "See what up to 3 card combos look the best from your current game"
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on February 29, 2012, 03:11:51 pm
Heh, if people start playing better because they use supply_win (needs a sexier name!) before every game they played on iso, even just because it rarely prevents them from missing obvious combos, I have no problem with that.

I'd totally be happy competing against hybrid human/computer systems in an attempt to improve the level of dominion play.  If it ever gets to the point that computers totally dominate humans at Dominion, then maybe I'll reconsider.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Insomniac on February 29, 2012, 03:56:25 pm
Just as I suspected according to the graphs Jack of all trades is .01 better with counting house than without. Wait..what...
Title: Re: New Councilroom feature: card conditional winning stats
Post by: tko on February 29, 2012, 04:04:01 pm
Just as I suspected according to the graphs Jack of all trades is .01 better with counting house than without. Wait..what...
Maybe against Mountebank or Ambassador?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on February 29, 2012, 04:42:44 pm
Re counting house/jack: can't tell if joking.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Insomniac on February 29, 2012, 04:51:07 pm
I am joking I hate counting house except with chancelor and even then big money is probably just better. But on the graphs Counting Room/Jack is higher than just Jack. If I'm missing something please let me know
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Razzishi on February 29, 2012, 06:26:58 pm
Both links to these forums on that page go to this thread.  The first is probably supposed to go elsewhere.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on February 29, 2012, 06:29:02 pm
yeah, i suck at HTML :P.  it was supposed to go to qvist's card ranking page.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Razzishi on February 29, 2012, 06:38:40 pm
I needed the links in this thread to figure out that, unlike in standard English, when you separate cards with a comma in the entry boxes you do not put a space after the comma.  That is, you put in "Chapel,Remake" and not "Chapel, Remake".  Might be useful to put an example up that makes this clear.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Razzishi on February 29, 2012, 07:10:31 pm
A bit of experimenting and it seems that there's some code for the biconditional data that compares the two cards alphabetically, presumably to make sure that only one pair gets displayed.  This code has run amok and has prevented a lot of biconditionals from being displayed.  For instance, "Upgrade,Develop,Chapel,Remake,Salvager,Apprentice" as conditions will only list Upgrade/Salvager, Upgrade/Remake, Salvager/Remake, and Develop/Chapel, in that order, and no other biconditionals.  It doesn't seem to matter what order the conditions are in either, many biconditionals just don't show up and the ones that do show up always have the one that is later alphabetically listed first.

I put together one of each letter to see where the problem might be: Adventurer,Bank,Chapel,Develop,Forge,Gardens,Haven,Island,Jester,King's Court,Library,Monument,Native Village,Outpost,Pawn,Quarry,Rabble,Smithy,Tunnel,Upgrade,Vault,Workshop,Young Witch

Y: WVUTSRQPONA (Where's most of the beginning of the alphabet?)
W: VUTSRQPONA
and similar until
M: LKJIHGFEDCBA (This looks good!)
L: KJIHGFEDCBA
and similar until
H: GFEDCA (where'd B go?)
G: FEDCA
And similar until the end.

Something screwy is happening between A and B such that A always shows up, and B doesn't for most of the alphabet.  Something also is happening between N and M such that cards on different sides of the divide are only put together unless one is A.  More to come....

edit: Adventurer and Alchemist appear to be the only ones that always appear.  Starting from Ambassador they don't.

Bazaar through Ambassador are not showing up for Bishop forward. 

Things are just really screwy; there might be a pattern in what is or isn't showing up but it's starting to get really weird as I look at more and more combinations.  Ambassador shows back up on Conspirator; Apothecary and Apprentice are back on by Ghost Ship; Bank is back on by Inn.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on March 01, 2012, 01:00:49 am
Thanks for the excellent bug report.

This commit is for you :)

https://github.com/rrenaud/dominionstats/commit/b9ed2dfcdfbb3905fae0b2b8dac47d0cf2d8af5d

I also fixed the spaces between commas problem.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Razzishi on March 01, 2012, 07:05:21 pm
I think the reason your previous code didn't work is because there's discrepancies between how the cards are numbered and actual alphabetical order.  Asking for conditionals for the set of all cards that give 0 or more actions (ie, all cards), shows a list that is somewhat alphabetical but there are differences and they're somewhat related to where there were issues before.  If there was an implicit assumption that the cards were numbered in alphabetical order, that would explain it.

If you get over 1000 results, it will be trimmed and "NaN" will appear in the "Delta Qual" column for all rows.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on March 01, 2012, 11:03:18 pm
I could definitely see >1k results screwing things up.  The server won't send back more than 1k stat objects, and then the client side quality delta code breaks.  Do you have any more concrete examples of the card combo stuff being broken?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: theory on March 02, 2012, 05:41:28 am
I am a little confused by some of these results, but I can't tell if I'm just missing out on some awesome synergies here: Tournament and Sea Hag best with Pirate Ship?

Come to think of it, I can explain this.  Pirate Ship happens to be really high because whoever buys Pirate Ship loses extra hard against someone going Tournament/Sea Hag.  So that basically means, Tournament works best w/ Pirate Ship only because a bunch of bad people go Pirate Ship and they were going to lose anyway.  Maybe this is also why most of the Villages tend to show up on top of the delta Quality ratings column.

I wonder if there is some way to filter this out in the Quality ratings.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on March 07, 2012, 11:30:48 pm
I thought about the "bad play" confounding problem in the data.

I guess there are two approaches:

Do skill normalization, so losses by the weak players count less.  This should offset the problem a bit, but not totally eliminate it.

Do a level based filtering, and hope (not a strategy!) good players don't screw up that badly, polluting the data.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: ^_^_^_^ on March 08, 2012, 12:44:40 am
Skill normalization gets my vote. More accurate the better!
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Insomniac on March 28, 2012, 01:53:37 pm
What about only using delta from the same deck IE The guy who wins with tournament probably didnt have a pirate ship in his deck and thus pirate ship doesnt get a boost from the tournament player winning with pirate ship on board?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: rrenaud on March 28, 2012, 02:07:04 pm
The deltas are just differences in quality.

I guess what you really want is conditions to be not based on the supply, but rather based on co-occurrence inside a single deck?
Title: Re: New Councilroom feature: card conditional winning stats
Post by: ecq on May 01, 2012, 02:21:56 pm
The deltas are just differences in quality.

I guess what you really want is conditions to be not based on the supply, but rather based on co-occurrence inside a single deck?

I'd really like this.  Given two cards, A and B available in a kingdom, how have players historically fared buying both, just one, or neither?  If there's enough data, it'd be nice to be able to see it broken down by opponent purchases, too.  So, buying A against an opponent who buys B, or buying A + B against an opponent who buys only A.

It seems like that alleviates the confusing results theory mentioned before.  Just now I was looking for interactions between Philosopher's Stone and Ill-Gotten Gains.  The delta is near-0, but I realized that doesn't mean much because people rarely gain P. Stone when it's available.
Title: Re: New Councilroom feature: card conditional winning stats
Post by: Insomniac on May 01, 2012, 03:13:50 pm
The deltas are just differences in quality.

I guess what you really want is conditions to be not based on the supply, but rather based on co-occurrence inside a single deck?

I'd really like this.  Given two cards, A and B available in a kingdom, how have players historically fared buying both, just one, or neither?  If there's enough data, it'd be nice to be able to see it broken down by opponent purchases, too.  So, buying A against an opponent who buys B, or buying A + B against an opponent who buys only A.

It seems like that alleviates the confusing results theory mentioned before.  Just now I was looking for interactions between Philosopher's Stone and Ill-Gotten Gains.  The delta is near-0, but I realized that doesn't mean much because people rarely gain P. Stone when it's available.

rrenaud: Yea that'd be pretty sweet. Sorry I didn't see your reply sooner

ecq:  I do also like the Opponent purchase idea too but could see that making some difficulties in the back end