• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 19:57
CEST 01:57
KST 08:57
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
Who will win EWC 2025? Geoff 'iNcontroL' Robinson has passed away Program: SC2 / XSplit / OBS Scene Switcher Why doesnt SC2 scene costream tournaments RSL Revival patreon money discussion thread
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame
Brood War
General
Corsair Pursuit Micro? BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Pro gamer house photos Flash Announces (and Retracts) Hiatus From ASL
Tourneys
BWCL Season 63 Announcement CSL Xiamen International Invitational [Megathread] Daily Proleagues 2025 ACS Season 2 Qualifier
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
[MMORPG] Tree of Savior (Successor of Ragnarok) Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread The Games Industry And ATVI Stop Killing Games - European Citizens Initiative
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 562 users

s2gs file -- a fun little mystery for us

Forum Index > SC2 General
Post a Reply
Normal
dsjoerg
Profile Joined January 2012
United States384 Posts
April 20 2012 21:00 GMT
#1
hi TL nerds,

a lot of people have been asking over the years if we could figure out a way to get Spending Quotient and other interesting stats about our matches. there is an interesting file that i believe contains all the stats that are shown in the Summary Screen after a game completes.

it's the s2gs file. You can trigger arbitrary *.s2gs files to be downloaded to your machine by viewing game summaries in the SC2 client. In SC2, go to your Match History, then click on one of the magnifying glasses. That will trigger a new s2gs file to be downloaded to your machine.

On my Mac, they're in paths like this:
/Users/Shared/Blizzard/Battle.net/Cache/69/61/6961b3a6c6c294dbff91a786d60fddea962e70b01a040a5c7a096987896a2e0e.s2gs


On PCs I'm told they are here:
C:\ProgramData\Blizzard Entertainment\Battle.net\Cache


The easiest way to find a s2gs file is to look at some match summary screen in the game client, then go to the directory and sort by date modified.

If we all put our heads together, I bet we can figure out the format.

A fellow SC2 nerd, Nick, was able to get this far:

#!/usr/bin/env python

import zlib

data = open("test.s2gs","rb").read()

print zlib.decompress(data[16:])


Some of you may wonder about what Blizzard's reaction to this project will be. I hope that Blizzard will have the same reaction that they've had to the community's study of the structure of the MPQ and the replay format -- essentially none. Of course, if Blizzard prefers that this project not move forward, I for one will cease immediately.

I'm not sure what's the best way to structure our findings -- I guess people can post what they discover in this thread, and once that becomes unwieldy, someone can set up a wiki or public Google docs page to hold the findings. Or a github project.

You might be asking, what's the point of being able to parse s2gs files? Basically every tool that does anything useful with replays could parse s2gs as well, and all the info that is visible in the end-of-game summary screen could be merged with the replay info. For example, computing Spending Quotient would be trivial. There are about 30 other cool things would be immediately quite doable.
card-carrying grubby fan. developer of GGTracker.
Kralic
Profile Blog Joined March 2010
Canada2628 Posts
April 20 2012 21:04 GMT
#2
I am not sure what to say... so I will say good luck decrypting the encrypted file.
Brood War forever!
Monokeros
Profile Blog Joined November 2005
United States2493 Posts
April 20 2012 21:04 GMT
#3
This would be all kinds of amazing seeing this kind of information more power to you sir.
Keep the Dream Alive twitch.tv/monokerros
TelecoM
Profile Blog Joined January 2010
United States10671 Posts
April 20 2012 21:07 GMT
#4
Sounds interesting but I don't even understand what you are saying to be honest, hope it works out for you.
AKA: TelecoM[WHITE] Protoss fighting
spancho
Profile Joined September 2009
United States161 Posts
April 20 2012 21:15 GMT
#5
On April 21 2012 06:04 Kralic wrote:
I am not sure what to say... so I will say good luck decrypting the encrypted file.


I dont think its encrypted, just compressed. This seams like a cool project, but I cant think of anything you can get from the summery that you couldnt get from the replay file. Just easier parsing perhaps?
"Your face can't hurt 'cuz you're ugly." -Tasteless
dsjoerg
Profile Joined January 2012
United States384 Posts
April 20 2012 21:19 GMT
#6
spancho, the summary has a lot of things you can't get from the replay, for example:
* average unspent resources
* resource collection rate
* number of workers created
* first 64 things built by each player

each of these can be estimated from the replay, but in many cases the estimation will be off, sometimes by a lot.

the replay file contains build commands that fail due to lack of resources, and there's no way to tell which these are without recreating the whole game engine. unspent resources also cannot be calculated without essentially rebuilding the game engine.

also the replay file doesnt tell you when workers are killed. when my workers die it can change my resource collection rate a lot
card-carrying grubby fan. developer of GGTracker.
InfCereal
Profile Joined December 2011
Canada1759 Posts
April 20 2012 21:21 GMT
#7
On April 21 2012 06:15 spancho wrote:
Show nested quote +
On April 21 2012 06:04 Kralic wrote:
I am not sure what to say... so I will say good luck decrypting the encrypted file.


I dont think its encrypted, just compressed. This seams like a cool project, but I cant think of anything you can get from the summery that you couldnt get from the replay file. Just easier parsing perhaps?


It would be a way to get spending quotient without relying on a sketchy text recognition script.
Cereal
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
Last Edited: 2012-04-21 13:07:00
April 21 2012 13:05 GMT
#8
Would you care to upload a decompressed version of an s2gs file?

I keep getting an "input string does not conform to zlib format" when trying to do this myself...

Edit: nvm, got it working now.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 21 2012 13:19 GMT
#9
This is really interesting. I've found some things and will continue trying to understand it. I will "publish" my findings here: (Wiki)User:Prillan/s2gs
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
zyce
Profile Blog Joined March 2011
United States649 Posts
Last Edited: 2012-04-21 13:32:46
April 21 2012 13:30 GMT
#10
I'm not sure this file has complete data, I'm only seeing reference points (game speed, difficulty, players) and no game data such as resources/workers.

It would be nice to chat with some others who are working with this data. I'm in #teamliquid on IRC.

Edit(s): zlib 1.2.5 being used instead of 1.2.6.
Beauty is not the goal of competitive sports, but high-level sports are a prime venue for the expression of human beauty. The relation is roughly that of courage to war.
zyce
Profile Blog Joined March 2011
United States649 Posts
April 21 2012 14:20 GMT
#11
After some further discussion, I believe this might be a red herring. A file containing reference points needed to parse the relevant packets coming from Battle.net, which are consumed by the replay scoreboard to populate variables.

Beauty is not the goal of competitive sports, but high-level sports are a prime venue for the expression of human beauty. The relation is roughly that of courage to war.
RobiTL
Profile Joined July 2010
France55 Posts
April 21 2012 17:05 GMT
#12
I added some things to your liquipedia page (including the 2 lines required in PHP to read and decompress the file)
Born to be Zerg
dsjoerg
Profile Joined January 2012
United States384 Posts
April 21 2012 21:30 GMT
#13
I believe the s2gs file is actually the concatenation of a few different logical files.
card-carrying grubby fan. developer of GGTracker.
RobiTL
Profile Joined July 2010
France55 Posts
Last Edited: 2012-04-22 00:54:05
April 22 2012 00:23 GMT
#14
Ok I'm 100% sure there is all the data that we want :D

Values as stored as the double !

0x28 => 40 => 20
0x50 => 80 => 40
0xF001 => 240+0 =>120
0x9802 => 152+1*128 => 280
0xc002 => 192+1*128 => 320
0x9003 => 144+2*128 => 400
0xe003 => 224+2*128 => 480
General rule : YY1 YY2 gives (YY1 + (YY2 - 1) * 128) / 2



Graph data is like this :
02 04 00 04 09 [XX] 05 06 00 09 [YY1 YY2 YY3 ...]
XX is X coordinates 00,02,04, ...,3C
YY is Y coordinate as stated above.

average unspent resource is preceded by 05040009ce0f02090802001e00
Ressource collection rate is preceded by 05040009ce0f02090a02001e00

05040009ce0f02090a02001e00 ==> ressource collection rate
0205060009 f018 02040004099a1300 => player 1's = f018
0205060009 ba1e 02040004099a1300 => player2's = ba1e
0000 3's
0000 4's
0000 5's
0000 6's
0000 7's
0000 8's
0000 9's
0000 10's
0000 11's
0000 12's
0000 13's
0000 14's
00 end
Born to be Zerg
RobiTL
Profile Joined July 2010
France55 Posts
Last Edited: 2012-04-22 02:52:53
April 22 2012 02:15 GMT
#15
Ok I just wrote a PHP script that reads all the score values, which leaves build order and graph data to do !
Here is an output example :

+ Show Spoiler +

Array
(
[Player0] => Array
(
[Resources] => 28425
[Units] => 32725
[Structures] => 6100
[Overview] => 69300
[Average Unspent Resources] => 797
[Resource Collection Rate] => 1592
[Workers Created] => 70
[Units Trained] => 132
[Killed Unit Count] => 87
[Structures Built] => 63
[Structures Razed Count] => 0
[Spending Quotient] => 82.506486242342
)
[Player1] => Array
(
[Resources] => 31012
[Units] => 56625
[Structures] => 7000
[Overview] => 98487
[Average Unspent Resources] => 1495
[Resource Collection Rate] => 1949
[Workers Created] => 112
[Units Trained] => 252
[Killed Unit Count] => 85
[Structures Built] => 32
[Structures Razed Count] => 11
[Spending Quotient] => 77.608697996132
)
)


And here is the PHP script :
+ Show Spoiler +

<?php
$c = bin2hex(gzuncompress(file_get_contents($_GET['file'].'.s2gs', false, null, 16)));
$desc = array('Resources','Units','Structures','Overview','Average Unspent Resources','Resource Collection Rate','Workers Created','Units Trained','Killed Unit Count','Structures Built','Structures Razed Count');
for ($i = 0; $i < sizeof($desc); $i++)
{
$bleh = str_pad(base_convert($i * 2, 10, 16), 2, '0', STR_PAD_LEFT);
$search = '09ce0f0209'.$bleh.'02001e00';
$pos = strpos($c, $search) + strlen($search);
$found = 0;
for ($p = 0; $p <= 14; $pos += 2)
{
$hex = substr($c, $pos, 2);
if ($hex == '02')
{
$found = 1;
$after = strpos($c, '020400', $pos);
$value = substr($c, $pos + 10, $after - $pos - 10);
$v = 0;
for ($x = 0; $x*2 < strlen($value); $x++)
{
$dec = base_convert(substr($value, $x*2, 2),16,10);
if ($x == 0) $inc = $dec;
if ($x == 1) $inc = ($dec-1)*128;
if ($x == 2) $inc = ($dec-1)*16384;
$v += $inc;
}
$v = $v / 2;
$players['Player'.$p][$desc[$i]] = $v;
$pos = $after;
}
if ($hex == '00')
{
if ($found == 1) $found = 0;
else $p++;
}
}
}
foreach($players as $k => $v)
{
$i = $players[$k]['Resource Collection Rate'];
$u = $players[$k]['Average Unspent Resources'];
$players[$k]['Spending Quotient'] = 35*(0.00137*$i-log($u))+240;
}
echo '<pre>';
print_r($players);
echo '</pre>';
?>
Born to be Zerg
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 02:20 GMT
#16
holy moly!
card-carrying grubby fan. developer of GGTracker.
BrothersCommunityTV
Profile Joined August 2011
Belgium13 Posts
April 22 2012 02:42 GMT
#17
Great job everyone
Torpedo.Vegas
Profile Blog Joined January 2011
United States1890 Posts
Last Edited: 2012-04-22 02:45:22
April 22 2012 02:44 GMT
#18
Now do it with all the files in SC2, find me more goodies!

P.S. Can and admin rename the SC2 forum "The Goodie Room" for few hours or so? lol
RobiTL
Profile Joined July 2010
France55 Posts
April 22 2012 02:53 GMT
#19
I just added the spending quotient to my script, edited on my previous post.
Born to be Zerg
zylog
Profile Joined August 2010
Canada943 Posts
April 22 2012 03:00 GMT
#20
This is awesome. I wonder if this can somehow be integrated into sc2gears to add additional information for replay analyses.
eXigent.
Profile Blog Joined February 2007
Canada2419 Posts
April 22 2012 03:03 GMT
#21
On April 22 2012 12:00 zylog wrote:
This is awesome. I wonder if this can somehow be integrated into sc2gears to add additional information for replay analyses.


That would be really sick! Awesome work OP
Marti
Profile Joined August 2011
552 Posts
April 22 2012 03:21 GMT
#22
Now you got me curious, but i'm still not sure about the actual use of the information.
#adun giveafuck - - - "Did this guy just randomly finger me?" - Sayle
tec27
Profile Blog Joined June 2004
United States3696 Posts
April 22 2012 03:28 GMT
#23
On April 22 2012 09:23 RobiTL wrote:
Ok I'm 100% sure there is all the data that we want :D

Values as stored as the double !

0x28 => 40 => 20
0x50 => 80 => 40
0xF001 => 240+0 =>120
0x9802 => 152+1*128 => 280
0xc002 => 192+1*128 => 320
0x9003 => 144+2*128 => 400
0xe003 => 224+2*128 => 480
General rule : YY1 YY2 gives (YY1 + (YY2 - 1) * 128) / 2



Graph data is like this :
02 04 00 04 09 [XX] 05 06 00 09 [YY1 YY2 YY3 ...]
XX is X coordinates 00,02,04, ...,3C
YY is Y coordinate as stated above.

average unspent resource is preceded by 05040009ce0f02090802001e00
Ressource collection rate is preceded by 05040009ce0f02090a02001e00

05040009ce0f02090a02001e00 ==> ressource collection rate
0205060009 f018 02040004099a1300 => player 1's = f018
0205060009 ba1e 02040004099a1300 => player2's = ba1e
0000 3's
0000 4's
0000 5's
0000 6's
0000 7's
0000 8's
0000 9's
0000 10's
0000 11's
0000 12's
0000 13's
0000 14's
00 end

The format of the data looks like the serialized data format used elsewhere in replay files. See https://github.com/GraylinKim/sc2reader/wiki/Serialized-Data

0x05 is a Key-Value object, so average unspent resources is a Key-Value object with 2 entries. First key (key 0x0) is a variable length integer (0x09). Second key (key 0x02) is also a variable length integer (0x09). sc2reader has a parser for this format written in python, and I also have a parser of my own written in javascript: https://github.com/tec27/comsat/blob/master/lib/parsers/blizzerial.js

Hopefully that helps you see what the prefixes are for and stuff
Can you jam with the console cowboys in cyberspace?
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 04:31 GMT
#24
Hi, so I added a couple fixes to the code mentioned above. The wiki hasn't been updated but the code is very simple and can be found on the master branch of the repo (here).

The uncompressed data appears to be a list of structures. I had 9 in the example I was working from, the number may vary based on the number of players, not sure yet. An example python script I am using can be found below:

+ Show Spoiler +

import zlib, sys, pprint
from sc2reader.utils import ReplayBuffer

with open(sys.argv[1],"rb") as s2gs:
raw_data = zlib.decompress(s2gs.read()[16)
buffer = ReplayBuffer(raw_data)
data = [
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct()
]

pprint.PrettyPrinter(indent=2).pprint(data)
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 09:56 GMT
#25
Oh! Nice work! Please edit (Wiki)User:Prillan/s2gs so we have it all documented
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
RobiTL
Profile Joined July 2010
France55 Posts
April 22 2012 12:03 GMT
#26
Ok I installed your python thingy, here is what i got :
on 4th structure :
{ 0: 999, 1: 0} resources [{ 0: ressources, 1: 0, 2: game time}]
{ 0: 999, 1: 1} units
{ 0: 999, 1: 2} structures
{ 0: 999, 1: ...} ...
on 5th structure (weird that it is in another structure, especially the razed count)
{ 0: 999, 1: 10} is structure razed count ? { 0: structure razed count, 1: 0, 2: game time}
{ 0: 999, 1: 11} is resource graph [{0:army value, 1:0,2: game time}, ...]
{ 0: 999, 1: 12} is army graph [{0:army value, 1:0,2: game time}, ...]
{ 0: 999, 1: 16777328} is unknown ??

So we also have the graph data now, only need to find the build order information now...
Born to be Zerg
RobiTL
Profile Joined July 2010
France55 Posts
Last Edited: 2012-04-22 13:09:38
April 22 2012 12:29 GMT
#27
On both replays, the AI did :
00:03 drone 7/10
00:22 drone 8/10
00:44 drone 8/10

On the first i did :
00:05 drone 7/10
00:19 drone 8/10
00:30 drone 9/10
00:49 over 9/10
00:57 drone 10/10

On the second i did :
00:02 drone 7/10
00:18 drone 8/10
00:28 drone 9/10
00:39 drone 10/10
00:56 over 10/10

I think the data of the build orders (only changes i could find in all structures) is in the 5th structure after the graphs !

Data of the first replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0x1000A, 2: 0x4900},
{ 0: 8, 1: 0x2000A, 2: 0x12F00},
{ 0: 9, 1: 0x4000A, 2: 0x1DE00},
{ 0: 10, 1: 0x7000A, 2: 0x38C00}],
[{ 0: 7, 1: 0xA, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 9, 1: 0x6000A, 2: 0x31600}],
[{ 0: 8, 1: 0x5000A, 2: 0x2C400}],


Data of the second replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0xA, 2: 0x1C00},
{ 0: 8, 1: 0x2000A, 2: 0x11C00},
{ 0: 9, 1: 0x4000A, 2: 0x1C400},
{ 0: 10, 1: 0x5000A, 2: 0x27600}],
[{ 0: 7, 1: 0x1000A, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 10, 1: 0x7000A, 2: 0x37800}],
[{ 0: 8, 1: 0x6000A, 2: 0x2C400}],


Edit : I put values of 1: and 2: in Hexadecimal, its easier to get values like this

I think 0x84 is for drones, 0x86 for overlords
the 0: is the supply (7,8,9,10)
the 1: not sure... the ending A might be the total supply (10)
the 2: I think is the time where
0x1C = 00:02
0x32 = 00:03
0x49 = 00:05
0x11C = 00:18
0x12F = 00:19
0x167 = 00:22
0x1C4 = 00:28
0x1DE = 00:30
0x276 = 00:39
0x2C4 = 00:44
0x316 = 00:49
0x378 = 00:56
0x38C = 00:57

anyone to get the general formula ?

Edit : Found ! i's in 16th of seconds !
0x1DE = 478 and 478/16 = 29.875 so 00:30


Born to be Zerg
windzor
Profile Joined October 2010
Denmark1013 Posts
April 22 2012 12:55 GMT
#28
On April 22 2012 12:21 Marti wrote:
Now you got me curious, but i'm still not sure about the actual use of the information.


It's reliable stats. Think if a tournament like MLG or DH gets all s2gs files. They can then, for each player, calculate the most used build order or stuff like that. It would be possible to see trends in metagame with build orders. It's just more stats which you can't get out of the replay files. altough they are "harder" to retrieve for a big tournaments because s2gs isn't made so you can share the information like replay files are.
Yeah
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-22 13:41:54
April 22 2012 13:38 GMT
#29
We should create a collection of example files so we can test them out.
I'll start:
stats0.s2gs
stats1.s2gs
stats2.s2gs
stats3.s2gs
| File |       Date |     Time | Team | Race | Player       | BNet ID       |  Resc | Units | Structs | O.view |
|------+------------+----------+------+------+--------------+---------------+-------+-------+---------+--------|
| 0 | 2012-04-18 | 21:17:06 | 1 | Z | PetaleDeRose | /EU/1/2012869 | 23900 | 40725 | 6125 | 71950 |
| 0 | | | 2 | P | Hashmush | /EU/1/2158213 | 22025 | 25200 | 4350 | 53025 |
| 1 | 2012-04-15 | 18:51:06 | 1 | P | Hashmush | /EU/1/2158213 | 5075 | 7450 | 1475 | 14100 |
| 1 | | | 2 | P | LemoN | /EU/2/146521 | 4300 | 4200 | 1400 | 10000 |
| 2 | 2012-04-15 | 15:44:51 | 1 | P | imbaL | /EU/1/2407329 | 24400 | 40250 | 4625 | 71025 |
| 2 | | | 2 | P | Hashmush | /EU/1/2158213 | 26875 | 52150 | 5900 | 87075 |
| 3 | 2012-19-22 | 22:24:38 | 1 | P | overgame | /EU/1/535265 | 17350 | 38525 | 4875 | 62650 |
| 3 | | | 1 | Z | Sun | /EU/1/756106 | 18331 | 38300 | 4100 | 62131 |
| 3 | | | 2 | P | Hashmush | /EU/1/2158213 | 16950 | 28550 | 2950 | 49150 |
| 3 | | | 2 | Z | Freemind | /EU/1/838056 | 18550 | 20150 | 2050 | 42450 |

EDIT: Meh, formatting

I'm only able to parse stats3.s2gs with Graylin's script.
+ Show Spoiler +

Traceback (most recent call last):
File "extract.py", line 89, in <module>
main()
File "extract.py", line 80, in main
buffer.read_data_struct()
File "build\bdist.win-amd64\egg\sc2reader\utils.py", line 270, in read_data_struct
datatype = self.read_byte()
File "build\bdist.win-amd64\egg\sc2reader\utils.py", line 150, in read_byte
return ord(self.read_basic(1))
TypeError: ord() expected a character, but string of length 0 found


My modified script:
+ Show Spoiler +
import zlib, sys, pprint
from sc2reader.utils import ReplayBuffer

races = {'Prot':'Protoss','Zerg':'Zerg','Terr':'Terran','RAND':'Random'}
data_names = [
'R',
'U',
'S',
'O',
'AUR',
'RCR',
'WC',
'UT',
'KUC',
'SB',
'SRC',

]
data_names_pretty = [
'Resources',
'Units',
'Structures',
'Overview',
'Average Unspent Resources',
'Resource Collection Rate',
'Workers Created',
'Units Trained',
'Killed Unit Count',
'Structures Built',
'Structures Razed Count'
]

def getRealm(str):
if str == '\x00\x00S2':
return "EU"

return "?"
def getPlayers(data):
players = []
parr = data[0][3]
for i in range(16):
if not (parr[i][0][1] == 0):
players.append(getPlayer(data, i))

return players
def getPlayer(data, index):
pinfo = data[0][3][index]
pdata = data[3][0]

player = {
'id': "{}/{}/{}".format(getRealm(pinfo[0][1][0][1]), pinfo[0][1][0][2], pinfo[0][1][0][3]),
'race' : races[pinfo[2]]
}

stats = {}

for i in range(len(pdata)):
stats[data_names[i]] = pdata[i][1][index][0][0]
stats[data_names[len(pdata)]] = data[4][0][0][1][index][0][0]
player['stats'] = stats

return player


def main():
p = sys.argv[2] == "players"
with open(sys.argv[1],"rb") as s2gs:
raw_data = zlib.decompress(s2gs.read()[16:])
buffer = ReplayBuffer(raw_data)

data = [
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct(),
buffer.read_data_struct()
]

if p:
pprint.PrettyPrinter(indent=2).pprint(getPlayers(data))
else:
pprint.PrettyPrinter(indent=2).pprint(data)

main()

It outputs the following for stats3.s2gs
+ Show Spoiler +
[ { 'id': 'EU/1/535265',
'race': 'Protoss',
'stats': { 'AUR': 958,
'KUC': 82,
'O': 62650,
'R': 17350,
'RCR': 1384,
'S': 4875,
'SB': 34,
'SRC': 5,
'U': 38525,
'UT': 96,
'WC': 61}},
{ 'id': 'EU/1/756106',
'race': 'Zerg',
'stats': { 'AUR': 794,
'KUC': 105,
'O': 62131,
'R': 18331,
'RCR': 1360,
'S': 4100,
'SB': 17,
'SRC': 7,
'U': 38300,
'UT': 183,
'WC': 70}},
{ 'id': 'EU/1/838056',
'race': 'Zerg',
'stats': { 'AUR': 1134,
'KUC': 20,
'O': 42450,
'R': 18550,
'RCR': 1354,
'S': 2050,
'SB': 17,
'SRC': 0,
'U': 20150,
'UT': 169,
'WC': 72}},
{ 'id': 'EU/1/2158213',
'race': 'Protoss',
'stats': { 'AUR': 587,
'KUC': 49,
'O': 49150,
'R': 16950,
'RCR': 1130,
'S': 2950,
'SB': 28,
'SRC': 0,
'U': 28550,
'UT': 90,
'WC': 45}}]
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 13:45 GMT
#30
On April 22 2012 18:56 Prillan wrote:
Oh! Nice work! Please edit rillan/s2gs on Liquipedia" target="_blank" href="https://liquipedia.net/starcraft2/Userrillan/s2gs">(Wiki)Userrillan/s2gs so we have it all documented


I don't have time to migrate documentation to the teamliquid wiki right now. Anyone who wants to compile a team liquid wiki can feel free to steal from the sc2reader wiki. Just leave a back reference to the project if you can.

Also, how can I get quoted text to preserve link markup?

On April 22 2012 21:29 RobiTL wrote:
Edit : Found ! i's in 16th of seconds !
0x1DE = 478 and 478/16 = 29.875 so 00:30


Yes, sc2runs 16 frames per second. You can use the games speed conversion to get real time if you wanted.

I should also mention that unit types on the build order are almost certainly integers. They should match up to the hex values in this data file. The types are also accessible programmatically, see the TargetAbilityEvent for an example.

There are a bunch of other oddities that might apply here. Game date is in a windows timestamp which has a wierd conversion function.

At this point I wish I had maintained my documentation better. Given that we're sitting here parsing a compressed byte stream I am hoping that reading the code isn't too much of an issue.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
RobiTL
Profile Joined July 2010
France55 Posts
Last Edited: 2012-04-22 13:47:40
April 22 2012 13:46 GMT
#31
@Prillian
You only need to read 5 data structures (the interesting stuff is on the 4th and 5th)
On some files if you try to read more it'll make the TypeError ord().
Born to be Zerg
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 14:07 GMT
#32
On April 22 2012 22:46 RobiTL wrote:
@Prillian
You only need to read 5 data structures (the interesting stuff is on the 4th and 5th)
On some files if you try to read more it'll make the TypeError ord().


Ok, thanks. Works a lot better now ^^
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 14:13 GMT
#33
On April 22 2012 22:46 RobiTL wrote:
@Prillian
You only need to read 5 data structures (the interesting stuff is on the 4th and 5th)
On some files if you try to read more it'll make the TypeError ord().


The ord error is an unchecked way of letting you know you hit the end of the buffer. The class could benefit from a more defensive programming style...
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Detri
Profile Blog Joined February 2011
United Kingdom683 Posts
April 22 2012 14:13 GMT
#34
ahhhh nerds and the internet, never ceases to amaze. Good work!
The poor are thieves, beggars and whores, the rich are politicians, solicitors and courtesans...
how
Profile Blog Joined January 2011
United States538 Posts
April 22 2012 14:19 GMT
#35
Two things.

1. This is an awesome project that will most likely yield great results.
2. Holy shit the TL community can work fast when it wants to.

♥
http://twitter.com/howsc
Dapper_Cad
Profile Blog Joined July 2010
United Kingdom964 Posts
April 22 2012 14:30 GMT
#36
Amazing stuff guys keep it up. I have a lay (idiot) question. If I wanted to see my changing sending quotient over my last hundred games, do I have to go back trough my games played and open the stats page 1 by 1 to generate the file and then run a program of some sort at the end of the process or would I need to get the program to hit the files as they were spat out or... I guess I'm basically asking when the cache folder gets cleaned....
But he is never making short-term prediction, everyone of his prediction are based on fundenmentals, but he doesn't exactly know when it will happen... So using these kind of narrowed "who-is-right" empirical analysis makes little sense.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 14:32 GMT
#37
My player struct looks like this:

{ 0: { 0: 0,
1: { 0: { 0: 2, 1: '\x00\x00S2', 2: 1, 3: 535265},
1: { 0: 3405691582L, 1: 11617005556283211776L}}},
1: { 0: 0},
2: 'Prot'}

The Bnet id can be constructed from

bnet =
{ 0: 2,
1: '\x00\x00S2',
2: 1,
3: 535265}

like this (pseudo-code)
bnet[1]/bnet[2]/bnet[3] = EU/1/535265

I believe that '\x00\x00S2' has to do with which server it's on. I'd like to see what it's for the other realms.

It coincides with the bnet part of the player entry in replays: replay.details
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 14:34 GMT
#38
On April 22 2012 23:30 Dapper_Cad wrote:
Amazing stuff guys keep it up. I have a lay (idiot) question. If I wanted to see my changing sending quotient over my last hundred games, do I have to go back trough my games played and open the stats page 1 by 1 to generate the file and then run a program of some sort at the end of the process or would I need to get the program to hit the files as they were spat out or... I guess I'm basically asking when the cache folder gets cleaned....

Test it out. Grab all the .s2gs files and see how old they are

Note that we're not done yet so all desired information isn't available yet
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Aelfric
Profile Blog Joined March 2010
Turkey1496 Posts
April 22 2012 14:39 GMT
#39
On April 22 2012 23:30 Dapper_Cad wrote:
Amazing stuff guys keep it up. I have a lay (idiot) question. If I wanted to see my changing sending quotient over my last hundred games, do I have to go back trough my games played and open the stats page 1 by 1 to generate the file and then run a program of some sort at the end of the process or would I need to get the program to hit the files as they were spat out or... I guess I'm basically asking when the cache folder gets cleaned....

I think it can be implemented in sc2gears or some program to create that file for every auto saved replay after the update.
Tomorrow never comes until its too late...
Dapper_Cad
Profile Blog Joined July 2010
United Kingdom964 Posts
Last Edited: 2012-04-22 14:50:12
April 22 2012 14:47 GMT
#40
I'll have a look when I get home. Regardless, great, GREAT things will come of this, as long as it's going. As an aside it's both odd and depressing that one of the colossal advantages which esports should have over regular sports is automated gathering of statistics with unprecedented breadth and depth and that's exactly what IP acti-bliz's constipated attitude toward IP gets in the way of. Whatever, can't emphasis enough, fantastic work.
But he is never making short-term prediction, everyone of his prediction are based on fundenmentals, but he doesn't exactly know when it will happen... So using these kind of narrowed "who-is-right" empirical analysis makes little sense.
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 14:57 GMT
#41
On April 22 2012 23:39 Aelfric wrote:
I think it can be implemented in sc2gears or some program to create that file for every auto saved replay after the update.


This file is downloaded from the bnet depots. Someone could packet sniff their computer and get the request URL. From there it will probably be possible to automatically download the S2GS files at will based on information from the replay.

I am fairly confident saying this because that is how map downloading currently works. You can grab the exact map file game was played on from the replay file via bnet.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-22 15:13:06
April 22 2012 15:04 GMT
#42
On April 22 2012 23:57 ShadesofGraylin wrote:
Show nested quote +
On April 22 2012 23:39 Aelfric wrote:
I think it can be implemented in sc2gears or some program to create that file for every auto saved replay after the update.


This file is downloaded from the bnet depots. Someone could packet sniff their computer and get the request URL. From there it will probably be possible to automatically download the S2GS files at will based on information from the replay.

I am fairly confident saying this because that is how map downloading currently works. You can grab the exact map file game was played on from the replay file via bnet.

I'm on it!

EDIT:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
deo1
Profile Joined April 2010
United States199 Posts
April 22 2012 15:18 GMT
#43
*looks down on nerd army*

Yes yes, continue working.

*ascends back into the internet*
Poooooor Protoss.
thurst0n
Profile Blog Joined December 2010
United States611 Posts
April 22 2012 15:28 GMT
#44
Nerds unite! This is just simply amazing. Not only the work itself but the collaboration! Yay Go Team Nerd!
P.S. I'm nub. If you'd like you can follow me @xthurst but its not worth it ill be honest
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 15:30 GMT
#45
On April 23 2012 00:04 Prillan wrote:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?


Awesome. Can you supply a set of replay files and their corresponding .s2gs hashes?

It'd help to have a common set of data for everyone to be working with, possibly with screenshots of the score screens as well. Ideally a mix of 1v1,2v2,4v4, FFA games to see how/if the player count affects the structure.

I haven't booted SC in weeks so this would be particuarly helpful to me...
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 15:38 GMT
#46
On April 23 2012 00:30 ShadesofGraylin wrote:
Show nested quote +
On April 23 2012 00:04 Prillan wrote:
Found it.

GET /{hash}.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*


Now to figuring out the hash. Maybe it's contained in the replay somewhere?


Awesome. Can you supply a set of replay files and their corresponding .s2gs hashes?

It'd help to have a common set of data for everyone to be working with, possibly with screenshots of the score screens as well. Ideally a mix of 1v1,2v2,4v4, FFA games to see how/if the player count affects the structure.

I haven't booted SC in weeks so this would be particuarly helpful to me...


Sure, I need to structure my work a bit first.. It's a mess ^^

Do anyone know how the map hash is calculated?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 15:46 GMT
#47
On April 23 2012 00:38 Prillan wrote:
Do anyone know how the map hash is calculated?


The map hash is stored in the replay.initData file in the .SC2Replay MPQ archive. We don't calculate it, we just use it. The initData file actually stores a bunch of resource identifiers but none of them (that I know of) are this .s2gs file though so it is probably stored elsewhere.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 16:06 GMT
#48
On April 23 2012 00:46 ShadesofGraylin wrote:
Show nested quote +
On April 23 2012 00:38 Prillan wrote:
Do anyone know how the map hash is calculated?


The map hash is stored in the replay.initData file in the .SC2Replay MPQ archive. We don't calculate it, we just use it. The initData file actually stores a bunch of resource identifiers but none of them (that I know of) are this .s2gs file though so it is probably stored elsewhere.


Sad news: The hash is actually the SHA-256 hash of the file itself.

I'm trying to find some kind of index file to grab from the same source.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 16:09 GMT
#49
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
thurst0n
Profile Blog Joined December 2010
United States611 Posts
April 22 2012 16:13 GMT
#50
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."
P.S. I'm nub. If you'd like you can follow me @xthurst but its not worth it ill be honest
looknohands119
Profile Joined March 2010
United States815 Posts
April 22 2012 16:20 GMT
#51
This is really great work guys!
"The kingdom of the heavens is buried treasure. Would you sell yourself to buy the one you've found?" - Jon Foreman ('Your Love Is Strong' - Spring EP)
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 16:34 GMT
#52
On April 23 2012 01:13 thurst0n wrote:
Show nested quote +
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."

Yeah, that's not the problem ^^

We wanted to find a way to calculate the hash so we could download the file given a replay. Now we can only use new .s2gs files and those already in the Cache folder. The other ones are lost forever
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 16:35 GMT
#53
On April 23 2012 01:13 thurst0n wrote:
Show nested quote +
On April 23 2012 01:09 ShadesofGraylin wrote:
The s2gs file is named after a hexdigest of it's contents. E.g.

+ Show Spoiler +
>>> import hashlib
>>> s2gs = open('775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46.s2gs','rb')
>>> print hashlib.sha256(s2gs.read()).hexdigest()
'775e7f7858721decd2c20c479691fba3e00d23cc5165aea8538b5b5e1dc5ba46'


I would guess that map files are named the same way. This means that if we can't find an explicit reference from the replay file we might be out of luck with the automatic downloading.

There is no date or timestamp that could be compared/checked? I'm novice programmer, but I figure there has to be something between the replay file and the s2gs file that would match and that would be unique that could be cross referenced. Date/Time seems like a good place to start..but again i'm novice, and as my sig says "I'm Nub."


The issue of correlating two files is different from the issue of using one file to get the other.

The two files might both have identical player/time/initdata information that allows us to definitively say that the two files we have are for the same replay. That information is certainly useful but requires that we have physically obtained a copy of each file.

It is a different issue to find one file given that we have the other. Since we know how to grab replay files easily, the issue becomes grabbing the s2gs file from the replay file. If files are named according to a hash of their contents (not reproducable without the file), the only way we could find one from the other is if there were embedded links. Map files for instance, have their id embedded in the replay file for retrieval at a later point.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
JOJOsc2news
Profile Blog Joined March 2011
3000 Posts
April 22 2012 16:50 GMT
#54
Great work. I don't know enough to meaningfully contribute to the work but I can say that you are doing a great job.

Implementing the findings into programs like SC2Gears would be amazing for even more replay and multiple replay analysis.
Thanks for the good work and I hope you can figure it all out.
✉ Tweets @sc2channel ⌦ Blog: http://www.teamliquid.net/blog/JOJO ⌫ "Arbiterssss... build more arbiterssss." Click 'Profile' for awesome shiro art!
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 17:41 GMT
#55
I don't think the s2gs hash is in the replay, or computable from the replay. Think about how the SC2 client works. There must be some kind of "player profile" data that the SC2 client retrieves, which must contain a list-like data structure of the Match History. Inside the Match History there must be information for the games that are shown on the Match History. Inside the data for a match must be the s2gs filename.

I expect that only wiresharking will tell us for sure.
card-carrying grubby fan. developer of GGTracker.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 17:53 GMT
#56
On April 23 2012 02:41 dsjoerg wrote:
I don't think the s2gs hash is in the replay, or computable from the replay. Think about how the SC2 client works. There must be some kind of "player profile" data that the SC2 client retrieves, which must contain a list-like data structure of the Match History. Inside the Match History there must be information for the games that are shown on the Match History. Inside the data for a match must be the s2gs filename.

I expect that only wiresharking will tell us for sure.

I've done that and didn't find anything interesting. I haven't found any other interesting file in the Cache folder which contains anything close to a list of s2gs files
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 17:56 GMT
#57
Searching through hexdumps of the replay datafiles confirms that there isn't an explicit reference in the replay file.

Also, I agree with your analysis @dsjoerg. Wireshark can provide us with the URLs we need to simulate moving through the client application. I'd suspect that most of the files will be in the same serialized data format. Not sure how much Blizzard would appreciate our pinging of their data servers but I suppose we can find out the hard way.

@Prillan want to track down some of the other data feeds triggered by the profile GUI?
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 18:02 GMT
#58
Prillan, although the "player profile" may not be in the Cache file, it must be transmitted over the wire to the SC2 client... otherwise it wouldn't know s2gs filename to request.
card-carrying grubby fan. developer of GGTracker.
Torpedo.Vegas
Profile Blog Joined January 2011
United States1890 Posts
April 22 2012 18:14 GMT
#59
I can see this ending up in the formations of Liquid's Eleven. A grand heist to get Blizzards data.
whatthefat
Profile Blog Joined August 2010
United States918 Posts
April 22 2012 18:20 GMT
#60
Amazing find!
SlayerS_BoxeR: "I always feel sorry towards Greg (Grack?) T_T"
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-22 18:40:59
April 22 2012 18:39 GMT
#61
On April 23 2012 03:02 dsjoerg wrote:
Prillan, although the "player profile" may not be in the Cache file, it must be transmitted over the wire to the SC2 client... otherwise it wouldn't know s2gs filename to request.

I know. The problem is that almost all communication is encrypted. Only file downloads are not and from that I can't find anything useful, unfortunately.

As for GUI -> File download triggers. Nothing interesting.
+ Show Spoiler +

.s2ml - Map localization
.s2mi - Map info
.s2mv - Map image
.s2mh - Map ???
.unlk - JSON - ???
.s2ma - Map file
.ldpl - JSON - ???
.pfty - A lot of utf-8 encoded swear words (language filter?)
.s2ql - XML - Some kind of localization file
.s2qh - JSON - ???
.wafl - (waffles??) - Image file
.ldpt - JSON - Something about textures
.s2gs - Score screen stats
.auth - ???
.achv - JSON - Achivements
.xml - Depends on the file
.txt - [Breaking News/PTR Available]
.dll - Scan.dll (No idea what it does)

and with that I mean "No interesting file downloads when I look around"

I found one interesting .xml file: Division Names
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Mixopteryx
Profile Joined February 2012
Norway4 Posts
Last Edited: 2012-04-22 18:56:36
April 22 2012 18:55 GMT
#62
When I open a players match history a bunch of files are created in my cache folder. Most of them have the extension "s2ml", and there is also some with extensions "s2mh" and "sc2mi". This type of files are also created when I click "show more entries" at the bottom of the Match history. They could maybe contain information about which s2gs files that are needed.

I do not understand the methods for decoding the files, so I collected the files in the linked zip-file and hope it can be useful to someone else.

The files created by clicking at "show more entries" and some related s2gs files(created when I clicked on matches that appeared after showing more entries):
http://folk.ntnu.no/toringb/moreentries.zip

EDIT: Great work guys! Im excited to see if this will be figured out!
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
Last Edited: 2012-04-22 18:59:06
April 22 2012 18:56 GMT
#63
What specifically is transmitted when you click "Match History"?

EDIT: you are awesome @Mixopteryx.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 19:16 GMT
#64
On April 23 2012 03:56 ShadesofGraylin wrote:
What specifically is transmitted when you click "Match History"?

EDIT: you are awesome @Mixopteryx.

C Array dump and packet summary from wireshark: data.c, packets.txt
peer_0_X = To Battle.Net #X
peer_1_Y = From Battle.Net #Y
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Mixopteryx
Profile Joined February 2012
Norway4 Posts
April 22 2012 19:29 GMT
#65
I think I have something better! When I sort the match history by type(1v1 etc) only one file changes! It has the file extension "s2mi".

I have gathered the files changed in all sorting versions and some related s2gs files. The files in the folder 1v1 is collected when sorting 1v1.
http://folk.ntnu.no/toringb/Sorting.zip

My method is this:
Go to profile.
Wait a minute so the clock changes.
Click match history
Search /Users/Shared/Blizzard for files with . in the filename and are changed within the last minute. (Playing on mac)
Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 19:42 GMT
#66
On April 23 2012 04:29 Mixopteryx wrote:
I think I have something better! When I sort the match history by type(1v1 etc) only one file changes! It has the file extension "s2mi".

I have gathered the files changed in all sorting versions and some related s2gs files. The files in the folder 1v1 is collected when sorting 1v1.
http://folk.ntnu.no/toringb/Sorting.zip

My method is this:
Go to profile.
Wait a minute so the clock changes.
Click match history
Search /Users/Shared/Blizzard for files with . in the filename and are changed within the last minute. (Playing on mac)

I still believe that .s2mi is StarCraft 2 Map Information.
This is what I could extract from your
1v1\cee7efb71099820c79571bdef6261f69d982630e6f92e79844e5fa58733f67b3.s2mi

{ 0: { 0: { 0: 66893, 1: 65538},
1: 's2mh\x00\x00EU\xa0\xbd\x1dT\x10\\\xca\nL\xb8\x91\xc8U\x06h\xc6\xeaL\xa3E_\x82\xed}\xc7\x9e\x04Ji\x1a\xbe\xeb',
2: 1316575949L,
3: 0,
4: 0,
5: 0,
6: 2724134,
7: "Tal'darim Altar LE",
8: { 0: 3405691582L, 1: 15189410102982475776L},
9: 0,
10: 0,
11: { 0: 2, 1: '\x00\x00S2', 2: 1, 3: 'blizzmaps#1'},
12: 0,
13: 'enUS',
14: { 0: 2, 1: '\x00\x00S2', 2: 1, 3: 165251},
15: 0,
16: 0,
17: ['BLIZ']},
1: 0}
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 20:14 GMT
#67
Just as an update. The s2mi (s2 match information) files point to a s2mh (s2 match history) file with the struct[1] value.

The s2mh is a rather large file you can request with the normal http://<gateway>.depot.battle.net:1119/<hash>.s2mh.

I can't currently parse this file, there some subtle bug with the parser I'm having trouble with.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
dsjoerg
Profile Joined January 2012
United States384 Posts
April 22 2012 20:23 GMT
#68
I'm buying an extra box of tissues just to be ready.
card-carrying grubby fan. developer of GGTracker.
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 22 2012 20:28 GMT
#69
On April 23 2012 05:23 dsjoerg wrote:
I'm buying an extra box of tissues just to be ready.


What are we getting ready for exactly David?
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
Last Edited: 2012-04-22 20:29:35
April 22 2012 20:28 GMT
#70
Here's what an s2mh file looks like for me:

+ Show Spoiler +


[{0: {0: {0: 22686, 1: 65537},
1: 'Random_Unit_Wars_1-3.SC2Map',
2: 's2ma\x00\x00EU\xbbk\x89n7L.I\xc1 (\xa4\xa2\xdfsV\xbd\x1cic<0\x1cw\xbdmC
\xae\x8e\xd1\x1d\xf6',
3: 34875,
4: {0: {0: 0, 1: 0, 2: 1},
1: {0: 0, 1: 0, 2: 2},
2: 0,
3: {0: 0, 1: 0, 2: 0, 3: 512, 4: 468},
4: 5,
5: 22,
6: [{0: {0: 999, 1: 500},
1: [{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0}]},
{0: {0: 999, 1: 3007},
1: [{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0}]},
{0: {0: 999, 1: 3001},
1: [{0: 1, 1: 1},
{0: 1, 1: 1},
{0: 1, 1: 1},
{0: 1, 1: 1},
{0: 1, 1: 1},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0}]},
{0: {0: 999, 1: 3002},
1: [{0: 0, 1: 0},
{0: 1, 1: 0},
{0: 2, 1: 0},
{0: 3, 1: 0},
{0: 4, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0}]}],
7: ['s2mv\x00\x00EU\xd8\x165\x82\x98N\xd0\xd48\x84Y\xfcv\xde\xad\xe6W\x
cb\xe9\xe6\x05\xfe`a\x15\x7fS\xcd457\x96'],
8: [{0: 'enGB',
1: ['s2ml\x00\x00EUd\xd1#<\xff\xd9\x02\x0c\xef\xda\x833\xc8\x89\x9
eFq|\x9a\x96HA\xd1\xc6\xd7\xee2\xf8MQ\xb8N']}]},
5: [],
6: [{0: 7, 1: 0}, {0: 21, 1: 0}, {0: 19, 1: 0}],
7: [],
8: [{0: 'enGB',
1: ['s2ml\x00\x00EUd\xd1#<\xff\xd9\x02\x0c\xef\xda\x833\xc8\x89\x9eFq|
\x9a\x96HA\xd1\xc6\xd7\xee2\xf8MQ\xb8N']}],
9: {0: 153, 1: 168},
10: {0: 0, 1: 0, 2: 3},
11: 0,
12: 0,
13: [{0: {0: 1, 1: 1},
1: {0: 0, 1: 0, 2: 6},
2: {0: 0, 1: 0, 2: 8},
3: {0: 0, 1: 0, 2: 7},
4: {0: 0, 1: 0, 2: 9},
5: {0: {0: 0, 1: 0, 2: 4}, 1: {0: 0, 1: 0, 2: 5}, 2: 0},
6: [{0: {0: 999, 1: 3010}, 1: {0: 1, 1: 0}},
{0: {0: 999, 1: 3000}, 1: {0: 4, 1: 0}},
{0: {0: 999, 1: 1001}, 1: {0: 0, 1: 0}},
{0: {0: 999, 1: 2000}, 1: {0: 4, 1: 0}},
{0: {0: 999, 1: 3007},
1: [{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0}]},
{0: {0: 999, 1: 2018},
1: [{0: 0, 1: 0},
{0: 5, 1: 0},
{0: 10, 1: 0},
{0: 1, 1: 0},
{0: 6, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0}]},
{0: {0: 999, 1: 500},
1: [{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 1, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0}]}],
7: [{0: {0: 999, 1: 1001}, 1: ' \x00\x00'},
{0: {0: 999, 1: 2000}, 1: ' \x00\x00'}],
8: 3}]},
1: {0: 0}}]



I'm sure it's not 100% correct though (and some bits may be missing). I just added this in utils.py to get the output (not sure it's even reading the right amount of chars or doing anything like the correct thing).


elif datatype == 0x01:
#0x01 is an unknown data type...
return self.read_chars(3)


Still. You can see that it points to the s2ml, s2mv and s2ma files.
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
April 22 2012 22:08 GMT
#71
Here's a list of all the files created for various actions. I'm not sure it really tells us anything we don't already know.


Click on profile:

\bd\36\bd36dbb24cd0b3bb889865d62a53176a678f54a7acfb766d71052db383f94a6a.s2mi
\6e\e1\6ee188f2fd7cc5d30ffdd1c554c7a6b3ac4790462aaa0306e1c6a3f0a2132c7c.s2mi
\ab\9a\ab9afe2eee122b5ef7dfa730a55620fc7a69829854b92013b2a1a86abc55e901.s2mi
\a1\d4\a1d497696b8fca14134b6e84b14c42416d0dd2418ddfc9bb9e4c7e204f328991.s2mi
\b1\e9\b1e940a6841e8e780a0c081638175e08a1407f5201e1df4272b285dea7c773be.s2mi
\00\75\00750f9cda5ed2966ad2aaf927bc57845833ad53b36a64c125b8ae09ae6bcdbf.s2mi
\15\02\1502d6d0f7f49856a8e165e6d81a8e4111e7d960507e6c9cd49b4f78eacd9ee8.s2mi
\2e\47\2e4713d3e512d4ea059c8b871b8dfe6f91a3faedef4f52acd465b66a95dff4af.s2mi
\c0\22\c022fd2c2174a31f153132366d540cf0e81c715f048992bf3b93fa2e925930ce.s2mi

\1f\96\1f96e46830b69f767787b5201332f57a3fa4f6c52c3168d8f2added232c5501d.s2qh
\12\ec\12ecf9bd03a897bac2dd4bd7eb41ee243c17ce67b32e4611781b60ce37557481.s2qh

\b2\c9\b2c9caa9c3eeefa3c0f203cf10ce2e1fa8e32bea682bfb59ad1e7dbd252548d2.s2ql
\ee\44\ee44ec744ebb90c638494b78b331c233eaea5d2d133d3c9672e2e05a81cecec3.s2ql
\df\08\df081da0b52f88f92ac10cecb48c74b274f830e51bcb6f04cedb374060cf35b2.s2ql
\8a\bc\8abc2724c7e245031b83f3615ae1bdf9f9796c56bda49b2a327c1fe420826b75.s2ql
\3c\b6\3cb6ead29e58b7905fb0ad34a4a2cbe7ed357d8b08d20e9809c7517d4b16aee3.s2ql
\76\b5\76b5865163516632d2f7d9a7729265a1023fbdef3afb031e8957b4c84183da4d.s2ql


Click on match history:

\1f\cc\1fcc6dd0f9d05eec6b184e73bcd647075f6dfe2cf6a1b07fc3ded23f927f55d2.s2mh
\7f\8b\7f8b94b1910dd7024d7c8024dbe2aef523edb6d613846480f770eef3f473b2b3.s2ml


Mouse over a magnifying glass, or click on a match:

\56\87\5687ebfa6845a9fffa3aba01843e55210ad6ce3725859d3356404c888cc63ca2.s2gs


Corresponding s2gs request:

GET /5687ebfa6845a9fffa3aba01843e55210ad6ce3725859d3356404c888cc63ca2.s2gs HTTP/1.1
User-Agent: Battle.net Web Client
Host: EU.depot.battle.net:1119
Accept: */*



Used this code to monitor the Cache folder (adapted from here: http://msdn.microsoft.com/en-us/library/System.IO.FileSystemWatcher.aspx ). You also need to set the working directory to the Cache folder in the project properties.

+ Show Spoiler +


using System;
using System.IO;
using System.Security.Permissions;

namespace watcher
{
public class Watcher
{

public static void Main()
{
Run();
}

[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
public static void Run()
{
// Create a new FileSystemWatcher and set its properties.
FileSystemWatcher watcher = new FileSystemWatcher
{
Path = ".",
NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName,
Filter = "*.*",
IncludeSubdirectories = true,
};

watcher.Changed += new FileSystemEventHandler(OnChanged);
watcher.Created += new FileSystemEventHandler(OnChanged);
watcher.Deleted += new FileSystemEventHandler(OnChanged);
watcher.Renamed += new RenamedEventHandler(OnRenamed);

watcher.EnableRaisingEvents = true;

Console.WriteLine("Press \'q\' to quit the sample.");
while (Console.Read() != 'q') ;
}

private static void OnChanged(object source, FileSystemEventArgs e)
{
// Specify what is done when a file is changed, created, or deleted.
Console.WriteLine("File: " + e.ChangeType + " " + e.FullPath);
}

private static void OnRenamed(object source, RenamedEventArgs e)
{
// Specify what is done when a file is renamed.
Console.WriteLine("File: {0} renamed to {1}", e.OldFullPath, e.FullPath);
}
}
}

Prillan
Profile Joined August 2011
Sweden350 Posts
April 22 2012 22:17 GMT
#72
Yeah, that's what I did.

I guess we should work on parsing the .s2gs file completely now ^^
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
NagAfightinG
Profile Joined March 2011
United Kingdom270 Posts
April 22 2012 22:44 GMT
#73
I have no idea what you guys are talking about, but you should keep doing it :D
We live like animals thinking of the afterlive
Linwelin
Profile Joined March 2011
Ireland7554 Posts
April 22 2012 22:51 GMT
#74
I really don't know what you're doing there, but it's awesome
Fuck Razor and Death Prophet
DeCoup
Profile Joined September 2006
Australia1933 Posts
April 23 2012 01:29 GMT
#75
You guys are amazing. I am only a laymen but im having a great time tracking your progress here. I have a good feeling that what you achieve here will become very useful on future data mining too.
"Poor guy. I really did not deserve that win. So this is what it's like to play Protoss..." - IdrA
windsupernova
Profile Joined October 2010
Mexico5280 Posts
April 23 2012 02:41 GMT
#76
As long as you don't use it to cheat or pirate the game Blizzard doesn't care too much about this kind of stuff.
"Its easy, just trust your CPU".-Boxer on being good at games
dsjoerg
Profile Joined January 2012
United States384 Posts
April 23 2012 10:32 GMT
#77
Prillan mentioned that "The problem is that almost all communication is encrypted." One thing that is probably not encrypted are the communications between the SC2 client and its Scaleform/Flash GFX UI. If anyone knows how to get in there, that seems like natural point from which to get a commanding view of the terrain.

I've seen the flash code inside one of the MPQs. gfx files IIRC.
card-carrying grubby fan. developer of GGTracker.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 23 2012 11:07 GMT
#78
On April 23 2012 19:32 dsjoerg wrote:
Prillan mentioned that "The problem is that almost all communication is encrypted." One thing that is probably not encrypted are the communications between the SC2 client and its Scaleform/Flash GFX UI. If anyone knows how to get in there, that seems like natural point from which to get a commanding view of the terrain.

I've seen the flash code inside one of the MPQs. gfx files IIRC.

I looked into it. The .gfx files is only templates that the client fills. We probably need the client code :/
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
SirPsychoMantis
Profile Joined December 2011
United States180 Posts
Last Edited: 2012-04-23 14:06:02
April 23 2012 14:01 GMT
#79
Can anyone upload some of the .s2gs files with the corrisponding basic info (like workers built and average unspent resources)? I'm at work with no access to sc2.

EDIT: Or just the file name / info, since it looks like we can request it from b.net servers
Zerg #1
Prillan
Profile Joined August 2011
Sweden350 Posts
April 23 2012 14:31 GMT
#80
On April 23 2012 23:01 SirPsychoMantis wrote:
Can anyone upload some of the .s2gs files with the corrisponding basic info (like workers built and average unspent resources)? I'm at work with no access to sc2.

EDIT: Or just the file name / info, since it looks like we can request it from b.net servers

I did. Look at the page 2.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Fyrn
Profile Joined April 2011
Germany62 Posts
Last Edited: 2012-04-23 15:04:31
April 23 2012 14:59 GMT
#81
I'm kinda reluctant to dive into this at all - the hash retrieval, not the s2gs reversing, that is.

I've checked through the traffic preceeding the s2gs GET and it appears to be typical battle.net 2.0 protocol chatter, most of which has been reversed elsewhere. It's probably possible to get into this somehow, of course, but Blizzard isn't friendly to people attempting to reverse their protocols or implementing anything that makes use of it, as we should all know.

And since every other file in the cache, including the index, look clean it's pretty safe to assume that it's somewhere in the payload after the auth - and again, I'd rather not dive into that, especially in public.

I've also taken a look through all the web frontend stuff on battle.net, since they're at least displaying the match history there, but to no avail.

imho, the best bet would be to grab Morhaime on an upcoming Blizzard event and shake him until his team prioritizes a SC2 API. They just recently confirmed a D3 API (http://us.battle.net/wow/en/forum/topic/4217171883#10) and shortly before that confessed that while they'd like to do a SC2 API, it's not happening currently.

They seem to be slacking on these fronts ..I remember when I was racing Thott, reading from WoW memory after the savedvariables got cut in one of the beta pushes. Took them more than 5+ years, scraping terrabytes off the armory, until they had an API going. And all that while they have the massively popular WoW UI community going, necessarily realizing that third party stuff is 100% win-win. Gah. The lengths through which we have to go to obtain these bits of data is excruciating sometimes.
"I mean I could always win MLG Providence next year.." - The Little One
SirPsychoMantis
Profile Joined December 2011
United States180 Posts
April 23 2012 15:37 GMT
#82
On April 23 2012 23:31 Prillan wrote:
Show nested quote +
On April 23 2012 23:01 SirPsychoMantis wrote:
Can anyone upload some of the .s2gs files with the corrisponding basic info (like workers built and average unspent resources)? I'm at work with no access to sc2.

EDIT: Or just the file name / info, since it looks like we can request it from b.net servers

I did. Look at the page 2.


Not sure how I completely missed that, thanks. I'll do some poking.
Zerg #1
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-23 16:28:45
April 23 2012 16:24 GMT
#83
On April 22 2012 21:29 RobiTL wrote:
+ Show Spoiler +

On both replays, the AI did :
00:03 drone 7/10
00:22 drone 8/10
00:44 drone 8/10

On the first i did :
00:05 drone 7/10
00:19 drone 8/10
00:30 drone 9/10
00:49 over 9/10
00:57 drone 10/10

On the second i did :
00:02 drone 7/10
00:18 drone 8/10
00:28 drone 9/10
00:39 drone 10/10
00:56 over 10/10

I think the data of the build orders (only changes i could find in all structures) is in the 5th structure after the graphs !

Data of the first replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0x1000A, 2: 0x4900},
{ 0: 8, 1: 0x2000A, 2: 0x12F00},
{ 0: 9, 1: 0x4000A, 2: 0x1DE00},
{ 0: 10, 1: 0x7000A, 2: 0x38C00}],
[{ 0: 7, 1: 0xA, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 9, 1: 0x6000A, 2: 0x31600}],
[{ 0: 8, 1: 0x5000A, 2: 0x2C400}],


Data of the second replay :

{ 0: { 0: 999, 1: 0x1000084},
1: [ [ { 0: 7, 1: 0xA, 2: 0x1C00},
{ 0: 8, 1: 0x2000A, 2: 0x11C00},
{ 0: 9, 1: 0x4000A, 2: 0x1C400},
{ 0: 10, 1: 0x5000A, 2: 0x27600}],
[{ 0: 7, 1: 0x1000A, 2: 0x3200},
{ 0: 8, 1: 0x3000A, 2: 0x16700}],
...
{ 0: { 0: 999, 1: 0x1000086},
1: [ [{ 0: 10, 1: 0x7000A, 2: 0x37800}],
[{ 0: 8, 1: 0x6000A, 2: 0x2C400}],


Edit : I put values of 1: and 2: in Hexadecimal, its easier to get values like this

I think 0x84 is for drones, 0x86 for overlords
the 0: is the supply (7,8,9,10)
the 1: not sure... the ending A might be the total supply (10)
the 2: I think is the time where
0x1C = 00:02
0x32 = 00:03
0x49 = 00:05
0x11C = 00:18
0x12F = 00:19
0x167 = 00:22
0x1C4 = 00:28
0x1DE = 00:30
0x276 = 00:39
0x2C4 = 00:44
0x316 = 00:49
0x378 = 00:56
0x38C = 00:57

anyone to get the general formula ?

Edit : Found ! i's in 16th of seconds !
0x1DE = 478 and 478/16 = 29.875 so 00:30




How's it going? I've been trying to parse it but it seems to be incomplete.. Some units are missing.

Also, any idea what the 2nd structure contains?
Lots of entries like this:
{  0: '',
1: { 0: 999, 1: 33554453},
2: { 0: { 0: 0, 1: 1, 2: 140},
1: 0,
2: { 0: 2, 1: 390, 2: 910, 3: 64, 4: 64}},
3: [{ 0: { 0: 999, 1: 67108869}, 1: 0}],
4: 4,
5: 0}
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 24 2012 02:18 GMT
#84
After carefully recording the times of various actions I took in the SC2 client, and comparing to the timestamps of files in my Cache, I don't think any of the files in the Cache contain a usable reference to an s2gs file.

Try it yourself! If any of you are trying this on OS X I'd be happy to share the command I used for retrieving the cache files in timestamp order.

In particular what you should try is pulling up a friend's profile, then their Match History, then hover your mouse over the magnifying glass, and then click on the match. What I found, and let me know if you find differently, if you do it carefully and make a note of the times of your actions, is that the s2gs is retrieved when you hover your mouse over the magnifying glass. Prior to that, nothing else you've done with the friend causes any files to be retrieved into the cache.

To me, this strongly implies that the s2gs filename must be being sent over the wire, but not stored in any cache file.
card-carrying grubby fan. developer of GGTracker.
Fyrn
Profile Joined April 2011
Germany62 Posts
April 24 2012 04:44 GMT
#85
On April 24 2012 11:18 dsjoerg wrote:
To me, this strongly implies that the s2gs filename must be being sent over the wire, but not stored in any cache file.


Not only that, but the HTTP requests to *.depot.battle.net are also part of the general Battle.net 2.0 protocol. Authentication and Warden utilize that CDN in all current Blizzard games. The only thing obviously referenced are the map information files that are in the index. As I said above, dangerous territory to get into. Let's find a blizzard rep, a blunt object and get an official API from him
"I mean I could always win MLG Providence next year.." - The Little One
RobiTL
Profile Joined July 2010
France55 Posts
April 25 2012 08:17 GMT
#86
I just tought about this : imagine if you could at the start of a ladder game get all your opponent previous build orders of his match history against your race with s2gs files, you could metagame your opponent lol. (oh your last 5 games against my race you did fast expand, then i will fast expand too).
Born to be Zerg
Gibybo
Profile Joined May 2007
United States229 Posts
Last Edited: 2012-04-27 10:45:09
April 27 2012 10:42 GMT
#87
I made a hacky prototype demonstrating how to get the hash files and automating a little of the SC2 client. It's a windows C#.NET app that takes a character name and code as input, and outputs the .s2gs file locations for their last 50 games.

Demo:


Source: https://github.com/gibybo/S2GS-Extractor

Obviously I don't expect people to actually use the tool by itself, but you can take the code from it and perhaps expose a web service interface to it or integrate it with other tools etc.

The client automation is a very brittle proof of concept - it requires that SC2 be run in windowed mode and positioned in the top left of your screen. If the client lags more than it expects, it'll get confused since it doesn't bother trying to figure out what state the client is in before moving to the next step. Adding that functionality wouldn't be hard, you could just take samples of critical regions of the screen and compare average color values, for example.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 10:46 GMT
#88
Nice. But how does it trigger the download? By just looking at the match history?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 11:11 GMT
#89
On April 27 2012 19:46 Prillan wrote:
Nice. But how does it trigger the download? By just looking at the match history?


Yes. Just to clarify though, the download in this case is a ~5 kilobyte payload that just has references to the .s2gs files on their CDN. To download the actual s2gs files, you'd still have to make the http requests (which is fast and trivial so I didn't include it).
treekiller
Profile Joined July 2010
United States236 Posts
April 27 2012 11:20 GMT
#90
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.
All good things must come to an end. Therefore, SC2 will last forever
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 11:54 GMT
#91
On April 27 2012 20:11 Gibybo wrote:
Show nested quote +
On April 27 2012 19:46 Prillan wrote:
Nice. But how does it trigger the download? By just looking at the match history?


Yes. Just to clarify though, the download in this case is a ~5 kilobyte payload that just has references to the .s2gs files on their CDN. To download the actual s2gs files, you'd still have to make the http requests (which is fast and trivial so I didn't include it).

Ok, looked at the source. How did you know where in the memory to look? ^^

On April 27 2012 20:20 treekiller wrote:
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.

No, actually you can't.
Stats not possible to get from replays (might be a incomplete list):
* Resource Collection Rate
* Average Unspent Resources
* Workers Created (you can get pretty close with the replay)
* Army Value over time (graph)
* Income over time (graph)
* Units Killed
* Structures Razed
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 12:05 GMT
#92
On April 27 2012 20:54 Prillan wrote:

Ok, looked at the source. How did you know where in the memory to look? ^^


Well I had a basic understanding of how the client caches the interface data in memory from when I was pulling ladder data from it for starcraftrankings.com - the rest was just taking hex dumps/diffing them/guessing and checking a little. This data was particularly easy since they always have an 8 byte prefix and all you have to do is take the 32 bytes immediately following it.
slmw
Profile Blog Joined October 2010
Finland233 Posts
April 27 2012 13:21 GMT
#93
On April 27 2012 20:20 treekiller wrote:
I read all of this and still dont understand what is so great about it. What could you possibly get from this that you caouldnt get from a replay? You can get you spending from a replay.

Nope. A replay file contains only the match information (players, maps, etc.) and user input actions. It does not contain any processed information about the game itself.

Spending, resource collection rate and the other info in score screen all require SC2 game engine to be calculated accurately. The replay data contains a lot of noise and simulating even the simplest things, such as build order from replay is pretty much impossible to do without running SC2.
Prillan
Profile Joined August 2011
Sweden350 Posts
April 27 2012 13:22 GMT
#94
On April 27 2012 21:05 Gibybo wrote:
Show nested quote +
On April 27 2012 20:54 Prillan wrote:

Ok, looked at the source. How did you know where in the memory to look? ^^


Well I had a basic understanding of how the client caches the interface data in memory from when I was pulling ladder data from it for starcraftrankings.com - the rest was just taking hex dumps/diffing them/guessing and checking a little. This data was particularly easy since they always have an 8 byte prefix and all you have to do is take the 32 bytes immediately following it.


I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 27 2012 13:25 GMT
#95
Gibybo, that prototype is red-hot. Nice work!
card-carrying grubby fan. developer of GGTracker.
Gibybo
Profile Joined May 2007
United States229 Posts
April 27 2012 18:38 GMT
#96
On April 27 2012 22:22 Prillan wrote:
I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)


Thanks for the pull request, merged! Meh, the code is already separate enough to just do the memory reading if you want (just comment out the call to SC2Macros.openMatchHistory()). You should add the support for sending the http requests if you want
it

On April 27 2012 22:25 dsjoerg wrote:
Gibybo, that prototype is red-hot. Nice work!


Thanks
zachMEISTER
Profile Joined December 2010
United States625 Posts
April 27 2012 19:09 GMT
#97
This is revolutionary! I can't wait until you guys have hammered out a basic interface capable of pulling substantial stats!
psillypsybic!
Cuce
Profile Joined March 2011
Turkey1127 Posts
April 27 2012 20:48 GMT
#98
http://classic.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Northrend&PlayerName=MarkLovesYou

this is rank 1 in northrend ladder wc3 player. I dont know him just picked the rank 1. the thing is I wish sc2 had this much statistics per player.

build orders, duration per map, duration per map agains races, xp per sec per map, avarage lvl of heroes per map and list goes on
64K RAM SYSTEM 38911 BASIC BYTES FREE
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-28 12:33:53
April 28 2012 11:52 GMT
#99
On April 28 2012 03:38 Gibybo wrote:
Show nested quote +
On April 27 2012 22:22 Prillan wrote:
I made some additions to your code ^^. I think you should have a option of skipping the macro process to allow the user to navigate by himself to the match history screen and also automate the downloading process as well.
(I could do it but Avengers will take up my time today ^^)


Thanks for the pull request, merged! Meh, the code is already separate enough to just do the memory reading if you want (just comment out the call to SC2Macros.openMatchHistory()). You should add the support for sending the http requests if you want
it

Show nested quote +
On April 27 2012 22:25 dsjoerg wrote:
Gibybo, that prototype is red-hot. Nice work!


Thanks

More edits!

It's useful now

@dsjoerg I saw that you pushed stuff to sc2reader. Want some help? I can parse some data I you want.

EDIT:
@Graylin Could you add me to https://github.com/GraylinKim/sc2reader ?
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 28 2012 12:45 GMT
#100
@Prillan I'd love some help! Anyone else who wants to help is welcome, sc2reader is an open project.

I'm particularly excited to get player identities, game start or end time, and an identifier for the map.

But really anything people want to add would be great.
card-carrying grubby fan. developer of GGTracker.
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 28 2012 14:10 GMT
#101
@Prillan, please stop by the #sc2reader channel on FreeNode and say hi when you get the chance.

For now you are best off working on a fork and sending pull requests.

After a couple good pulls and a quick chat I can give you the keys for the repo. Just a policy I try to keep, no hard feelings.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 28 2012 14:21 GMT
#102
On April 28 2012 23:10 ShadesofGraylin wrote:
@Prillan, please stop by the #sc2reader channel on FreeNode and say hi when you get the chance.

For now you are best off working on a fork and sending pull requests.

After a couple good pulls and a quick chat I can give you the keys for the repo. Just a policy I try to keep, no hard feelings.

Sure, I'm not used to Git so I don't know what the standard way is ^^
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 29 2012 16:48 GMT
#103
Just wanted to put a note in here for TLers. Prillan has been making pretty rapid progress on pulling information out of the file, interested parties can follow his/our progress on github. We'll try to keep any significant breakthroughs posted here as well.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2012-04-29 20:30:06
April 29 2012 20:07 GMT
#104
On April 30 2012 01:48 ShadesofGraylin wrote:
Just wanted to put a note in here for TLers. Prillan has been making pretty rapid progress on pulling information out of the file, interested parties can follow his/our progress on github. We'll try to keep any significant breakthroughs posted here as well.


Indeed I have. But now I need help with parsing the build orders. RobiTL was working on this and I haven't been able to recreate his progress.

EDIT: Btw, come by #sc2reader on FreeNode and help us, ask questions or just say hi ^^
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
Last Edited: 2012-04-30 00:58:01
April 30 2012 00:51 GMT
#105
Not sure how useful it is in the grand scheme of things, or if this has been worked out already but:

Looking at the first block of data, it seems lobby data is in [5] and [6]. [5] contains all the possible settings (and the defaults in section 8 of that?), and [6] indexes the actual values.

+ Show Spoiler +


So in block 5:

{0: {0: 999, 1: 3004},
1: [{0: 'VyEy', 1: {0: {0: 0, 1: 1, 2: 16}, 1: 0, 2: 0}},
{0: 'Easy', 1: {0: {0: 0, 1: 1, 2: 17}, 1: 0, 2: 0}},
{0: 'Medi', 1: {0: {0: 0, 1: 1, 2: 18}, 1: 0, 2: 0}},
{0: 'Hard', 1: {0: {0: 0, 1: 1, 2: 19}, 1: 0, 2: 0}},
{0: 'VyHd', 1: {0: {0: 0, 1: 1, 2: 20}, 1: 0, 2: 0}},
{0: 'Insa', 1: {0: {0: 0, 1: 1, 2: 21}, 1: 0, 2: 0}}],
2: {0: {0: 0, 1: 1, 2: 15}, 1: 0, 2: 0},
3: [{0: {0: 20, 1: {0: 999, 1: 1000}}, 1: ['Dflt']},
{0: {0: 21, 1: {0: 999, 1: 500}}, 1: ['Comp']},
{0: {0: 21, 1: {0: 999, 1: 3007}}, 1: ['Part']}],
4: 0,
5: 3,
6: 1,
7: 0,
8: [{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0}],
9: 5},


And block 6:

{0: {0: 999, 1: 3004},
1: [{0: 2, 1: 0},
{0: 3, 1: 0},
{0: 4, 1: 0},
{0: 5, 1: 0},
{0: 0, 1: 0},
{0: 0, 1: 0},
{0: 1, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0},
{0: 2, 1: 0}]},

So in this case, in block 6[1]: 0: x makes that player the AI difficulty of index x (whether or not the player is actually an AI, I think).

Or with game speed, section 5:

{0: {0: 999, 1: 3000},
1: [{0: 'Slor', 1: {0: {0: 0, 1: 0, 2: 6}, 1: 0, 2: 0}},
{0: 'Slow', 1: {0: {0: 0, 1: 0, 2: 7}, 1: 0, 2: 0}},
{0: 'Norm', 1: {0: {0: 0, 1: 0, 2: 8}, 1: 0, 2: 0}},
{0: 'Fast', 1: {0: {0: 0, 1: 0, 2: 9}, 1: 0, 2: 0}},
{0: 'Fasr', 1: {0: {0: 0, 1: 0, 2: 10}, 1: 0, 2: 0}}],
2: {0: {0: 0, 1: 0, 2: 5}, 1: 0, 2: 0},
3: [{0: {0: 20, 1: {0: 999, 1: 1000}}, 1: ['Dflt']}],
4: 0,
5: 3,
6: 2,
7: 0,
8: {0: 4, 1: 0},
9: 3},


And section 6:

{0: {0: 999, 1: 3000}, 1: {0: 4, 1: 0}},

So index 4 indicates the game speed is "faster".

Not completely certain about all of this yet, so I'll look at it some more tomorrow.

InfCereal
Profile Joined December 2011
Canada1759 Posts
April 30 2012 11:10 GMT
#106
I noticed that "build order" was one of the things you guys were trying to find with this. This site seems to be able to extract build orders out of the replay file itself: http://starcrafttools.net/
Cereal
Prillan
Profile Joined August 2011
Sweden350 Posts
April 30 2012 11:30 GMT
#107
@netherh
That is really interesting! Nice find!

@InfCereal
We know it's in the s2gs file. We just need to extract it. Compared to the replay it's a lot more accurate
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
ShadesofGraylin
Profile Joined April 2012
United States32 Posts
April 30 2012 13:24 GMT
#108
On April 30 2012 20:10 InfCereal wrote:
I noticed that "build order" was one of the things you guys were trying to find with this. This site seems to be able to extract build orders out of the replay file itself: http://starcrafttools.net/


It does seem to be able to clean up the commands nicely, has anyone checked the accuracy when dealing with queueing and click spam? If it is accurate, I'll have to speculate that they either do some crazy hope for the best resource simulation to validate the queue and eliminate spam or some speculative rate limiting on the production structures.

If the authors are around or someone knows I'd be very interested in their approach.
Maintainer: sc2reader, http://github.com/GraylinKim/sc2reader
Prillan
Profile Joined August 2011
Sweden350 Posts
April 30 2012 15:17 GMT
#109
The parsing is almost completed now. Everything on the score screen is now accounted for.

Here's an example build order output:
+ Show Spoiler +
== Protoss - /1/1725938 ==
00:03 Probe 7/10
00:20 Probe 8/10
00:37 Probe 9/10
00:53 Pylon 9/10
01:01 Probe 10/10
01:18 Probe 11/18
01:30 Probe 12/18
01:46 Gateway 12/18
01:52 Probe 13/18
02:06 Probe 14/18
02:17 Probe 15/18
02:24 Assimilator 15/18
02:33 Probe 16/18
02:43 Pylon 16/18
02:49 Probe 17/18
03:00 Probe 18/18
03:10 CyberneticsCore 18/26
03:14 Probe 19/26
03:20 Zealot 21/26
03:25 Probe 22/26
03:38 Probe 23/26
03:54 Gateway 23/26
03:55 Probe 24/26
04:01 Warp Gate 24/26
04:22 Gateway 24/26
04:22 Probe 25/26
04:29 Pylon 25/26
04:33 Assimilator 25/26
04:39 Probe 26/26
04:54 Stalker 28/34
04:56 Probe 29/34
05:00 Stalker 31/34
05:16 Pylon 31/34
05:18 Probe 32/34
05:27 Stalker 34/34
05:41 Stalker 36/42
05:42 Stalker 38/42
06:41 Pylon 38/42
06:47 Pylon 38/42
06:51 Stalker 40/42
06:51 Stalker 42/42
06:53 RoboticsFacility 42/42
07:07 Stalker 44/50
07:25 Stalker 46/58
07:25 Stalker 48/58
08:23 Stalker 46/58
08:24 Stalker 48/58
08:25 Stalker 50/58
09:21 Stalker 38/58
09:22 Stalker 40/58
09:22 Stalker 42/58
09:24 Immortal 46/58
09:54 Nexus 44/58
09:58 Zealot 46/58
09:59 Zealot 48/58
09:59 Zealot 50/58
10:01 Pylon 50/58
10:17 TwilightCouncil 50/58
10:23 Immortal 54/58
11:29 Probe 50/58
11:34 Stalker 52/68
11:38 Pylon 52/68
11:46 Probe 53/68
11:53 Probe 54/68
== Terran - /1/1727406 ==
00:03 SCV 7/11
00:20 SCV 8/11
00:37 SCV 9/11
00:54 SCV 10/11
01:03 SupplyDepot 10/11
01:11 SCV 11/11
01:33 SCV 12/19
01:44 Barracks 12/19
01:50 SCV 13/19
02:03 Refinery 13/19
02:07 SCV 14/19
02:24 SCV 15/19
02:50 OrbitalCommand 15/19
02:52 SupplyDepot 15/19
02:52 Marine 16/19
03:06 Refinery 16/19
03:27 SCV 17/27
03:37 Factory 17/27
03:44 SCV 19/27
03:46 Techlab 18/27
04:01 SCV 19/27
04:15 Marine 20/27
04:21 SCV 21/27
04:38 SCV 22/27
04:42 SupplyDepot 22/27
04:55 Siege tech 22/27
04:58 Reactor 22/27
05:04 Sieged 25/27
05:04 SCV 26/27
05:13 SupplyDepot 26/35
05:24 SCV 27/35
05:46 SCV 28/43
05:48 SupplyDepot 28/43
05:49 Marine 29/43
05:49 Marine 30/43
05:50 Sieged 33/43
06:14 Marine 34/43
06:14 Marine 35/43
06:35 Sieged 38/51
06:39 Marine 39/51
06:39 Marine 40/51
06:42 SupplyDepot 40/51
06:46 SCV 41/51
07:04 Marine 42/51
07:04 Marine 43/51
07:13 SCV 44/59
07:17 SupplyDepot 44/59
07:20 Sieged 47/59
07:29 Marine 48/59
07:29 Marine 49/59
07:55 Marine 50/67
07:55 Marine 51/67
08:05 Sieged 54/67
08:20 Marine 40/67
08:20 Marine 41/67
08:47 Marine 35/67
08:47 Marine 36/67
08:50 Sieged 39/67
09:05 SCV 37/67
09:12 Marine 36/67
09:12 Marine 36/67
09:26 SCV 37/67
09:27 CommandCenter 37/67
09:35 Sieged 40/67
== Zerg - /1/838056 ==
00:02 Drone 7/10
00:19 Drone 8/10
00:30 Drone 9/10
00:49 Overlord 9/10
00:58 Drone 10/10
01:15 Drone 11/18
01:17 Drone 12/18
01:27 Drone 13/18
01:37 Drone 14/18
02:11 Hatchery 13/18
02:18 Drone 14/18
02:21 Drone 15/18
02:31 Drone 16/18
02:51 SpawningPool 15/18
02:54 Drone 16/18
03:04 Overlord 16/18
03:08 Drone 17/18
03:27 Drone 18/18
03:39 Drone 19/26
03:54 Overlord 19/28
03:54 Drone 20/28
03:56 Queen 22/28
03:59 Queen 24/28
04:09 Extractor 23/28
04:18 Drone 24/28
04:18 Drone 25/28
04:21 Zergling 26/36
04:21 Zergling 26/36
04:38 Drone 27/36
04:39 Drone 28/36
04:39 Drone 29/36
04:59 Drone 30/36
05:00 Overlord 30/36
05:13 Extractor 29/36
05:15 Zergling 30/36
05:15 Zergling 30/36
05:28 BanelingNest 29/44
05:30 Zergling 30/44
05:30 Zergling 30/44
05:30 Zergling 31/44
05:30 Zergling 31/44
05:42 CreepTumor 31/44
05:50 EvolutionChamber 30/44
05:54 Drone 31/44
05:54 Drone 32/44
05:54 Drone 33/44
05:56 Drone 34/44
05:56 Drone 35/44
05:56 Drone 36/44
05:57 Overlord 36/44
06:15 Zergling 37/44
06:15 Zergling 37/44
06:15 Zergling 38/44
06:15 Zergling 38/44
06:16 Zergling 39/44
06:16 Zergling 39/44
06:16 Zergling 40/44
06:16 Zergling 40/44
06:24 CreepTumor 40/52
06:44 Zergling 41/52
06:44 Zergling 41/52
06:45 Zergling 42/52
06:45 Zergling 42/52
06:45 Zergling 43/52
== Protoss - /1/2158213 ==
00:02 Probe 7/10
00:19 Probe 8/10
00:36 Probe 9/10
00:49 Pylon 9/10
00:58 Probe 10/10
01:15 Probe 11/18
01:26 Probe 12/18
01:39 Probe 13/18
01:52 Gateway 13/18
01:56 Probe 14/18
02:06 Assimilator 14/18
02:12 Probe 15/18
02:28 Probe 16/18
02:35 Pylon 16/18
02:45 Probe 17/18
02:58 CyberneticsCore 17/18
03:02 Probe 18/26
03:20 Probe 19/26
03:26 Gateway 19/26
03:37 Probe 20/26
03:49 Stalker 21/26
03:50 Warp Gate 21/26
03:58 Assimilator 21/26
04:01 Probe 22/26
04:18 Probe 23/26
04:27 Pylon 23/26
04:31 Stalker 25/26
04:54 Stalker 27/34
04:56 Probe 28/34
05:10 Pylon 28/34
05:13 TwilightCouncil 28/34
05:21 Stalker 30/34
05:22 Probe 31/34
05:39 Probe 32/42
05:44 Gateway 32/42
06:16 Probe 31/42
06:19 Blink 31/42
06:29 Stalker 33/42
06:29 Stalker 35/42
06:33 Probe 36/42
06:50 Probe 37/42
07:01 Pylon 37/42
07:04 Stalker 39/42
07:05 Stalker 41/42
07:37 Stalker 43/50
07:37 Stalker 45/50
07:49 Gateway 45/50
08:12 Stalker 43/50
08:13 Stalker 45/50
08:13 Stalker 47/50
08:42 Stalker 39/50
08:42 Stalker 41/50
08:46 Stalker 43/50
09:15 Stalker 39/50
09:16 Stalker 41/50
09:29 Probe 42/50
09:35 Stalker 44/50
09:46 Probe 45/50
09:57 Nexus 45/50
10:05 Stalker 47/50
10:05 Stalker 49/50
10:20 Probe 50/50
10:29 Pylon 50/50
10:54 Probe 51/58
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
April 30 2012 16:54 GMT
#110
Holy moly nice work Prillan! What is not complete?

Big congratulations to you, very impressive. :D :D
card-carrying grubby fan. developer of GGTracker.
zachMEISTER
Profile Joined December 2010
United States625 Posts
April 30 2012 17:02 GMT
#111
Jesus. You guys are so awesome. I have a feeling, there will be TL stars handed out once this project is complete!
psillypsybic!
Prillan
Profile Joined August 2011
Sweden350 Posts
April 30 2012 17:51 GMT
#112
On May 01 2012 01:54 dsjoerg wrote:
Holy moly nice work Prillan! What is not complete?

Big congratulations to you, very impressive. :D :D

Thanks!

Well, it's all in my experiment script. I'll have to write it into the sc2reader lib (shouldn't take too long).

Also, there seems to be more information in the file than the score screen shows but I have no idea what it means ^^ (and I'm not sure if it's relevant)
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Prillan
Profile Joined August 2011
Sweden350 Posts
May 01 2012 16:42 GMT
#113
I'm done! Now it's up to someone else to make use of all my hard work

Here's an example of what you can parse with this:
+ Show Spoiler +
----------------------------------------

Wed Apr 18 21:17:12 2012 - 00:11:45 ZP
Lobby info
Lobby type Amm
unknown3 yes
unknown1 Dflt
Melee yes
Melee mode 1v1
Game speed Fasr
unknown2 10
Lobby player info
= Slot 1 =
1v1 Team T1
Slot type Humn
Race Zerg
Color tc01
Handicap 100
Player mode Part
= Slot 2 =
1v1 Team T2
Slot type Humn
Race Prot
Color tc02
Handicap 100
Player mode Part
= Slot 3 =
Slot type Clsd
= Slot 4 =
Slot type Clsd
= Slot 5 =
Slot type Clsd
= Slot 6 =
Slot type Clsd
= Slot 7 =
Slot type Clsd
= Slot 8 =
Slot type Clsd
= Slot 9 =
Slot type Clsd
= Slot 10 =
Slot type Clsd
= Slot 11 =
Slot type Clsd
= Slot 12 =
Slot type Clsd
= Slot 13 =
Slot type Clsd
= Slot 14 =
Slot type Clsd
= Slot 15 =
Slot type Clsd
= Slot 16 =
Slot type Clsd

= Players =
= Player 1 =
Winner Yes!
Race Zerg
Bnetid 2012869

Structures Razed Count 0
Workers Created 45
Units Trained 90
Average Unspent Resources 587
Resource Collection Rate 1130
Structures 2950
Resources 16950
Units 28550
Overview 49150
Structures Built 28
Killed Unit Count 49

Peak army value 6875
Peak income 2780

-Time Army Income-
00:00:00 0 300
00:00:32 0 380
00:01:05 0 400
00:01:37 0 520
00:02:11 0 580
00:02:43 0 600
00:03:15 0 620
00:03:47 0 680
00:04:23 0 740
00:04:55 200 820
00:05:27 350 900
00:05:59 500 1056
00:06:31 650 1192
00:07:03 650 1488
00:07:35 975 1612
00:08:07 950 1712
00:08:23 950 1892
00:09:03 950 2132
00:09:35 775 2456
00:10:07 775 2616
00:10:39 1275 2612
00:11:11 1375 2740
00:11:43 1375 2780
00:12:15 3575 2720
00:12:47 4875 2744
00:13:19 5775 2696
00:13:51 5975 2688
00:14:23 5600 2716
00:14:55 6250 2692
00:15:27 5875 2668
00:15:59 6875 2648
00:16:28 6675 2548
-Time Order Supply-
00:04 Drone 7/10
00:18 Drone 8/10
00:31 Drone 9/10
00:48 Overlord 9/10
01:01 Drone 10/10
01:14 Drone 11/18
01:14 Drone 12/18
01:20 Drone 13/18
01:34 Drone 14/18
01:57 SpawningPool 13/18
02:02 Drone 14/18
02:09 Drone 15/18
02:43 Drone 16/18
02:56 Hatchery 15/18
03:00 Drone 16/18
03:00 Drone 17/18
03:24 Overlord 17/18
03:36 Drone 18/18
03:51 Hatchery 17/26
03:56 Drone 18/26
03:57 Drone 19/26
04:11 Drone 20/26
04:17 Queen 22/26
04:31 Drone 23/26
04:40 Drone 24/28
04:41 Zergling 25/28
04:41 Zergling 25/28
04:50 Queen 27/28
05:02 Drone 28/28
05:13 Overlord 28/28
05:26 Extractor 27/28
05:30 Drone 28/28
05:31 Queen 30/30
05:38 Queen 32/38
05:38 Drone 33/38
05:38 Drone 34/38
05:38 Drone 35/38
05:50 Drone 36/38
05:50 Drone 37/38
05:50 Drone 38/38
06:09 Overlord 38/38
06:10 Overlord 38/38
06:30 CreepTumor 38/38
06:36 Drone 39/54
06:36 Drone 40/54
06:36 Drone 41/54
06:38 Drone 42/54
06:38 Drone 43/54
06:38 Drone 44/54
06:38 Drone 45/54
06:38 Drone 46/54
06:38 Drone 47/54
06:38 Drone 48/54
06:38 Drone 49/54
06:38 Drone 50/54
06:54 Drone 51/54
06:56 Overlord 51/54
06:57 Overlord 51/54
07:02 SpineCrawler 50/54
07:09 SpineCrawler 49/54
07:18 CreepTumor 49/54
07:20 Zergling 50/54
07:20 Zergling 50/54
07:21 Zergling 51/54
= Player 2 =
Winner No :(
Race Protoss
Bnetid 2158213

Structures Razed Count 0
Workers Created 45
Units Trained 90
Average Unspent Resources 587
Resource Collection Rate 1130
Structures 2950
Resources 16950
Units 28550
Overview 49150
Structures Built 28
Killed Unit Count 49

Peak army value 3025
Peak income 3032

-Time Army Income-
00:00:00 0 300
00:00:32 0 340
00:01:05 0 400
00:01:37 0 440
00:02:11 0 500
00:02:43 0 560
00:03:15 0 640
00:03:47 0 620
00:04:23 0 620
00:04:55 0 760
00:05:27 0 940
00:05:59 200 1100
00:06:31 200 1260
00:07:03 350 1360
00:07:35 350 1480
00:08:07 150 1500
00:08:23 300 1600
00:09:03 500 1660
00:09:35 500 1680
00:10:07 950 1792
00:10:39 1400 1892
00:11:11 1400 2084
00:11:43 1850 2304
00:12:15 2500 2648
00:12:47 2200 2688
00:13:19 2375 2916
00:13:51 3025 2976
00:14:23 1675 3032
00:14:55 2025 2616
00:15:27 1600 2040
00:15:59 1500 2040
00:16:28 1425 2120
-Time Order Supply-
00:04 Probe 7/10
00:21 Probe 8/10
00:38 Probe 9/10
00:56 Pylon 9/10
01:01 Probe 10/10
01:21 Probe 11/18
01:32 Probe 12/18
01:45 Probe 13/18
02:02 Probe 14/18
02:22 Probe 15/18
02:40 Nexus 15/18
02:59 Forge 15/18
03:08 Probe 16/18
03:22 Probe 17/18
03:41 Gateway 17/18
03:52 PhotonCannon 17/18
03:57 Pylon 17/18
03:58 Probe 18/18
04:10 Pylon 18/18
04:23 Probe 19/36
04:24 Probe 20/36
04:32 Assimilator 20/36
04:36 Assimilator 20/44
04:40 Probe 21/44
04:52 CyberneticsCore 21/44
04:55 Probe 22/44
05:13 Probe 23/44
05:13 Probe 24/44
05:23 Zealot 26/44
05:25 Probe 27/44
05:27 Probe 28/44
05:37 Probe 29/44
05:39 Probe 30/44
05:43 Warp Gate Research 30/44
05:51 Zealot 32/44
05:54 Probe 33/44
05:54 Probe 34/44
06:11 Probe 34/44
06:11 Protoss Ground Weapons Level 1 34/44
06:11 Probe 35/44
06:28 Probe 36/44
06:28 Probe 37/44
06:34 Pylon 37/44
06:38 Sentry 39/44
06:41 Probe 40/44
06:42 Probe 41/44
06:54 Probe 42/44
06:54 Probe 43/44
07:15 Probe 44/52
07:15 Probe 45/52
07:17 Pylon 45/52
07:26 Gateway 45/52
07:29 Gateway 45/52
07:32 Gateway 45/44
07:42 Probe 46/52
07:42 Probe 47/52
07:45 Pylon 47/52
07:47 Assimilator 47/52
07:52 Pylon 47/52
07:59 Probe 44/52
07:59 Probe 45/52
08:23 Sentry 47/68
08:25 Nexus 47/68
08:27 Probe 48/68

----------------------------------------


I'm kinda proud so I hope you guys like this as much as I do ^^

Everything is on github here: https://github.com/GraylinKim/sc2reader/tree/s2gs
ShadesofGraylin will review it before merging it to master but it's possible to work with it right now. So go and write something awesome with this!

If you need to get all s2gs files in the match history, use this: https://github.com/gibybo/S2GS-Extractor

If you have questions, just ask and I'll answer :D
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
dsjoerg
Profile Joined January 2012
United States384 Posts
May 01 2012 16:57 GMT
#114
Someone pinch me, I think I'm dreaming!

I know someone is working on an automatic s2gs retriever. Once that is ready, I plan to incorporate Prillan's outstanding work in to ggtracker.
card-carrying grubby fan. developer of GGTracker.
Mixopteryx
Profile Joined February 2012
Norway4 Posts
May 01 2012 18:24 GMT
#115
Amazing work Prillan!
Peleus
Profile Joined March 2010
Australia420 Posts
May 12 2012 06:43 GMT
#116
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.
Dakota_Fanning *
Profile Joined January 2008
Hungary2349 Posts
May 12 2012 07:02 GMT
#117
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...
https://repmastered.icza.net
Peleus
Profile Joined March 2010
Australia420 Posts
May 12 2012 07:13 GMT
#118
On May 12 2012 16:02 Dakota_Fanning wrote:
Show nested quote +
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.
Dakota_Fanning *
Profile Joined January 2008
Hungary2349 Posts
May 12 2012 07:55 GMT
#119
On May 12 2012 16:13 Peleus wrote:
Show nested quote +
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).
https://repmastered.icza.net
Peleus
Profile Joined March 2010
Australia420 Posts
May 12 2012 11:26 GMT
#120
On May 12 2012 16:55 Dakota_Fanning wrote:
Show nested quote +
On May 12 2012 16:13 Peleus wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).


Ahh ok, I understand a lot better now - thank you for taking the time to explain it to me.

The only thing I can think of now is perhaps wiresharking the connection and trying to identify the traffic sent to blizzard to request match history and simulating that after each game. I seem to remember someone perhaps trying that earlier but I don't know how it ended up.
Dakota_Fanning *
Profile Joined January 2008
Hungary2349 Posts
May 12 2012 11:34 GMT
#121
On May 12 2012 20:26 Peleus wrote:
Show nested quote +
On May 12 2012 16:55 Dakota_Fanning wrote:
On May 12 2012 16:13 Peleus wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).


Ahh ok, I understand a lot better now - thank you for taking the time to explain it to me.

The only thing I can think of now is perhaps wiresharking the connection and trying to identify the traffic sent to blizzard to request match history and simulating that after each game. I seem to remember someone perhaps trying that earlier but I don't know how it ended up.

Yes, there is a program for that, but that violates the terms of use, so I will not implement something like that in Sc2gears.
https://repmastered.icza.net
Prillan
Profile Joined August 2011
Sweden350 Posts
May 12 2012 13:32 GMT
#122
On May 12 2012 20:26 Peleus wrote:
Show nested quote +
On May 12 2012 16:55 Dakota_Fanning wrote:
On May 12 2012 16:13 Peleus wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).


Ahh ok, I understand a lot better now - thank you for taking the time to explain it to me.

The only thing I can think of now is perhaps wiresharking the connection and trying to identify the traffic sent to blizzard to request match history and simulating that after each game. I seem to remember someone perhaps trying that earlier but I don't know how it ended up.


I did that but couldn't find anything. It looks like it's encrypted
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
SirPsychoMantis
Profile Joined December 2011
United States180 Posts
May 14 2012 17:38 GMT
#123
On May 12 2012 16:55 Dakota_Fanning wrote:
Show nested quote +
On May 12 2012 16:13 Peleus wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).


I think people would still appreciate it even if it only worked on new replays
Zerg #1
dsjoerg
Profile Joined January 2012
United States384 Posts
May 15 2012 18:01 GMT
#124
What could be built without too much trouble is a program that scans your computer's directories for s2gs files and loads them to ggtracker or into sc2gears. However this would require you to manually click around within SC2, clicking on each game in your match history in order for the relevant s2gs file to be loaded onto your computer.
card-carrying grubby fan. developer of GGTracker.
Prillan
Profile Joined August 2011
Sweden350 Posts
May 15 2012 19:43 GMT
#125
On May 16 2012 03:01 dsjoerg wrote:
What could be built without too much trouble is a program that scans your computer's directories for s2gs files and loads them to ggtracker or into sc2gears. However this would require you to manually click around within SC2, clicking on each game in your match history in order for the relevant s2gs file to be loaded onto your computer.

Actually, hovering over the magnifying glass is enough.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Xapti
Profile Joined April 2010
Canada2473 Posts
May 15 2012 20:35 GMT
#126
On May 12 2012 16:02 Dakota_Fanning wrote:
I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...

Usually the score screen is loaded after a game really quickly, so it'd be kinda unavoidable to get the s2gs downloaded after most games though, wouldn't it? I guess it'd be problematic for team games though, since I don't think you can get the sg2s file until the team game is over (which takes longer than just the first person leaving like in 1v1s)
"Then he told me to tell you that he wouldn't piss on you if you were on fire" — "Well, you tell him that I said that I wouldn't piss on him if he was on Jeopardy!"
skeldark
Profile Joined April 2010
Germany2223 Posts
May 15 2012 20:46 GMT
#127
i checked allready but better ask you guys.
Is there any information about the changepoints or player points in the file?
Save gaming: kill esport
Dakota_Fanning *
Profile Joined January 2008
Hungary2349 Posts
May 16 2012 09:50 GMT
#128
On May 16 2012 05:35 Xapti wrote:
Show nested quote +
On May 12 2012 16:02 Dakota_Fanning wrote:
I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...

Usually the score screen is loaded after a game really quickly, so it'd be kinda unavoidable to get the s2gs downloaded after most games though, wouldn't it? I guess it'd be problematic for team games though, since I don't think you can get the sg2s file until the team game is over (which takes longer than just the first person leaving like in 1v1s)

After a game no s2gs file is saved on your computer. At the end of a game the Score screen is displayed from in-memory data. S2gs files are only saved to your computer if you browse the match history.
https://repmastered.icza.net
gronnelg
Profile Joined December 2010
Norway354 Posts
May 16 2012 12:15 GMT
#129
You guys are such baller nerds!
I'm proud to be part of this community :D
Lulzez || My stream: http://www.twitch.tv/gronnelg
Prillan
Profile Joined August 2011
Sweden350 Posts
May 16 2012 13:38 GMT
#130
On May 16 2012 05:46 skeldark wrote:
i checked allready but better ask you guys.
Is there any information about the changepoints or player points in the file?

No.

It has nothing to do with the game. The points you see right after the game is not showed if you enter the score screen from the match history.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Xapti
Profile Joined April 2010
Canada2473 Posts
Last Edited: 2012-05-17 04:09:22
May 17 2012 04:06 GMT
#131
On May 16 2012 18:50 Dakota_Fanning wrote:
Show nested quote +
On May 16 2012 05:35 Xapti wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...

Usually the score screen is loaded after a game really quickly, so it'd be kinda unavoidable to get the s2gs downloaded after most games though, wouldn't it? I guess it'd be problematic for team games though, since I don't think you can get the sg2s file until the team game is over (which takes longer than just the first person leaving like in 1v1s)

After a game no s2gs file is saved on your computer. At the end of a game the Score screen is displayed from in-memory data. S2gs files are only saved to your computer if you browse the match history.

Oh OK. It would be sending that information to the battle.net server though. I just presumed it would save the file when doing that. It only makes sense to cache the hsitory of games one's played. I suppose that's why battle.net is so damn laggy — inefficient programming.
I'm Not sure if it would be in the same format when the info is being sent, but still I assume that's probably not something you'd want to do (packet reading).

On May 16 2012 22:38 Prillan wrote:
Show nested quote +
On May 16 2012 05:46 skeldark wrote:
i checked allready but better ask you guys.
Is there any information about the changepoints or player points in the file?

No.
It has nothing to do with the game. The points you see right after the game is not showed if you enter the score screen from the match history.

True, but technically the point change is still shown in the match history screen still (even though not on the score screen), so it's not a huge difference, even though the answer's still 'no'.
"Then he told me to tell you that he wouldn't piss on you if you were on fire" — "Well, you tell him that I said that I wouldn't piss on him if he was on Jeopardy!"
skeldark
Profile Joined April 2010
Germany2223 Posts
May 17 2012 17:05 GMT
#132
On May 12 2012 20:34 Dakota_Fanning wrote:
Show nested quote +
On May 12 2012 20:26 Peleus wrote:
On May 12 2012 16:55 Dakota_Fanning wrote:
On May 12 2012 16:13 Peleus wrote:
On May 12 2012 16:02 Dakota_Fanning wrote:
On May 12 2012 15:43 Peleus wrote:
Dammit, I wish I had enough programming skills to take advantage of this. I'm begging someone to make up a SQ calculator based off information recorded in the s2gs file after each game ala sc2gears style.

Thank you so much for all your work Prillan.

I'm working on integrating this into Sc2gears, but unfortunately based on a replay file you can't get the name of the s2gs file...


First, awesome that you're working on it - thank you so much for your efforts.

Is it possible to monitor the master folder or s2gs files and order by creation date to correlate with replays? Perhaps matching some unique information within the replay that can be retrieved and cross matched to the score screen in the s2gs files allowing you to match them together correctly? (I.e. player names + map) Not sure if that would be unique enough.

Just throwing ideas out there, they may be to clunky to actually implement. Thanks regardless.

I could match those, that's not the problem. The problem is that s2gs files do not magically appear on your hard drive unless you individually check match result for all games in your match history inside Sc2 (or you use an automated program for it).


Ahh ok, I understand a lot better now - thank you for taking the time to explain it to me.

The only thing I can think of now is perhaps wiresharking the connection and trying to identify the traffic sent to blizzard to request match history and simulating that after each game. I seem to remember someone perhaps trying that earlier but I don't know how it ended up.

Yes, there is a program for that, but that violates the terms of use, so I will not implement something like that in Sc2gears.

The Terms of use is a joke.

sc2gears violates the terms of use! Read them careful, you are not allowed to collect information about the client.
With this text you break it in the second you install sc2.




Save gaming: kill esport
Ahelvin
Profile Blog Joined September 2010
France1866 Posts
August 28 2012 13:12 GMT
#133
Has this little file been figured out?

I would love to have some information about my SQ integrated into SC2Gears or one of its plugins .
Join the Liquipedia Zerg Project ! PM me for more information :).
Normal
Please log in or register to reply.
Live Events Refresh
Next event in 1d 10h
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason165
StarCraft: Brood War
firebathero 250
Aegong 32
Dota 2
monkeys_forever857
League of Legends
Grubby5621
JimRising 306
Counter-Strike
fl0m2342
Stewie2K1142
Fnx 456
Super Smash Bros
AZ_Axe125
Other Games
tarik_tv38788
summit1g16499
gofns13110
shahzam636
hungrybox560
Maynarde165
Organizations
Other Games
gamesdonequick2249
BasetradeTV39
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• Hupsaiya 89
• davetesta55
• RyuSc2 51
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Esports World Cup
1d 10h
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Esports World Cup
2 days
Esports World Cup
3 days
Esports World Cup
4 days
CranKy Ducklings
5 days
BSL20 Non-Korean Champi…
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
FEL
6 days
BSL20 Non-Korean Champi…
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

2025 ACS Season 2
RSL Revival: Season 1
Murky Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
CC Div. A S7
Underdog Cup #2
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
HCC Europe
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.