Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: 1 2 [3] 4 5  All

Author Topic: Individual player analysis tool  (Read 33933 times)

0 Members and 1 Guest are viewing this topic.

Joseph2302

  • Jester
  • *****
  • Offline Offline
  • Posts: 858
  • Shuffle iT Username: Joseph2302
  • "Better to be lucky than good"
  • Respect: +575
    • View Profile
Re: Individual player analysis tool
« Reply #50 on: January 23, 2015, 06:03:16 pm »
0

Could be worse, my highest win %age is with Young Witch on the board. 69% winrate when it's there, crazy...
Logged
Mafia Stats: (correct as of 2017)
Town: 22 games, 8 wins
Scum: 5 games, 3 wins

A Drowned Kernel

  • 2015 World Champion
  • *
  • Offline Offline
  • Posts: 1067
  • They/Them
  • Respect: +1980
    • View Profile
Re: Individual player analysis tool
« Reply #51 on: January 23, 2015, 06:10:14 pm »
0

I've apparently never not bought tournament when it was out, huh.
Logged
The perfect engine
But it will never go off
Three piles are empty

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Individual player analysis tool
« Reply #52 on: January 23, 2015, 06:19:00 pm »
+3

Stef stats:

silver: 68% gainrate

Average winrate: 66.7%

Fool's gold: 38% gain rate, 1/3 of games with it in the kingdom only his opponent gets it and he wins 76% of those games.

Rats: 30% gain rate

Mic stats:

Silver: 76% gainrate. Only gets a province 72.6% of the time...

Fool's gold: 58.8% gain rate.

Rats: 15.8% gain rate, and only wins 37.5% of those games. n of 8 though.

Wins over 80% of the time with 8 different cards on the board. Average winrate: 67.8%
Logged

Gherald

  • Minion
  • *****
  • Offline Offline
  • Posts: 676
  • Awe: +35
  • Respect: +1397
    • View Profile
Re: Individual player analysis tool
« Reply #53 on: January 23, 2015, 06:50:27 pm »
+1

Request: Pull all games (over 1000) and cache game logs locally after fetching.  So after the first search, only new game logs need to be fetched.

If you want to share the source I can implement this and send you a patch for the fetch function
Logged
My opponent has more loot than me

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #54 on: January 23, 2015, 07:49:39 pm »
0

Request: Pull all games (over 1000) and cache game logs locally after fetching.  So after the first search, only new game logs need to be fetched.

If you want to share the source I can implement this and send you a patch for the fetch function

The vast majority is written in Javascript actually: http://www.2pih.com/j.js

There's a small PHP portion which is nothing more than a simple pass-through to access GokoSalvager because I'm not able to make cross-origin requests. The initial public interface was deliberately designed to use XHRs so as to decentralize the requests and keep Goko from banning my server's IP.

Im in the process of rewriting it to use GokoSalvager's SQL database which, from what I understand, contains all the log information. This would get around the 1000-game limit, and also reduce the loading time significantly.  However, a caching system would definitely be nice.
Logged

2.71828.....

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1290
  • Shuffle iT Username: irrationalE
  • Respect: +1322
    • View Profile
Re: Individual player analysis tool
« Reply #55 on: January 23, 2015, 08:42:22 pm »
0

I am 100% when I gain pirate ship.  Yeah.  That's right.  All two of those games
Logged
Man. I had four strips of bacon yesterday. Was one automatically undercooked, one automatically overcooked? No, let's put a stop to that right here, all four strips were excellent.

2.71828.....

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1290
  • Shuffle iT Username: irrationalE
  • Respect: +1322
    • View Profile
Re: Individual player analysis tool
« Reply #56 on: January 23, 2015, 08:57:42 pm »
+2

I love these stats.  One of the more interesting things that I have noticed is when not to buy the really good cards.

When I sort by win% for when "opponent only gains" most of the cards on that list are good cards.  I have a 100% winrate when only my opponent gains forager, plaza, menagerie, chapel, mountebank, herald, cultist, wishing well, squire, remodel, upgrade, city, university, hamlet, jester, ambassador, and urchin (plus some others like thief).  These games don't make up a huge percentage of my overall games (4 mountebank games, 4 cultist games, 7 city games, etc.) but it is interesting to look at the importance of recognizing when it is unnecessary to buy those cards where more inexperienced players might see a card and immediately get it without thinking (guilty of doing that as well).
Logged
Man. I had four strips of bacon yesterday. Was one automatically undercooked, one automatically overcooked? No, let's put a stop to that right here, all four strips were excellent.

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #57 on: January 24, 2015, 08:48:33 am »
+4

Notes:
1. I am in the process of updating it to pull all games instead of just 1000. - Done
2. Turns out caching isn't needed because XHR pulls the local cache if available.
3. I am also adding the ability to search several players at once.
4. I am also updating the script to store the log files that have been pulled to my own server, and use those if possible. This is to reduce the load on Goko's servers. For example, Stef's records have been pulled 48 different times. We only really need to hit Goko once for that.
5. I also un-minified the script.
« Last Edit: January 24, 2015, 11:31:53 am by TheExpressicist »
Logged

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Individual player analysis tool
« Reply #58 on: January 24, 2015, 07:58:32 pm »
0

It still only got 988 games. I guess it's possible I've only played 988, but I doubt it.
Logged

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #59 on: January 24, 2015, 08:25:27 pm »
0

It still only got 988 games. I guess it's possible I've only played 988, but I doubt it.

Goko Salvager only shows 996 total games that meet the criteria (2 player, no bots, pro ranking). Does that seem consistent with your perception?
Logged

LibraryAdventurer

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1794
  • Shuffle iT Username: LibraryAdventurer
  • I wish my username had the links like it once did.
  • Respect: +1674
    • View Profile
Re: Individual player analysis tool
« Reply #60 on: January 25, 2015, 12:31:54 am »
0

I was interested in this until I got to the last message and learned it only counts pro games. Can you make it count casual as well, maybe as an option? I hardly ever play pro games anymore.

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #61 on: January 25, 2015, 08:48:24 am »
+2

I was interested in this until I got to the last message and learned it only counts pro games. Can you make it count casual as well, maybe as an option? I hardly ever play pro games anymore.

Updated.

Note: Knights and Shelters are still broken.
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Individual player analysis tool
« Reply #62 on: January 25, 2015, 09:23:11 am »
+1

I get this once I put in my username:
...

Same problem here, using your web interface in FF35 on win 8.1.

Log:

Code: [Select]
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. cardAnalyzer.php
TypeError: cardArray is null j.js:112
TypeError: cardArray is null j.js:112
TypeError: cardArray is null j.js:112
TypeError: cardArray is null j.js:112
TypeError: cardArray is null j.js:112
no element found request:1

"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=0&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=1000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=2000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=3000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=4000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=5000&rating=pro" j.js:43

The 2nd part appears upon enabling "Log Request and Response Bodies".

Edit: these errors show my name in lowercase even though I have entered it with proper capitalization.
« Last Edit: January 25, 2015, 09:25:40 am by SheCantSayNo »
Logged

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #63 on: January 25, 2015, 09:33:09 am »
+1

I get this once I put in my username:
...

Same problem here, using your web interface in FF35 on win 8.1.

Edit: these errors show my name in lowercase even though I have entered it with proper capitalization.

Hm, I am looking into this. I suspect this may be a browser issue, because I just now noticed this doesn't work in Safari, and I was able to pull your records in Chrome on PC and Mac.

EDIT: It looks like this is erring out whenever it encounters a game where no cards are gained. In Chrome, the script proceeds to run and just skip those games. Not sure why it would not do the same in FF. To clarify - are you seeing the same thing as Sudgy where it's a single header row with no data underneath? If so, can you copy+paste what those header rows say?

FYI - The capitalization is deliberate; everything is auto-converted to lowercase so as not to require case sensitivity.

[size=14]Update: I have also updated this to include the average number of times you/your opponent purchased a card[/size]
« Last Edit: January 25, 2015, 09:39:43 am by TheExpressicist »
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Individual player analysis tool
« Reply #64 on: January 25, 2015, 09:42:48 am »
0

To clarify - are you seeing the same thing as Sudgy where it's a single header row with no data underneath? If so, can you copy+paste what those header rows say?
Yes:

This uses data from Goko Salvager. Check them out!
Card Name   Games Gained   Win %   Gain %   Average # You Bought   Avg # Opp Bought   Games Ignored   Win %   Total Games   Win%   Only You Games   Win %   Both Games   Win %   Opponent Only Games   Win %   Neither Games   Win %
Logged

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #65 on: January 25, 2015, 10:01:17 am »
0

To clarify - are you seeing the same thing as Sudgy where it's a single header row with no data underneath? If so, can you copy+paste what those header rows say?
Yes:

This uses data from Goko Salvager. Check them out!
Card Name   Games Gained   Win %   Gain %   Average # You Bought   Avg # Opp Bought   Games Ignored   Win %   Total Games   Win%   Only You Games   Win %   Both Games   Win %   Opponent Only Games   Win %   Neither Games   Win %

Alright, I think I fixed it? Try refreshing your cache and running again.
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Individual player analysis tool
« Reply #66 on: January 25, 2015, 10:29:25 am »
0

A little better, it displays all the rows but the data is corrupted, here are the first 3 rows + another one that shows infinity:

This uses data from Goko Salvager. Check them out!
Card Name   Games Gained   Win %   Gain %   Average # You Bought   Avg # Opp Bought   Games Ignored   Win %   Total Games   Win%   Only You Games   Win %   Both Games   Win %   Opponent Only Games   Win %   Neither Games   Win %
greathall   0   NaN%   0%   NaN   2.8   270   0   270   0%   0   NaN%   0   NaN%   200   0%   70   0%
potion   0   NaN%   0%   NaN   1.3   2063   0   2063   0%   0   NaN%   0   NaN%   989   0%   1074   0%
worker'svillage   0   NaN%   0%   NaN   3.3   241   0   241   0%   0   NaN%   0   NaN%   173   0%   68   0%
...
madman   0   NaN%   NaN%   NaN   Infinity   0   NaN   0   NaN%   0   NaN%   0   NaN%   0   NaN%   0   NaN%

js log:

Code: [Select]
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. cardAnalyzer.php
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=0&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=1000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=2000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=3000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=4000&rating=pro" j.js:43
"http://www.2pih.com/playerAnalyzer.php?p1name=shecantsayno&startdate=08/05/2012&enddate=01/25/2015&offset=5000&rating=pro" j.js:43
"TMI.js [irc] WARNING: Invalid emotes tag: " tmi-v3.js:1
"TMI.js [irc] WARNING: Invalid emotes tag: " tmi-v3.js:1
no element found request:1
"TMI.js [irc] WARNING: Invalid emotes tag: " tmi-v3.js:1
A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'?
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Date: Sun Jan 25 2015 16:21:54 GMT+0100
Full Message: false
A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'?
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Date: Sun Jan 25 2015 16:21:55 GMT+0100
Full Message: false
"TMI.js [irc] WARNING: Invalid emotes tag: " tmi-v3.js:1
Logged

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #67 on: January 25, 2015, 03:31:27 pm »
0

Based on the error messages, it may be a conflict with Twitch but without looking further it would be hard to say for sure. I will try installing it and see if I can't recreate the issue.
Logged

LibraryAdventurer

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1794
  • Shuffle iT Username: LibraryAdventurer
  • I wish my username had the links like it once did.
  • Respect: +1674
    • View Profile
Re: Individual player analysis tool
« Reply #68 on: January 25, 2015, 05:04:18 pm »
0

I was interested in this until I got to the last message and learned it only counts pro games. Can you make it count casual as well, maybe as an option? I hardly ever play pro games anymore.

Updated.
Thanks!

Merudo

  • Ambassador
  • ***
  • Offline Offline
  • Posts: 32
  • Respect: +29
    • View Profile
Re: Individual player analysis tool
« Reply #69 on: January 25, 2015, 06:33:53 pm »
+1

It doesn't work for me, it acts as if I never bought a card ever.
Logged

c4master

  • Moneylender
  • ****
  • Offline Offline
  • Posts: 167
  • Respect: +56
    • View Profile
Re: Individual player analysis tool
« Reply #70 on: January 26, 2015, 02:10:48 am »
0

I encouter the same problem. Look at the attached file.
Logged

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #71 on: January 26, 2015, 06:40:04 am »
0

Okay I think this should be fixed now, I was using an XHR property that was only available on Chrome.
Logged

Joseph2302

  • Jester
  • *****
  • Offline Offline
  • Posts: 858
  • Shuffle iT Username: Joseph2302
  • "Better to be lucky than good"
  • Respect: +575
    • View Profile
Re: Individual player analysis tool
« Reply #72 on: January 26, 2015, 06:45:59 am »
0

Okay I think this should be fixed now, I was using an XHR property that was only available on Chrome.
Yay, it's working for me now (wasn't working yesterday). Although it says I've never gained knights, or ruins, or any card not in supply (madman/spoils/tournament prizes).


Also, fun fact, I have a 100% win rate when I gain thief, having gained it twice in 117 games! :)

EDIT: Just to clarify, it works for me on Chrome & Firefox.
« Last Edit: January 26, 2015, 09:17:59 am by Joseph2302 »
Logged
Mafia Stats: (correct as of 2017)
Town: 22 games, 8 wins
Scum: 5 games, 3 wins

TheExpressicist

  • Conspirator
  • ****
  • Offline Offline
  • Posts: 200
  • Respect: +203
    • View Profile
Re: Individual player analysis tool
« Reply #73 on: January 26, 2015, 07:49:50 am »
0

Okay I think this should be fixed now, I was using an XHR property that was only available on Chrome.
Yay, it's working for me now (wasn't working yesterday). Although it says I've never gained knights, or ruins, or any card not in supply (madman/spoils/tournament prizes).


Also, fun fact, I have a 100% win rate when I gain thief, having gained it twice in 117 games! :)

Yeah I need to fix that. If the tool is working for non Chrome browsers, that's next on my list.
Logged

Awaclus

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 11808
  • Shuffle iT Username: Awaclus
  • (´。• ω •。`)
  • Respect: +12846
    • View Profile
    • Birds of Necama
Re: Individual player analysis tool
« Reply #74 on: January 26, 2015, 09:07:29 am »
0

Okay I think this should be fixed now, I was using an XHR property that was only available on Chrome.
Yay, it's working for me now (wasn't working yesterday). Although it says I've never gained knights, or ruins, or any card not in supply (madman/spoils/tournament prizes).


Also, fun fact, I have a 100% win rate when I gain thief, having gained it twice in 117 games! :)

Yeah I need to fix that. If the tool is working for non Chrome browsers, that's next on my list.

It's working for Opera 26 at least.
Logged
Bomb, Cannon, and many of the Gunpowder cards can strongly effect gameplay, particularly in a destructive way

The YouTube channel where I make musicDownload my band's Creative Commons albums for free
Pages: 1 2 [3] 4 5  All
 

Page created in 0.084 seconds with 21 queries.