Page 1 of 8

ConquerStats - Ingame analysis

PostPosted: Sun Sep 21, 2008 4:28 pm
by cspare
ConquerStats - Ingame analysis
ConquerStats consists of 2 seperate scripts. They work independently from each other, so you can choose the one you like best, or just install both at the same time.

Download link: http://userscripts.org/scripts/show/34187

Screenshots
Overview:
Image

Territories held:
Image

Tooltip:
Image

What it does
ConquerStats shows a bit of extra information about how players are playing their game. In one of the tables you can see how many times every player has attacked his opponents. In another table you can see how efficiently players are using their reinforcements. The total number of reinforcements in all game rounds is shown and divided in four groups: Regular Reinforcements (those you get for having a certain amount of countries), Bonus (those you get for holding continents) Territory Bonus (auto deployed troops for holding certain territories) Spoils (those you get for cashing a set of cards).

Requirements
You must be running Firefox with Greasemonkey installed.
Full instructions for Firefox and Greasemonkey from scratch: viewtopic.php?t=41487

The chart is hosted in a Silverlight (more or less Microsoft's version of Flash) application, so you will need to download the Silverlight runtime if you don't have it already. A download button will automatically appear in the game-screen when you need to download it. You will still need Greasemonkey to insert the chart into the website.

ToDo list
Items on this list are under development.
  • Toggle cumulative totals for charts (Total armies at beginning of the turn)
  • Add an option to continue to draw a 0-reinforcements line for eliminated players
  • Integrate with the BOB script so gamelogs don't have to be downloaded 2 times
  • Add attacks per turn chart

Changelog
  • 1.5.3: It works with colour codes
  • 1.5.2: Site fixes
  • 1.5.1: Minor fixes
  • 1.5.0:
    - The reinforcements table now shows the same stat types as the chart;
    - Fixed strike through style for eliminated players;
    - The version update check now only checks once per browser session, instead of every page view;
    - Some minor lingo changes.
  • 1.4.0: - There now is a setting to define where ConquerStats should appear on the screen: Above to gamelog or Below the gamechat.
  • 1.3.0: - Territories held chart added + improved mouse-over tooltip information.
  • 1.2.0: - Ajax enabled (automatically updates data while playing)
  • 1.1.3 & 1.1.4: - Implemented final release of Silverlight 2.0, instead of beta 2
  • 1.1.2: - Fixed script to match site's change of lingo
  • 1.1.0: - Implemented basic ingame reinforcements charts

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 1:05 am
by BaldAdonis
Wow!
First thoughts: you should include the armies each player starts with, for the efficiency calculation. I've got one that shows 200% efficiency, and I imagine it would cause errors for any player who hasn't taken a turn yet.
*edit*
After playing around a bit more, could you also add neutrals to the attack list (I like to know how many territories a player has taken in conquest maps) and something funny is going on here Game 3257565. Maybe because of the fog, but it hasn't counted any of my opponents attacks against me, I assume because the territory names are recorded in the log. Presumably, you won't be able to see a count for either of us, but a cursory glance at the log will show that we've been fighting.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 2:52 am
by yeti_c
Nice work cspare... I'm gonna install this later and have a play.

C.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:07 am
by cspare
BaldAdonis wrote:Wow!
First thoughts: you should include the armies each player starts with, for the efficiency calculation. I've got one that shows 200% efficiency, and I imagine it would cause errors for any player who hasn't taken a turn yet.
*edit*
After playing around a bit more, could you also add neutrals to the attack list (I like to know how many territories a player has taken in conquest maps) and something funny is going on here Game 3257565. Maybe because of the fog, but it hasn't counted any of my opponents attacks against me, I assume because the territory names are recorded in the log. Presumably, you won't be able to see a count for either of us, but a cursory glance at the log will show that we've been fighting.


Ok, thanks for the feedback. I just fixed the problem for your game Game 3257565, it should work now if you download the latest version of the script: http://userscripts.org/scripts/source/34187.user.js.
I'll have a look later tonight to include the starting armies in the effeciency calculation.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:17 am
by yeti_c
Initial comments.

a) Include attacks against Neutral armies.
b) for "no cards" games - drop the 2 columns about card reinforcements.
c) I assume you have to download the full log and parse through this to get your stats? - you might want to test what happens when you goto game Game 1000001

C.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:29 am
by e_i_pi
Points:

1) Me love you long time
2) Very long time
3) Is it possible to show totals for teams? I notice I have reinforced 15 or so armies to a teammate, leaving me with bad efficiency, and boosting theirs to 188%, so it;'s hard to tell on a team-for-team basis

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 5:06 am
by chipv
Excellent script, cspare!

There is a tiny bug - you get an error if color codes are switched on.

Here is the fix:

Code: Select all
var qryPlayers = /<span class="player(\d)">([\s\w|:]*)<\/span>/gi;

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 5:18 am
by chipv
A separate problem with that RegExp:

We have some player names with odd characters that will cause RegExps to fail.

For example find any game with *manimal and you won't see his stats.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 6:36 am
by cspare
chipv wrote:A separate problem with that RegExp:

We have some player names with odd characters that will cause RegExps to fail.

For example find any game with *manimal and you won't see his stats.


Thanks, I fixed the problem and it should work okay now. You can download the latest version from http://userscripts.org/scripts/source/34187.user.js

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 7:38 am
by chipv
Good job. One further problem happens with territories with funny characters in:

For example:

http://www.conquerclub.com/game.php?game=3105844

So just use the same fix for the territory names also:

Code: Select all
var regExQry = /<span class="player(\d)">[ \x21-\x3D\x3F-\x7E]*<\/span> attacked [ \x21-\x3D\x3F-\x7E]* from [ \x21-\x3D\x3F-\x7E]* and conquered it from <span class="player(\d)"/gi;

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 2:21 pm
by cspare
Ok, I think I implemented most of the fixes/changes as where requested above.
The most important new features are:
  • Team stats are now included;
  • Attacks versus neutral player is now included;
  • Bonus Card stats are now hidden when no cards are used.

Any feature request or bug report is much appreciated.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:20 pm
by chipv
cspare wrote:Ok, I think I implemented most of the fixes/changes as where requested above.
The most important new features are:
  • Team stats are now included;
  • Attacks versus neutral player is now included;
  • Bonus Card stats are now hidden when no cards are used.

Any feature request or bug report is much appreciated.



Great job, cspare!

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:26 pm
by OliverFA
Installed. Going to test it...

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:36 pm
by OliverFA
It's a pitty that the log does not show failed attacks, because then you would be able to display that information in your script.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 22, 2008 4:40 pm
by cspare
OliverFA wrote:It's a pitty that the log does not show failed attacks, because then you would be able to display that information in your script.

Yea indeed, that would have been nice. But from what I read (somewhere here in the forums) they are working on improving the logs. I will include it in the script as soon as they release it. In the meantime I'll try to get as much out of it as possible, and make a good base for the upcoming log enhancements.

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 23, 2008 1:53 pm
by t-o-m
:shock:
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Documents%20and%20Settings/Tom/Application%20Data/Mozilla/Firefox/Profiles/jhqfhxns.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js :: getFullLog :: line 403" data: no]

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 23, 2008 2:52 pm
by cspare
t-o-m wrote::shock:
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Documents%20and%20Settings/Tom/Application%20Data/Mozilla/Firefox/Profiles/jhqfhxns.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js :: getFullLog :: line 403" data: no]


Hmm, that might have something to do with other (grease monkey) scripts trying to access a remote file at the same time. Could you please paste your list of installed scripts (in the order they appear)?

Re: ConquerStats - shows several ingame statistics

PostPosted: Wed Sep 24, 2008 3:20 am
by yeti_c
You can get this in BOB by leaving the game screen very soon after loading it too.

C.

Re: ConquerStats - shows several ingame statistics

PostPosted: Wed Sep 24, 2008 4:29 am
by cspare
yeti_c wrote:You can get this in BOB by leaving the game screen very soon after loading it too.

C.


In the BOB plugin for getting the snapshot XML the script retries up to 10 times, has that something to do with this problem aswell? And do you have any idea why it still fails quite often after the page has been open for a while, but always works after a refresh?

Re: ConquerStats - shows several ingame statistics

PostPosted: Wed Sep 24, 2008 4:33 am
by yeti_c
cspare wrote:
yeti_c wrote:You can get this in BOB by leaving the game screen very soon after loading it too.

C.


In the BOB plugin for getting the snapshot XML the script retries up to 10 times, has that something to do with this problem aswell? And do you have any idea why it still fails quite often after the page has been open for a while, but always works after a refresh?


Yes - if you the image has changed then the 'URL' you have for it will be wrong so the server will return nothing - so you have to have the latest map image to take the snapshot - this can often happen in freestyle or speed. (i.e. someone else is playing and has changed the map)

C.

Re: ConquerStats - shows several ingame statistics

PostPosted: Mon Sep 29, 2008 4:53 pm
by cspare
I've just added a new script to ConquerStats: Score Charts. The start post is updated with some information.

The download link is: http://userscripts.org/scripts/show/34706.

I hope you all like it. Any feedback is appreciated.

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 30, 2008 1:24 am
by brandoncfi
I love it...Alothough the new script is not working for me the in-game in very useful

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 30, 2008 2:47 am
by yeti_c
Loving the new graphing tool - that is really awesome.

C.

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 30, 2008 8:12 am
by Twill
cspare - for some reason in a game I just finished "total attacks" was reading way too low.

It said I had something like 10 successful attacks when I had 8 in that round alone.

could you also explain what the stats are (either a hover CSS tooltip type thing or a help box)

Last request: an update alert like BOB and clickable maps have so that users who have this installed will know when to upgrade without coming here?

Is this using the new XML file?

Great work!
Twill

<edit> I lied, couple more suggestions: Split the graph into a 2nd thread, you're going to get a lot of traffic on that one and separate threads would be best.

Requests for the chart: add dates along the bottom (the date games ended?) and plot the game as a linkable point on the graph so a user can click on a point and be taken straight to a game for reference.

Re: ConquerStats - shows several ingame statistics

PostPosted: Tue Sep 30, 2008 8:40 am
by Optimus Prime
I've installed them both, but.... the Score Chart isn't working. It says "Loading chart..." and then finishes, but nothing is displayed. :(