Open boombatower opened 10 years ago
wuups, got lost in all my watching notifications :'
Rec game bodies consist of a series of commands. This has all the gameplay stuff in it so you could parse it out if you know what all the commands mean. Biegleux put a few parsers in there (the building creation, unit creation, and research ones), but I don't know about the others.
A lot of stuff isn't recorded though. For example, when a building is destroyed or a player is defeated, the game figures that out at playback time so it doesn't store that in the recorded game files. This stuff depends on the entire rest of the engine, pretty much, so you can't figure that out without recreating the entire thing and simulating the game yourself. This is a problem for RecAnalyst in some cases, as there is no way to detect when a player is defeated, and no way to detect researches that have been stopped because a building was destroyed.
As for spectator mode, that's a UserPatch feature (not a Voobly specific thing at all); UserPatch ships with a age2_x1/spectate.exe
for spectating games. I'm don't know how to programmatically launch the spectator mode, though.
Thanks for the reply! I'll have to take a look at the building created stuff and what not. I won't need to handle player defeated or tech stuff, but I understand your point. Perhaps getting something basic working is possible.
@boombatower You may want to check out this repository: https://github.com/stefan-kolb/aoc-mgx-format I already collected quite a lot of actions that are recorded inside the body of the mgx file. It's by far not complete but could be a good point to start from.
Nice, thanks!
Just in case anyone looks at this in the future, I must respectfully disagree with @mtzander . It is possible to reconstruct a lot of information about buildings and units using solid inferences and without resorting to guesswork, as you can see from this.
@bowswung They seem to have additional data from their client. From the specifications available there's no way to detect a death without having the engine simulation.
@danielsuter Hello, we have already solved that with bowswung. We made a tool called MAGAGA reader that logs simulation into flatbuffers which can be used in any language. You can ask him for getting this tool.
Aside of detecting deaths, we also hooked damage dealing function. And we also speed the game simulation up to less than 5 minutes.
@IamFlea Hi, thank you for your answer. Do you run the actual Replay using age of Empires? Or do you have do use a mod when playing AOE2 which logs additional information?
note that the file that bowswung linked in https://github.com/goto-bus-stop/recanalyst/issues/1#issuecomment-438666583 is inferred only from the recorded game. the tool Flea mentioned runs the actual replay using age of empires at high speed, with some code injected to log additional information.
@goto-bus-stop What confuses me that the log referred to in that comment is called simHistory. So that would mean deaths and everything can be inferred from the actual replay/recorded game in Aoe2De without actually replaying the game? The documentations I found only identified actions commands, so you would require the actual engine with the correct page to get data such as deaths or produced units.
The recorded game file only records actions, but bowswung found ways to use that limited data to infer lots of things about the game. It's not 100% accurate, because it can't be. Most of the conversation about that is here: https://github.com/goto-bus-stop/recanalyst/issues/17 The code that does it is in the linked repo. The entry point is https://github.com/bowswung/voobly-scraper/blob/d49d7a20d8555c03aa7f5d771c7b0eb8d9f1e4da/src/Data/Mgz/Simulate.hs.
It's true that you need to actually run the engine for accurate data, which AFAIK is currently only possible in AoC with UserPatch using the MAGAGA tool.
I scanned through documentation and some code, but I don't see anything to read the actual game play information instead of just stats and initial points.
A couple of questions if you feel like answering, otherwise I just need to do more research.
Basically, I am looking to read the actual state changes of the game (preferably during gameplay, but postprocessing would be a good first step) to supplement the UI.
Since you seem to have experience digging into some of this stuff just looking for some thoughts if you have time. Thanks.