Are 1vs1 statiscics collected shomewhere?

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

I suppose that Wesnoth replay file dosnt include info about winner and loser of a game (dont know how it would be possible for it to have them) and because of that its hard to get overall statistics for 1vs1 games? Is that true or maybe Wesnoth devs have such tool, and if not are they interested in it? Or maybe giving a try to get such info is a bad idea?
Ten soldiers wisely led will beat a hundred without a head.
Caphriel
Posts: 994
Joined: April 21st, 2008, 4:10 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Caphriel »

Wesnoth developers are pretty uninterested in tracking statistics, historically. It's on the list of frequently proposed ideas that are never going to happen.
Yoyobuae
Posts: 408
Joined: July 24th, 2009, 8:38 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Yoyobuae »

Join the ladder and ignore the elo points.

True, not all players do the ladder, but at least you get some sort of statistics. Uploading the replays is a nice feature too.

Also you get to jump into any game with "(ladder)" on it. That's the main reason for me joining it, as 1v1 are a bit rare and frequently ladder games.
grrr
Posts: 252
Joined: May 25th, 2007, 9:49 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by grrr »

Ask eyerouge for the ladder database.
User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

Yoyobuae wrote:Join the ladder and ignore the elo points.

True, not all players do the ladder, but at least you get some sort of statistics. Uploading the replays is a nice feature too.

Also you get to jump into any game with "(ladder)" on it. That's the main reason for me joining it, as 1v1 are a bit rare and frequently ladder games.
Im registered ;)
grrr wrote:Ask eyerouge for the ladder database.
I already have one ;) Found it in ladder site online topic :)
Ten soldiers wisely led will beat a hundred without a head.
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Re: Are 1vs1 statiscics collected shomewhere?

Post by Yogibear »

A regular save has a statistics area that stores the information you can see in the statistics dialog, but only for the current state of the game, not for previous turns.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

Yogibear wrote:A regular save has a statistics area that stores the information you can see in the statistics dialog, but only for the current state of the game, not for previous turns.
I suppose they are calculated each time when statistic window is opened? Or maybe if I would search for specific tag in replay file i would find them?

I was looking at replay file but it looks like simple list of actions that occurred during the game. I made a script for myself, dont know if anybody would be interested in it. Its quite brutal and straightforward but looks it works somehow. It works as follows:
- open game history on ladder website (any amount of pages, for example: game history pages for last year)
- parse it and put data into variables
- open replay archive pages, search for 1vs1 games and create variables again
- compares ladder game list with replay archive games to find replays of ladder games that are in archive (dont want to go into details now)
- download replays and do some brutal regex matches
- output data (csv, sqlite)

The purpose is to get some extra data that arent available in replays and find interesting games or matchups that You have no idea how to play. Sample output is in attached screenshot. Unfortunately output csv can be also used provide detailed 1vs1 stats, so I dont know if I should post it in public :hmm: But even if I should Im not interested to making any frontends to it, so having spreadsheet software or sql knowledge is required.

Pls any ladder admin to tell if they dosnt mind to use their website this way :)
Attachments
screenshot.jpg
Ten soldiers wisely led will beat a hundred without a head.
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Re: Are 1vs1 statiscics collected shomewhere?

Post by Yogibear »

Quetzalcoatl wrote:
Yogibear wrote:A regular save has a statistics area that stores the information you can see in the statistics dialog, but only for the current state of the game, not for previous turns.
I suppose they are calculated each time when statistic window is opened? Or maybe if I would search for specific tag in replay file i would find them?
Well, they are shown each time the statistic window is opened, but they are calculated all the time, whenever an attack happens. The savefile contains the current statistics at the point of saving. They are meant to be within a [statistics]-tag at the root WML level. It might be that replays don't have them, i am not sure. If they are available, you will find them at the end of the file.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
grrr
Posts: 252
Joined: May 25th, 2007, 9:49 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by grrr »

Nice hack, Q. I would advice you to throttle your script when fetching games though. Your regex matching OTOH is totally irrelevant to the webservers, you've only got your own box to fry =)

Please. continue this work. If all games are made public like that (with no chat removed etc) then surely you are free to use them in whichever way you can think of. Google approves your data mining effort =p

Once your game parser works submit it to the ladder project. The statistic information you extracted would be very useful.
Spoiler:
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Re: Are 1vs1 statiscics collected shomewhere?

Post by Yogibear »

grrr wrote:And now I am going to propose a killer feature: ...
I tried that with macros in MS Excel already to create graphs of damage and EV deviations throughout the game from replay information.

It works, but it has some problems. One for example is figuring out the unit types, although that is doable for default era if you provide a table that matches numbers to types. Next to impossible is to evaluate traits, making it as well impossible to gather hitpoints and other information.

I gave up on that for the moment.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

Looks like replays from archive doesnt have statistics :( but normal replay saved from menu or at the end of the game have it :) Thx, this is in fact very useful info ;) I wouldnt find it without hint probably.
grrr wrote:Nice hack, Q. I would advice you to throttle your script when fetching games though. Your regex matching OTOH is totally irrelevant to the webservers, you've only got your own box to fry =)
Thx :) Its not so bad as it may look (hope internet will survive the day when I finally run it :hmm:) at least its not multi thread ;) In this case its an advantage ;) Do not worry about my laptop btw. Bought new one lately to be able to use more regular expressions ;)
grrr wrote:Please. continue this work. If all games are made public like that (with no chat removed etc) then surely you are free to use them in whichever way you can think of. Google approves your data mining effort =p
Sure I will. I dont like to leave unfinished work, unfortunately I have so much work lately :augh: Hope to be able post sth soon :hmm: I was thinking about similar killer feature before but so far I even doesnt have basic features so maybe I will wait a bit with implementing it ;)
Ten soldiers wisely led will beat a hundred without a head.
User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

Here are the results (I hope they are mostly OK – look for attached PDFs). Thx for cool ladder and archive replay websites, they made this possible. Hope some of you would be interested in what I would post here.

About results first:

First of all you should understand that they doesn't tell much about balance of the game, but simply just shows whats going on on MP server. However I believe that for experienced player who understands most of the game concepts it would be possible to find interesting info. In fact I wasn't sure if I should post them as I believe taking them too literally can be harmful. They are few reasons for that (why the results are the way they are), but most important thing is that the outcome of a game is a summary of bad decisions and mistakes with little RNG twist (RNG impact is also heavily overestimated). As its mainly related to understanding of the game by players (pls, remember that it can take a very long time to become good player) and some randomness its very hard to get reliable data. I don't want to discuss game aspects or strategies here (in fact I am not interested in discussing them at all), as this post will be very long anyway. What I am trying to tell you is that you shouldn't get too excited about what you will find in result files.

How I obtained results:

I made a simple Ruby script (also attached) that first parsed ladder games list, then parsed replay archive games list and compared them together. Matching games was in fact made just by simple guessing (based on comparing of dates when games was reported on ladder and saved in archive) as there is no relation between archive games and ladder games errors are possible. After comparing games matching replays was downloaded and simple text searching was made to get some very basic game info (pls note that it is not replay parser, and will never be as making it looks like a trap to me for reasons that Yogibear mentioned above).

That was the only way I was able think of to get winner and loser for replay archive games. As there is only 1vs1 ladder there are only 1vs1 results. Also I decided not to download replays from ladder website, as many of ladder games doesn't have them, some of them are corrupted and ppl often upload saved games instead of replays (I just didn't wanted to deal with all of that). While its impossible to get contents of [statistics] tag from replay archive games it looks like you can find it in replays uploaded on ladder. However I don't think it makes much sense to do so, as you will see even simple filtering will reduce amount of games dramatically and filtering them even more would give so few games that having statistics based of them makes almost no sense to me.

I didn't get matches for all games. Its obvious I couldn't get replays for games that doesn't have replay in archive, also as guessing was based on dates I was forced to pass on games that was reported too late. Corrupted replays were also skipped (as its possible to get data from them but that lead to some other problems (that's not good excuse, but oh well that's the way it is)), games shorter than 7 turns was omitted as in such short game something just go wrong. After all that is what have been done:
  • 11252 ladder games found (18.01.2010)
  • 8238 replays found and inspected without errors (i hope)
  • 527 found replays was corrupted somehow
  • 2487 replays was missing
About script and generated files:

Pls have in mind that this one was always meant to be temporary and improvised solution. As such it doesn't have:
  • unit tests, because it have no bugs ;),
  • proper error handling (related to previous one),
  • documentation, as its self-explainable ;),
  • its clumsy, as its enough to be run once
Also I had plan to do this in less than 100 LOC first so that's the reason why code is of quite bad quality (never thought about it too much). Would be nice then if you wouldn't want to discuss quality of this one with me. To defend it a bit lets find some cool features included:
  • Colorful output (isn't it cool eh? :D)
  • Cache (after running script once you don't need internet connection anymore), note that it doesn't have cache management so you need to use rm or right mouse button for cleaning.
If you want to change all of above, modify the way it gets data or just add new features feel free to do so. I'm not able to help you a lot if you are using Windows. You need Ruby interpreter and ruby gems. After installing both you would also need to install nokogiri (its a Japanese word) and prawn (only if you want to generate PDFs) gems. The best way to do so (if you don't use ruby) is by package manager. If you can't find them in package list execute:
  • gem install nokogiri
  • gem install prawn
You need to have few folders in working directory:
  • cache – place when archive games, ladder games list will be stored,
  • cache/replay_archive – cache folder for downloaded replays,
  • out – results will be saved there,
  • pdf – for generating PDFs (only if needed),
otherwise you should see error thrown by interpreter.

To change the way this script works you need to edit script files, as it can't be run with parameters for now. Two script files are included: archives_and_ladders.rb (gets data and generate output csv and yml) and simple_results.rb (generate PDF files in pdf folder (sorry this one is of even worse quality)).

I don't think previous instructions would be really needed as I also attach to this post results in CSV and YAML files. CSV is easy to use and check with grep if you have shell access, but if you really want to search games with custom criteria you should consider using YAML library for language of yours choice as the results.yml is just serialized array of hashes dumped by script.

CSV file looks as follows:

Code: Select all

time_when_game_was_reported_on_ladder, if_it_has_replay_on_ladder, time_when_game_was_saved_in_replay_archive, link_to_replay, map_name, turns, winner_ladder_name, winner_archive_replay_name, winner_elo, winner_side, winner_faction, winner_leader, loser_ladder_name, loser_archive_replay_name, loser_elo, loser_side, loser_faction, loser_leader
Note: You can access game details on ladder website by passing time when game was reported in query string.

What can I do with that?

First of all you can open PDF files in yours document viewer ;) If you have shell access you can also easily check if values in tables are right by running cat, grep and wc. Using grep on results.csv is an easy way to find specific matches with specified factions/leaders/maps/players so that should be useful for searching games you would like to see. If you are on Windows or don't want to use grep for some reason the best way is to open CSV file in Open Office Calc, MS Excel or any other software that can display CSV files and offers simple filtering of them.

Hope that this files doesn't include to many errors :)

What is included in attachments?
  • Archive file with required directory structure and both script files.
  • Archive file with result.csv and result.yml files.
  • 4 PDF files for all found games, with different turn limit.
  • 4 PDF files for games that was played by two at least 1800 elo players, with different turn limit.
As you will see in PDF files results for 1000+ elo games makes often no serious meaning, and for 1800 there is not enough data to make more detailed collations that would be meaningful.

Hope this wont be epic fail as i didn't tested this too much.
Love it or hate it ;)
Attachments
min_elo_1800_turns_7-14.pdf
elo 1800 turns 7-14
(94.53 KiB) Downloaded 549 times
min_elo_1000_turns_7-70.pdf
elo 1000 turns 7-70
(94.85 KiB) Downloaded 335 times
min_elo_1000_turns_22-70.pdf
elo 1000 turns 22-70
(94.7 KiB) Downloaded 323 times
min_elo_1000_turns_15-21.pdf
elo 1000 turns 15-21
(94.72 KiB) Downloaded 275 times
min_elo_1000_turns_7-14.pdf
elo 1000 turns 7-14
(94.74 KiB) Downloaded 358 times
Last edited by Quetzalcoatl on January 21st, 2010, 4:53 pm, edited 2 times in total.
Ten soldiers wisely led will beat a hundred without a head.
User avatar
Quetzalcoatl
Posts: 207
Joined: March 18th, 2009, 3:26 pm

Re: Are 1vs1 statiscics collected shomewhere?

Post by Quetzalcoatl »

I will continue here as it looks there is 5 attachment limit. Hope all those files would be useful.
Attachments
Wesnoth.tar.gz
script - CSV and YML files are in out directory
(715.37 KiB) Downloaded 244 times
min_elo_1800_turns_22-70.pdf
elo 1800 turns 22-70
(89.78 KiB) Downloaded 361 times
min_elo_1800_turns_15-21.pdf
elo 1800 turns 15-21
(94.52 KiB) Downloaded 301 times
min_elo_1800_turns_7-70.pdf
elo 1800 turns 7-70
(94.64 KiB) Downloaded 401 times
Ten soldiers wisely led will beat a hundred without a head.
User avatar
Cackfiend
Posts: 480
Joined: January 28th, 2007, 7:36 am
Location: Florida, USA
Contact:

Re: Are 1vs1 statiscics collected shomewhere?

Post by Cackfiend »

very cool stuff

nice work Quetz



no surprise Freelands is played WAAAAAAAY more than any other
"There's no love in fear." - Maynard James Keenan

I'm the guy who's responsible for 40% Gliders in all hexes... I can now die a happy man. =D
User avatar
eyerouge
Posts: 380
Joined: June 29th, 2007, 4:37 am
Location: wtactics.org
Contact:

Re: Are 1vs1 statiscics collected shomewhere?

Post by eyerouge »

Excellent work - way to go Q! :)
Post Reply