forked from louisdx/cnc-replayreaders
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
53 lines (38 loc) · 2.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
A collection of replay file readers for Command & Conquer games
===============================================================
The programs in this package are loosely copy/pasted variantes of
replay file dissectors for Command & Conquer games of the Electronic Arts
era:
ccgzhreader.cpp: "Generals" and "Zero Hour"
cnc3reader.cpp: "Tiberium Wars", "Kane's Wrath" and "Red Alert 3"
cnc4reader.cpp: "Tiberian Twilight"
The replay files for all these games follow a general pattern "header, body, footer",
where the body consists of "chunks" of data which are labelled by a timecode (measured
in units of 1/15 seconds, corresponding to two visual frames at 30fps). The differences
between the games are largely in the header and footer format.
The actual specification of the file format isn't known to me, and I
am building up my knowledge of the formats as reflected by the replay
readers in the documentation file "eareplay.html".
The main program is "cnc3reader", which has proper command-line argument handling,
use '-h' to see the available options.
"cnc4reader" only supports the syntax "cnc4reader filename [r|c]", where the optional
second argument causes raw ('r') or parsed ('c') chunk output. "ccgzhreader" supports
no arguments at all, and the only permissible syntax is "ccgzhreader filename".
The haphazard state of affairs is because the programs were written on an on-demand
basis. They could certainly be unified, and a good amount of code could be reused.
cnc3reader
----------
The reader for TW/KW/RA3 is by far the most advanced of the three. It supports
repair of truncated replays, which usually occur as a result of a program crash.
As replays seem to be written out in blocks of 4kiB, such a crashed replay is
missing a proper footer. Repairing the replay consists of truncating the replay
after the last complete chunk and appending a suitable footer.
The program also supports dumping of the audio stream of a commentated replay
(although the format of the audio data is unknown), and a rudimentary action
counter.
Compilation
-----------
The following compiler invocation should work for all programs:
g++ -o cnc3reader cnc3reader.cpp -W -Wall -Wextra -O3 -march=native -s -std=c++0x -fwhole-program
Windows users using MingW should add "-enable-auto-import -static-libgcc -static-libstdc++"
to create free-standing executables without load-time dependencies on the C and C++ libraries.