The front-line trooper for the Red Army, the Red Guard work best when grouped, as their horde bonus increases their efficiency in groups of 5 or more. Their superweapon is considered the weakest in the game, but their upgrades and abilities increase their combat efficiency.Ĭost: $300 (per pair) | Prerequisites: none In the late game, however, they deploy powerful tanks and artillery pieces, and their air force is best used in numbers to create devastating firestorms. I've marked the trimmed lines with ".".The People’s Republic of China deploys light and relatively cheap units, the more basic of which benefit from their signature horde bonus. 733 orders - most of which are duplicate 1092 orders. I've trimmed it down, because the replay file contains 733 lines - i.e. Let's do that, and write out all the replay chunks from our sample replay file. ASCII, true ) ) Īrmed with all that code, we can finally parse our sample replay file. String magic using ( var asciiReader = new BinaryReader (stream, Encoding. The size u1 is 12 for Generals and Zero Hour, and 21 in the BfME games u2 is 8 in CCG/ZH and 13 in the BfME games u3 is 4 except in BfME2, where it is 6. Also, there is no footer, just a final chunk. Most notably, the chunks do not have length information, so one must know their sizes by other means. The replay format of the games Generals, Zero Hour, Battle for Middle Earth, Battle for Middle Earth 2, and its expansion Rise of the Witch King is considerably simpler than that of the later games. I'll duplicate the Generals part of it here: Generals, Zero Hour, Battle for Middle Earth, Rise of the Witch King This is great stuff! Many thanks to louisdx, who I believe also goes by the name R Schneider on. There's even a document with the beginnings of a spec for these replay files. Here's the C++ code for a prototype version of a Generals replay parser. Without this information, proceeding further would have been much harder. So I Googled and found the cnc-replayreaders repo on GitHub, which contains at least some work on parsing replay files for many SAGE games, including, happily, C&C Generals. It was at this point, when I first looked at Generals' replay files, that I wondered whether anybody else had figured out the file format before. That's always nice to see, when you're parsing an unknown binary format. You can immediately see some human-readable text there. If we open that replay file in VSCode using the excellent hexdump extension, we'll see this: Here's the replay file that Generals saved for that game: For the purposes of this blog post, I want to keep the replay file really simple, so all I'll do is start a single-player skirmish game, build one building, and exit. Let's load C&C Generals, and play a quick skirmish game. I should note here that replay files vary wildly between games, so what applies to one specific RTS game won't apply directly to other games, but the general principles should be similar, at least across RTS games.īefore we get into the details, let's start with the fun part: creating a replay file in the first place. but fortunately, I'm not the first to want to do this. Since no official description of Generals' replay file format has been published, I have to do it the hard way, and figure out the file format. One of the features I hope to support in OpenSAGE is being able to use replay files from the original Command & Conquer: Generals and Zero Hour games. It's often a long road from there, to fully understanding and being able to parse one of these files. For efficiency and IP-protection reasons, replay files are usually stored in a binary format, so if you open one of them in Notepad, all you'll see are a bunch of garbled characters. Have you ever saved a replay from, and wondered exactly what the replay file contains? I don't know how many people will answer "yes" to that question, but I'm one of them. TL/DR: In this post we'll examine C&C Generals replay (.rep) files in detail, figure out how they work, and then look at a very early implementation of a replay viewer that I've added to OpenSAGE. This post was originally published on Tim's blog.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |