Explore GameReplays...

Kanes Wrath

Replay info tool

Reply to this topic Start new topic
# 1R Schneider Nov 25 2010, 19:25 PM
I thought I'd share a little tool I've been making over time. It's a replay info tool for the command line. Basic use is like this:
CODE
replayreader myreplay.KWReplay

You can type "replayreader -h" for help and usage information.

Basically, the tool will dump all kinds of data that it finds in the replay. The output isn't terribly well organised and contains lots of useless raw data, but maybe you'll see something in there you're interested in.

Here is a random list of "features":
  • Understands TW, KW and RA3 replays.
  • Player names, factions, observers, commentators, ...
  • One timestamp in GMT and another with the user's local time.
  • Which player saved the replay.
  • Whether or not there's an audio channel; can optionally dump the raw audio data (but no idea what to do with it).
  • Player IDs may be useful to see if two players are the same.
  • Game version magic number appears to be able to tell mods apart.
  • Name of the mod for TW and RA3.
  • Figures out how long a replay is.
  • Can optionally dump all actual payload data of a replay ("-c" for TW/KW, "-R" for RA3).
  • Can repair (some) crashed replays from RA3 and KW (probably also from TW)
At some point I thought there might be a way to count APM from the replay, but I think that's unlikely: By dumping the data chunks in a replay (using "-c") you can see that even if you click madly on the map all over the place and open queue tabs, no data is saved in the replay, so the replay cannot possibly account for all user "actions".

Let me know if you have any ideas or things you want me to implement. (Don't ask for a graphical interface, though!)

Attached File replayreaders.zip
Size: 668.21k
Number of downloads: 338
Player Name Side Team


I made the source code for these tools available on GitHub.

Update: The program is now called cnc3reader (which works for TW/KW/RA3 replays), I also added programs to dissect TT replays (cnc4reader) and CCG/ZH/BfME/BfME2/RotWK replays (ccgzhreader).

Update: There is now a helper batch file called "cnc3replay_dump_to_notepad.bat". Keep this in the same directory as "cnc3reader.exe". You can drop one replay file onto the batch file to have the replay info open up in Notepad. You can place a shortcut to the batch file anywhere, e.g. on your desktop, to conveniently drop replay files onto it.

Update: There's now also a helper "cnc4replay_dump_to_notepad.bat" for C&C4 replays. Both cnc3- and cnc4-readers have been made safer to use with ill-formed replay files. cnc3reader now supports pre-1.7 TW replays (which don't have mod support).

Update: Major improvements of chunk dissection (now presumed complete), and rudimentary APM computation is now available with option "-p".

Update: Footer and type-2 chunks are now understood. Option "-p" now also outputs kill ratios if available (this only seems to be the case for RA3). Replay fixing now always appends the short, one-byte footer.

This post has been edited by R Schneider: Sep 2 2011, 12:02 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 2'MaRTIAN' Nov 25 2010, 22:10 PM
Wow, this could be very useful.

Posts: 1,424

Game: Kanes Wrath


+
# 3R Schneider Jan 3 2011, 17:03 PM
I uploaded a minor update to please the RA3 people.

It should be possible to extend the tool to write out a fixed replay from a broken replay that was corrupted during a game crash; let me know if such a feature would be of interest.

Update. I've now included a rudimentary replay fixing mode. It's used like this:
  • Step 1: Determine if the replay is broken and how it could be fixed:
    replayreader CrashedReplay.RA3Replay -R -t 0
  • Step 2: Use the offset given in the error message to create a fixed replay:
    replayreader CrashedReplay.RA3Replay -r -f 167888 -F RescuedReplay.RA3Replay
New options:
  • -f pos: enable rescue mode and specify the offset of the last known good chunk. This information can be obtained by running the reader first in raw dump mode (-R).
  • -F name: optional filename for the output file. If unspecified, a variant of the input file name will be created. Warning: The output file will be overwritten if it already exists!
When attempting a rescue, you must specify the game type (-w/-k/-r)!

Update. I added an auto-fix option: "-g". When you call something like
replayreader -g -r *.RA3Replay
it will go through all the matching replays and attempt to fix each one that is corrupted. Use with care! Keep backup copies!

This post has been edited by R Schneider: Jan 4 2011, 14:34 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 4PuppetMaster DM Jan 3 2011, 22:44 PM
Well now I don't get an error message but when I double click the .exe after unzipping it the command window (I guess it is the window that should pop up after starting the program) flashes to my screen for about 0.1 second and the immediately goes away again. No reaction after waiting a couple of minutes.. Seems it does not react correct now..

Posts: 7,163

Game: Red Alert 3


+
# 5R Schneider Jan 3 2011, 22:58 PM
QUOTE(doesn't matter @ Jan 3 2011, 23:44 PM) *
Well now I don't get an error message but when I double click the .exe after unzipping it the command window (I guess it is the window that should pop up after starting the program) flashes to my screen for about 0.1 second and the immediately goes away again. No reaction after waiting a couple of minutes.. Seems it does not react correct now..

It's a command line tool! You have to run it on the command line with arguments... Call "replayreader -h" for help. (I'm pretty sure I said this in the original post, though.)

This post has been edited by R Schneider: Jan 3 2011, 22:59 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 6(Best)(Noob) Jan 4 2011, 00:12 AM
nice, ill have to give it a shot

Posts: 1,363


+
# 7PuppetMaster DM Jan 4 2011, 08:37 AM
It does not work for me either via the command line (I guess I'm too noob for such things tongue.gif ).. When I type in "replayreader -h" (with or without quotes makes no difference) all the command line says is 'the command "replayreader" is either wrong spelled or couldn't be found' post-13661-1143531603.gif I guess I'm too inexperienced with this kind of stuff

Posts: 7,163

Game: Red Alert 3


+
# 8R Schneider Jan 4 2011, 13:10 PM
QUOTE(doesn't matter @ Jan 4 2011, 09:37 AM) *
It does not work for me either via the command line (I guess I'm too noob for such things :P ).. When I type in "replayreader -h" (with or without quotes makes no difference) all the command line says is 'the command "replayreader" is either wrong spelled or couldn't be found' :/ I guess I'm too inexperienced with this kind of stuff

OK, simple example:
  • Extract "replayreader.exe" to C:\Temp\.
  • Open a command line (e.g. [Win]+R, "cmd", [Enter]).
  • Type "C:", [Enter], "cd \Temp", [Enter].
  • Type "replayreader -h", [Enter].
Does this work?

PS 1: Ultimately you might want to put the tool in the same folder as your replays for ease of use.

PS 2: If you feel dirty, you can put the tool in the Windows folder, which should be in the search path, so you can call it from anywhere. Don't tell anyone I said that.

This post has been edited by R Schneider: Jan 4 2011, 13:32 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 9auroranegra Jan 4 2011, 13:21 PM
who advantage have this program ??? is best that: "command and conquer replays tools" or "RepInfo" ????

Posts: 1,550

Game: Kanes Wrath


+
# 10R Schneider Jan 4 2011, 13:38 PM
QUOTE(auroranegra @ Jan 4 2011, 14:21 PM) *
who advantage have this program ??? is best that: "command and conquer replays tools" or "RepInfo" ????

Advantage? What do you mean?

I already listed the features in the first post. The program will basically just dump some info from the replay file, such as time and date, player names, factions, map name, game rules, game version, match duration, and some other technical stuff. In its latest version it can also 'repair' replays from a crashed game by appending a correct file footer, which is what gets corrupted during a crash.

I guess it has similar features as RepInfo (though on the command line), but it doesn't do any background monitoring stuff (I believe the Replay Tools you mention are able to rename and move away your replays while you are playing). For me, the importance is that this runs on the command line, so I can use it to parse one hundred replays all at once and extract info on how often which faction comes up etc. None of the graphical tools are suitable for processing a large number of files all at once...

On a more geeky level, the tool also allows you to dump the actual main content of replay files. I don't understand the format yet, but I do understand some of the basic structure, and one could experiment to discover more about it. Ultimately, it might be possible to make a complete replay parser that can tell you exactly what's going on in the game just by looking at the replay file, without running the game.

This post has been edited by R Schneider: Jan 4 2011, 13:46 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 11auroranegra Jan 4 2011, 13:51 PM
i need one program that figure the APM with in the page:
http://www.united-forum.de/replay-center-f...op-200-a-96783/

this page have one program that is perfect. u see apm, economy, obs and players. look

Posts: 1,550

Game: Kanes Wrath


+
# 12R Schneider Jan 4 2011, 14:12 PM
QUOTE(auroranegra @ Jan 4 2011, 14:51 PM) *
this page have one program that is perfect. u see apm, economy, obs and players. look

Where do you see the APM and the economy? All I get is the map, teams and duration; the APM field is empty. Do you have a screenshot?

In fact, I have been thinking of how to get the APM from the replay, but I concluded that it isn't possible, because lots of things that you might want to include as an "action" like selecting units, opening and switching tabs, or even random clicking, are not stored in the replay file. (Camera moves are, though.) So it appears that physical actions are not available, at best one could count logical actions (build, place, move order, attack order).

Posts: 5,734

Game: Command and Conquer 3


+
# 13auroranegra Jan 4 2011, 14:24 PM
IPB Image


wink.gif

Posts: 1,550

Game: Kanes Wrath


+
# 14PuppetMaster DM Jan 4 2011, 14:44 PM
The PS2 helped thanks! Now I can give it a try.

Posts: 7,163

Game: Red Alert 3


+
# 15R Schneider Jan 4 2011, 14:45 PM
Thanks! Strange, I've tried three browsers, but the chart doesn't show up :-( Anyway, I should get in touch with them and ask where they getting the information from!

Edit. I can't download that replay because I don't have an account -- could you possibly get the replay for me and post it here? Thanks!

Is there APM count correct? I mean, do you have any independent verification that the numbers make sense? As I said, mouse clicks etc. aren't stored in the replay file, so could it be that their actions are only counting 'logical' actions? (By the way, my tool also contains an undocumented APM counter, "-p" :-) But I don't know if it makes any sense!)

This post has been edited by R Schneider: Jan 4 2011, 14:48 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 16R Schneider Jan 4 2011, 14:46 PM
QUOTE(doesn't matter @ Jan 4 2011, 15:44 PM) *
The PS2 helped thanks! Now I can give it a try.

You dirty man. ;-)

Posts: 5,734

Game: Command and Conquer 3


+
# 17auroranegra Jan 4 2011, 16:07 PM
QUOTE(R Schneider @ Jan 4 2011, 14:45 PM) *

Thanks! Strange, I've tried three browsers, but the chart doesn't show up :-( Anyway, I should get in touch with them and ask where they getting the information from!

Edit. I can't download that replay because I don't have an account -- could you possibly get the replay for me and post it here? Thanks!

Is there APM count correct? I mean, do you have any independent verification that the numbers make sense? As I said, mouse clicks etc. aren't stored in the replay file, so could it be that their actions are only counting 'logical' actions? (By the way, my tool also contains an undocumented APM counter, "-p" :-) But I don't know if it makes any sense!)



only click in the dialoge "APM", is true u see the apm the mouse + keyboards, i need this program, u need register for see the page. only problem, is GERMAN

Posts: 1,550

Game: Kanes Wrath


+
# 18auroranegra Jan 4 2011, 16:16 PM
make program apm


sry, u need soul the program

Posts: 1,550

Game: Kanes Wrath


+
# 19R Schneider Jan 4 2011, 16:18 PM
QUOTE(auroranegra @ Jan 4 2011, 17:07 PM) *
only click in the dialoge "APM", is true u see the apm the mouse + keyboards

Oh d'oh, now I feel retarded. OK, I got it.

Mind you, it does not say "mouse and keyboard"; it says "scroll", "move", "select", etc. This is an important distinction! The replay only saves the logical events, e.g. "this unit was selected", but not the physical user actions (mouse button down, drag, mouse button release). In fact, I believe the FAQ says outright that the physical action information in not available.

So it would seem that the UF guys understand the replay format in a deep way. That's good. I wonder if this information is public!

This post has been edited by R Schneider: Jan 4 2011, 16:20 PM

Posts: 5,734

Game: Command and Conquer 3


+
# 20auroranegra Jan 4 2011, 16:21 PM
QUOTE(R Schneider @ Jan 4 2011, 16:18 PM) *


So it would seem that the UF guys understand the replay format in a deep way. That's good. I wonder if this information is public!



i dont know, only know, that this is PERFECT

Posts: 1,550

Game: Kanes Wrath


+

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)