So a .demo file is basically a compressed (gzipped) stream of bytes, indicating the moves that the player made.
I've got two Java classes in my Eclipse project: VerboseDemo and FlippedInputStream. The VerboseDemo class contains the main() method.
I've tested it on many .demo files, and it works pretty well for simple demos, outputting the move sequence to the console. But the .demo file format stores some things in a way I'm not sure how to parse. For example, taking potions and placing doubles.
Here are the byte values I know:
Byte Player Input
--- ------------
1 N
2 NE
3 W
5 E
6 SW
7 S
8 SE
9 clockwise rotation
10 counterclockwise rotation
11 NW
12 (wait)
15 'Yes' option (in a dialog)
16 'No' option (in a dialog)
The value -1 seems to be used for time clones, and I've seen various values used for placing a double (17, 27, 30, 36, others?) Byte value 21 might be for drinking a potion and 23 might be Special Command.
Does anyone familiar with the DROD source care to help fill in the gaps? It would be nice if I could put together a utility for the community that properly parses all demo files into human readable form.
____________________________
34th Skywatcher
Best to PM me, since I might miss your message on CaravelNet chat.
[Last edited by disoriented at 01-06-2020 02:49 AM]