I'm currently working on a replay analysis program (replay data, APM, build info, etc)Perhaps something similar to the old BWHF
Anyways, I've run into a few snags parsing the game events.I know you guys here are parsing small amounts of replay data (which I am doing also) so I figured id ask here
If anyone has any DEFINITIVE info about the building codes, attack-move codes, patrol codes, etc for the units following the 0x0b byte I would REALLY appreciate it.I've scoured the net, but the best people have are guesses and 99% that I've checked out (its a tedious process) are wrong.
UPDATE:Fixed parsing of ALL events, still need action codes
Would you mind sharing your code ?
My effort is available here: http://code.google.com/p/starcraft2replay
It would be nice to have a standalone parsing library on top of which GUI would be created.
Sure, Ill have to port it over to c++ though, its in vb.net atm
i could just package it into a dll or module i guess when i finish it
ive got it all in functions and classes atm, so it shouldnt be too hard
problem is, yeah im parsing 99% of events, but i dont have the codes for what the command actions are, (ie. the data following the 0x0b byte)which means its all jack.what I CAN tell you atm is that the structures people have on the net are all wrong in differing areas, which is confusing if you are looking at them all
All I know on game events is this :
Start OPcode* 00 01 1B, player1 initial* 00 02 1B, player2 initial* 00 10 05, game start
Action OPcode* Accumulate Frames, 1~N bytes, Big Endian* Player, 1 byte, 0x21 or 0x61 -> player1* OpCode, 1 byte
OPCodes* 0x81, Move Camera** X, 4 bytes** Y, 4 bytes** Hor, 4 bytes** Vet, 4 bytes** Unknown, 4 bytes* 0x0B, Unit Action, like building, morph, research, upgrade, order, ability* 0x3C,* 0xAC, Select Unit* 0x0D,* 0x1D,
By the way, did you manage to get the winner of the game ? I tried hard but did not found anything :/
If you would like to port your code to C++, fo not hesitate to ask a developer account on the google code repo. It would definitely be cool to have a global parsing effort available in a single library!
regarding the command codes, just thought of this off the top of my head, couldn't you just start a game and do specific commands, eg, after selecting exactly 7 units, do this command, so that you know in the code, after you see where 7 units are selected, it MUST be that command you did in game........... just a matter of keeping track of it maybe.
Yah, corosus, i could, but the game doesnt store the AI codes the same way, and i dont have a beta key =/
so if you could get someone to make a game and just click hatch, worker, hatch, worker, make pylon, etc with some decent delay, it would be sweet
newbiz:the 0d, 1d, etc are hotkeys, the number is the actualy hotkeyalso, each action, select, etc can have a camera move event asociated with it, if the action was performed on the minimap, or the screen was scrolled.also the accumulated frames thing seems to not be correct
Yeah woud you mind sharing what you know?
Prometheus, if you want to register on the site (so I can PM), or drop me an email (firstname.lastname@example.org) I can probably help you out further.
if its ok with you i want to include some of this in my sc2allin1 tool launcer in the replay system. tnx
OK i've registered...I'm currently working on getting more OPcodes for actions and ill put the whole thing into a nice c++ dll if everyone wants
most likely a game class, which includes events, players, messagesa message class, which includes player, messageand an event class, which has player and event info codes
OMFG IM SO HAPPY RIGHT NOW.
________FINALLY_________ figured out how to get the winner!!!
also figured out how to mark their starting positions on the minimap jpg file in the replay.rejoice!
Wooow congrats!Was is stored in the game events ?I thought it was computed on the fly when a player is the last to have buildings.
how did you find the winner? could you clue the rest of us in?
this doesnt work
Contact me via PM if you need help...
OK guys ive finished a rough replay dll (written in .net) which has the classes i talked about
call initialize(filename) where filename is the replayfile and it will give back a player array with each players apmnamecolor(as windows color object)number of actionsnumber of chat messagesand type (player or observer)
also has an array called messages which is just each chat messageeach message has a .tostring which will print it out as: <TIMESTAMP> PLAYER_NAME : MESSAGE
lastly, it has a property called Winner, which is the string representation of the game's winner (e.g. "KHB" or "CowGoMoo")
i need some ppl to test it out (as it is still in extreme beta) and i cant find the function to add an attachment on the forums, so please pm me if you wanna try it
Oh, it requires MPQLib
as i pm you i am in.
just post here the requirements mpglib latest url. ;-)
I sent you a pm.
Keep posting, and maybe upload your dll to the assets/tools section if you have something semi-solid.
From what I've seen, NewbiZ is working on a C++ parser and ZetaTwo (also listed as an owner on NewbiZ's google code page) is coding a PHP extension based on libmpq.
I think we should devote our efforts to improving on what's already been done, rather than redo this work. Get a team working on this and it will be much more efficient/effective.
There's definitely a demand for a replay parser within the SC2 community:DarkBlizz: anyone working on decode(sic) the replay file formatsc2armory: SC2Replay Parsingscreplays: Starcraft 2 Replay Parser
Doubt I can help with any of the coding or interpreting MPQ files, but I will lend a hand, if I can, to any open source efforts.
also a link for a compiled ready for use libmpq would be nice.
first search result for mpqlib in google
first search result for mpqlib in google
btw what is the APM?
Actions Per Minute...
<50 Beginner50-80 Intermediate80-110 Advanced110-160 Real good player / Progamer160-200 Warcraft3 player xD>200 Retarded
LOL nice thanks for the explanation
my first test is very positive, but the mpqlib, damn its very slow.... :(
If you were logged in you would gain 3 XP for posting a reply.
Support Nibbits by linking to us:
Managed by WM Innovations
More from Nibbits: WarCraft 3 Maps | StarCraft Maps | StarCraft 2 Maps | Gamer Configs