Difference between revisions of "Replays (GTA SA)"
(→blocks #3, #6, #9) |
(→Block 3: Player data) |
||
Line 31: | Line 31: | ||
0x01 byte index (handle?) | 0x01 byte index (handle?) | ||
0x02 WORD modelID | 0x02 WORD modelID | ||
− | 0x04 byte | + | 0x04 byte [[ped type]] |
0x05 byte[3] (align) | 0x05 byte[3] (align) | ||
0x08 (end) | 0x08 (end) |
Revision as of 09:08, 11 January 2009
Contents
- 1 Introduction
- 2 Format Details
- 2.1 Data Blocks
- 2.1.1 Block 0: End of file
- 2.1.2 Block 1: Vehicle1
- 2.1.3 Block 2: Vehicle2
- 2.1.4 Block 3: Player data
- 2.1.5 Block 4: Ped
- 2.1.6 Block 5: Camera
- 2.1.7 Block 6: Day time
- 2.1.8 Block 7: Weather
- 2.1.9 Block 8: End of scene
- 2.1.10 Block 9: Scene timing
- 2.1.11 Block 10: Unknown
- 2.1.12 Block 11: Unknown
- 2.1.13 Block 12: Unknown
- 2.1.14 Block 13: Unknown
- 2.1.15 Block 14: Unknown
- 2.1.16 Block 15: Unknown vehicle
- 2.1.17 Block 16: Unknown vehicle
- 2.1.18 Block 17: Unknown vehicle
- 2.1.19 Block 18: Unknown
- 2.1.20 Block 19: Clothes
- 2.1 Data Blocks
- 3 Tools
Introduction
GTA SA replays are the sequence of the scenes and actions recorded and stored in the replay.rep
file. This file is located in the GTA San Andreas User Files directory.
Format Details
Each .rep file consists of a header string and variable amount of 'scenes' (or 'frames'). Scene is a copy of important game information at given moment of time (actors, vehicles positions, weather, clothes, etc). Following one after another, the scenes create an illusion of a movie when played. The most of scenes contains a same set of blocks and ends with Block 8.
The .rep file itself consist of a header string which is simply the text GtaSA29 and up to 8 parts, size of each one is 100,000 bytes, depending on the replay length. So, the maximum size of a replay file is 800,008 bytes (including 8 bytes of the header string). If the replay length is that it does not match 100,000 bytes boundary being less, the rest of the file is filled with useless data (commonly the previous replay data).
Data Blocks
Each block consists of a byte denoting its type and some data as described below. A number in a block name is the data type stored in the first byte of the block. Reading this byte, the game detects what block follows.
Block 0: End of file
This block denotes the end of replay data. It consists only of a data type. After this block the game stops reading the replay file.
OFFSET TYPE DESCRIPTION 0x00 byte data type (0x00) 0x01 (end)
Block 1: Vehicle1
size 52 bytes
Block 2: Vehicle2
size 56 bytes
Block 3: Player data
Common information about player ped.
OFFSET TYPE DESCRIPTION 0x00 byte data type (0x03) 0x01 byte index (handle?) 0x02 WORD modelID 0x04 byte ped type 0x05 byte[3] (align) 0x08 (end)
Block 4: Ped
size 52 bytes
Block 5: Camera
size 88 bytes
Block 6: Day time
This block contains information about current day time during a scene.
OFFSET TYPE DESCRIPTION 0x00 byte data type (0x06) 0x01 byte currentHour 0x02 byte currentMinute 0x03 byte (align) 0x04 end
Block 7: Weather
size 8 bytes
Block 8: End of scene
size 4 bytes
Block 9: Scene timing
This block contains value of the global game timer. The replay play length could be found by using this block.
OFFSET TYPE DESCRIPTION 0x00 byte data type (0x09) 0x01 byte[3] (align) 0x04 DWORD timer 0x08 (end)
Block 10: Unknown
size 28 bytes
Block 11: Unknown
size 20 bytes
Block 12: Unknown
size 16 bytes
Block 13: Unknown
size 4 bytes; same as Block 8?
Block 14: Unknown
size 4 bytes; same as Block 8?
Block 15: Unknown vehicle
size 56 bytes; same as Block 2?
Block 16: Unknown vehicle
size 56 bytes; same as Block 2?
Block 17: Unknown vehicle
size 60 bytes
Block 18: Unknown
size 76 bytes
Block 19: Clothes
size 120 bytes
Tools
There is a template for 010 Editor, made by Seemann. It allows to edit different replay data in hex editor. http://sannybuilder.com/dev/Replay.rar