Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:sc2inspector [2011/12/31 10:14] – [Project Log] smarkproject:sc2inspector [2013/03/06 18:06] (current) – [Project Log] smark
Line 1: Line 1:
 ====== SC2Inspector - C# ====== ====== SC2Inspector - C# ======
  
 +===== Synopsis =====
 +
 +This project was originally envisioned to be a C# version of SC2Gears. The goal was to provide an extremely detailed look at the SC2 Replay File format.
 ===== Reference ===== ===== Reference =====
  
Line 86: Line 89:
 |--- 12 (NumberInVLF) - Unknown |--- 12 (NumberInVLF) - Unknown
 `--- 13 (NumberInVLF) - Unknown</code> `--- 13 (NumberInVLF) - Unknown</code>
 +
 +==== replay.attributes.events Sample Data ====
 +
 +| <code>0x0BBF
 +    0x1 - Part
 +    0x2 - Part
 +0x01F4
 +    0x1 - Humn
 +    0x2 - Humn
 +0x0BB9
 +    0x1 - Zerg
 +    0x2 - Terr
 +0x07DC
 +    0x1 - T3
 +    0x2 - T1
 +0x07E2
 +    0x1 - T3
 +    0x2 - T4 </code> | <code>0x07D7
 +    0x1 - T1
 +    0x2 - T2
 +0x0BBB
 +    0x1 -  100
 +    0x2 -  100
 +0x07D6
 +    0x1 - T3
 +    0x2 - T4
 +0x07D2
 +    0x1 - T2
 +    0x2 - T1
 +0x0BBA
 +    0x1 - tc04
 +    0x2 - tc07</code> | <code>0x07D8
 +    0x1 - T1
 +    0x2 - T2
 +0x07D4
 +    0x1 - T1
 +    0x2 - T2
 +0x07D3
 +    0x1 - T2
 +    0x2 - T2
 +0x0BBC
 +    0x1 - Medi
 +    0x2 - Medi
 +0x07DB
 +    0x1 - T1
 +    0x2 - T2</code> | <code>0x07D5
 +    0x1 - T1
 +    0x2 - T2
 +0x03E8
 +    0x10 - Dflt
 +0x0BC0
 +    0x1 - Obs
 +    0x2 - Obs
 +0x0BC2
 +    0x10 - yes
 +0x07E1
 +    0x1 - T3
 +    0x2 - T4
 +0x07D0
 +    0x10 - t2</code> | <code>0x0BB8
 +    0x10 - Fasr
 +0x0BBE
 +    0x10 - 10
 +0x0BC1
 +    0x10 - Priv
 +0x03E9
 +    0x10 - yes
 +0x07D1
 +    0x10 - 1v1</code> 
 +    
 +    
 +    
 +    
 +    
 +    |
 +
 ===== Project Log ===== ===== Project Log =====
 +=== 1/2/2012 @ 05:26 ===
 +Ok so I've been working on this most of the day. I've finished the InitData file as well as the AttributesEvents file! It looks like I'm 100% done with the game metadata about the players. Here's all the information I have: {{:project:120102_sc2inspector_replaydetails_locals.png?linkonly|SC2Inspector ReplayDetails Locals}}
 +
 +The attributes.events file has kind of an interesting format. This one bit of code pretty much does all the work:
 +<code csharp>uint NumAttribs = BinaryReader.ReadUInt32();
 +uint AttribHeader;
 +uint AttribId;
 +int PlayerId;
 +string AttribVal;
 +int NumSlots;
 +for (int i = 0; i < NumAttribs; i++) {
 + AttribHeader = BinaryReader.ReadUInt32();
 + AttribId = BinaryReader.ReadUInt32();
 + PlayerId = BinaryReader.ReadByte();
 + AttribVal = Conversion.ReverseString(Encoding.Default.GetString(BinaryReader.ReadBytes(4))).Replace("\0", String.Empty);
 + if (!AttribDict.ContainsKey(AttribId)) {
 + AttribDict.Add(AttribId, new Dictionary<int, string>());
 + }
 + AttribDict[AttribId].Add(PlayerId, AttribVal);
 +}
 +if (NumAttribs == 0) {
 + throw new Exception("Zero attributes.");
 +}</code>
 +
 +I run that code after I read four bytes from the beginning. It splits everything out into what can be used as a multidimensional associative array. Here's some sample data: [[sc2inspector#replayattributesevents_sample_data|replay.attributes.events Sample Data]]. There's some information in there which I'm not sure about either. Either way this segment is done. I FINALLY think that tomorrow I can go ahead and start on replay.events!
 +
 +Time to update this table:
 +
 +^ Filename ^ Purpose ^
 +| replay.details | Contains sometimes inaccurate (?) data about players including their name, RealId, Race, Map name, save time, etc. |
 +| replay.initData | Contains information about who is playing (names), as well as the Realm, Map hash, and some sort of account identifier. |
 +| replay.attribute.events | Contains detailed information about the players, their race, difficulty, color, team info, game speed, etc. |
 +| replay.game.events | Actions |
 +| replay.message.events | Chat, Ping |
 +| replay.smartcam.events | Presumably player cameras |
 +| replay.sync.events | Presumably consistency checks |
 +
 +
 +Committed r7.
 +
 === 12/31/2011 @ 03:12 === === 12/31/2011 @ 03:12 ===
 Ok so I've been slacking on my documentation. I have fully parsed all of the documented fields in the replay.details file. Here is what the output looks like: {{:project:111231_sc2inspector_replaydetails_locals.png?linkonly|ReplayDetails Locals Window}} Ok so I've been slacking on my documentation. I have fully parsed all of the documented fields in the replay.details file. Here is what the output looks like: {{:project:111231_sc2inspector_replaydetails_locals.png?linkonly|ReplayDetails Locals Window}}
Line 117: Line 236:
 | replay.smartcam.events | Presumably player cameras | | replay.smartcam.events | Presumably player cameras |
 | replay.sync.events | Presumably consistency checks | | replay.sync.events | Presumably consistency checks |
- 
- 
  
 === 12/30/2011 @ 00:39 === === 12/30/2011 @ 00:39 ===
Line 230: Line 347:
   * SC2Replay-CSharp - https://github.com/ascendedguard/sc2replay-csharp   * SC2Replay-CSharp - https://github.com/ascendedguard/sc2replay-csharp
   * Parsing SC2 Replays - http://www.teamliquid.net/forum/viewmessage.php?topic_id=121694   * Parsing SC2 Replays - http://www.teamliquid.net/forum/viewmessage.php?topic_id=121694
 +  * SC2Reader - https://github.com/GraylinKim/sc2reader/wiki
project/sc2inspector.1325326440.txt.gz · Last modified: 2011/12/31 10:14 by smark
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0