Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
trs:savegame:tr1 [2017/02/23 16:04] – zdimension | trs:savegame:tr1 [2021/07/15 03:00] (current) – update savegame format with new discoveries stohrendorf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== TR1 ====== | ====== TR1 ====== | ||
+ | |||
+ | <note tip>When loading a save game, classic TR games read the name and number and then load everything after that directly into the game RAM, without checking anything. That's why savegames from original versions don't work in multipatched versions (and make the game crash). It also makes the " | ||
<code cpp> | <code cpp> | ||
- | struct | + | struct |
{ | { | ||
- | uint8_t | + | uint8_t |
- | | + | |
- | uint8_t | + | uint8_t |
- | // First level use block 0, second use block 1... so that at the end of the game, | + | // First level use block 0, second use block 1... so that at the end of the game, |
// it sums up everything and/or checks if you found all secrets, etc | // it sums up everything and/or checks if you found all secrets, etc | ||
struct | struct | ||
{ | { | ||
- | uint16_t | + | uint16_t |
- | uint16_t | + | uint16_t |
- | uint16_t | + | uint16_t |
- | uint16_t | + | uint16_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
/* 0 None | /* 0 None | ||
* 1 Climbing | * 1 Climbing | ||
- | * 2 ? | + | * 2 Draw weapon |
- | * 3 Single shot.? | + | * 3 Holster weapon |
- | * 4 Combat? | + | * 4 Combat |
*/ | */ | ||
- | uint8_t | + | uint8_t |
/* 0 None | /* 0 None | ||
* 1 Pistols | * 1 Pistols | ||
Line 31: | Line 33: | ||
* 4 Shotgun | * 4 Shotgun | ||
*/ | */ | ||
- | uint8_t | + | uint8_t |
/* 00000001 Level unlocked | /* 00000001 Level unlocked | ||
* 00000010 Pistols | * 00000010 Pistols | ||
Line 39: | Line 41: | ||
* 00100000 Midas Hand | * 00100000 Midas Hand | ||
*/ | */ | ||
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | } LevelInitData[21]; // for the 21 levels | + | } levelInitData[21]; // for the 21 levels |
- | uint32_t | + | uint32_t |
- | uint32_t | + | uint32_t |
- | uint16_t | + | uint16_t |
- | uint16_t | + | uint16_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
// 10240 bytes starting from now | // 10240 bytes starting from now | ||
- | uint8_t | + | uint8_t |
+ | uint8_t flipFlags[10]; // = (FlipFlag & 0xFF00)>> | ||
+ | uint16_t cameraFlagsZoneIndices[cameraCount]; | ||
+ | // items block here todo | ||
+ | #pragma pack(push, 8) | ||
+ | struct | ||
+ | { | ||
+ | int16_t itemID; | ||
+ | int16_t handStatus; | ||
+ | WeaponID currentWeapon; | ||
+ | WeaponID requestedWeapon; | ||
+ | int16_t climbFallSpeedOverride; | ||
+ | int16_t underwaterState; | ||
+ | int16_t unknown1; | ||
+ | int16_t collisionFrame; | ||
+ | int16_t collisionAxis; | ||
+ | int16_t air; // game ticks of air left | ||
+ | int16_t swimToDiveKeypressDuration; | ||
+ | int16_t deadTime; // game ticks | ||
+ | int16_t underwaterCurrentStrength; | ||
+ | int16_t spasmEffectCounter; | ||
+ | Vertex4 *spasmSource; | ||
+ | #pragma pack(push, 1) | ||
+ | struct MeshTree | ||
+ | { | ||
+ | int32_t replacedMeshesBits; | ||
+ | MESH_HEADER *meshes[15]; | ||
+ | } laraMeshTree; | ||
+ | #pragma pack(pop) | ||
+ | ITEM *enemy; | ||
+ | Vertex2YX weaponTargetVector; | ||
+ | int16_t yRotationSpeed; | ||
+ | int16_t movementAngle; | ||
+ | Vertex2YXZ headRotation; | ||
+ | Vertex2YXZ torsoRotation; | ||
+ | AimInfo aimInfoLeft; | ||
+ | AimInfo aimInfoRight; | ||
+ | Ammo pistolAmmo; | ||
+ | Ammo magnumAmmo; | ||
+ | Ammo uziAmmo; | ||
+ | Ammo shotgunAmmo; | ||
+ | struct RoutePlanner | ||
+ | { | ||
+ | BoxNode *node; | ||
+ | uint16_t head; | ||
+ | uint16_t tail; | ||
+ | uint16_t searchNumber; | ||
+ | int16_t blockMask; | ||
+ | int16_t stepHeight; | ||
+ | int16_t dropHeight; | ||
+ | int16_t flyHeight; | ||
+ | int16_t zoneCount; | ||
+ | int16_t destinationBox; | ||
+ | uint16_t searchOverride; | ||
+ | Vertex4 searchTarget; | ||
+ | } aiInfo; | ||
+ | } lara; // 236 bytes | ||
+ | #pragma pack(pop) | ||
+ | int32_t postFxFunc; // this is usually -1 (and the last occurence of that in the file) so you can align it to that (replace the items blocks above by a filler block) so that Lara is aligned to postFxFunc | ||
+ | int32_t animFxTime; | ||
}; | }; | ||
+ | |||
+ | enum WeaponID : int16_t | ||
+ | { | ||
+ | None = 0, | ||
+ | Pistols = 1, | ||
+ | Autopistols = 2, | ||
+ | Uzis = 3, | ||
+ | Shotgun = 4, | ||
+ | }; | ||
+ | |||
+ | struct Vertex2 | ||
+ | { | ||
+ | int16_t x; | ||
+ | int16_t y; | ||
+ | int16_t z; | ||
+ | }; | ||
+ | |||
+ | struct Vertex2YX | ||
+ | { | ||
+ | int16_t y; | ||
+ | int16_t x; | ||
+ | }; | ||
+ | |||
+ | struct Vertex2YXZ | ||
+ | { | ||
+ | int16_t y; | ||
+ | int16_t x; | ||
+ | int16_t z; | ||
+ | }; | ||
+ | |||
+ | struct Vertex4 | ||
+ | { | ||
+ | int32_t x; | ||
+ | int32_t y; | ||
+ | int32_t z; | ||
+ | }; | ||
+ | |||
+ | struct Ammo | ||
+ | { | ||
+ | int32_t ammo; | ||
+ | int32_t hits; | ||
+ | int32_t misses; | ||
+ | }; | ||
+ | |||
+ | #pragma pack(push, 8) | ||
+ | struct AimInfo | ||
+ | { | ||
+ | ANIM_FRAME *weaponAnimData; | ||
+ | int16_t frame; | ||
+ | int16_t aiming; | ||
+ | Vertex2YXZ aimRotation; | ||
+ | int16_t shootTimeout; | ||
+ | }; | ||
+ | #pragma pack(pop) | ||
+ | |||
</ | </ | ||
+ | <note tip>The ''< | ||
===== Identifications ===== | ===== Identifications ===== | ||
==== Levels ==== | ==== Levels ==== | ||
- | ^ ID ^ Level ^ Secrets ^ Puzzle ^^^^ Key ^^^^ | + | ^ID^Level^Filename^Camera count^Items^ |
- | ^ ::: ^ ::: ^ ::: ^ 1 ^ 2 ^ 3 ^ 4 ^ 1 ^ 2 ^ 3 ^ 4 ^ | + | | ::: | ::: | ::: | ::: | ::: | ::: ^1^2^3^4^1^2^3^4| |
- | | 0 | Lara's Home | | + | | 0| Lara's Home | |
- | | 1 | Caves | | + | | 1| Caves | |
- | | 2 | City of Vilcabamba | + | | 2| City of Vilcabamba |
- | | 3 | Lost Valley | + | | 3| Lost Valley |
- | | 4 | Tomb of Qualopec | + | | 4| Tomb of Qualopec |
- | | 5 | St. Francis' | + | | 5| St. Francis' |
- | | 6 | Colosseum | + | | 6| Colosseum |
- | | 7 | Palace Midas | 3 | Gold Bar | | | | | | | | | + | | 7| Palace Midas |
- | | 8 | The Cistern | + | | 8| The Cistern |
- | | 9 | Tomb of Tihocan | + | | 9| Tomb of Tihocan |
- | | 10 | City of Khamoon | + | | 10| City of Khamoon |
- | | 11 | Obelisk of Khamoon | + | | 11| Obelisk of Khamoon |
- | | 12 | Sanctuary of the Scion | 1 | Ankh | Scarab | + | | 12| Sanctuary of the Scion |
- | | 13 | Natla' | + | | 13| Natla' |
- | | 14 | Atlantis | + | | 14| Atlantis |
- | | 15 | The Great Pyramid | + | | 15| The Great Pyramid |
- | | 16 | Cut Scene 1 | | + | | 16| Cut Scene 1 | |
- | | 17 | Cut Scene 2 | 0 | ::: |||||||| | + | | 17| Cut Scene 2 |
- | | 18 | Cut Scene 3 | | + | | 18| Cut Scene 3 | ''< |
- | | 19 | Cut Scene 4 | | + | | 19| Cut Scene 4 | ''< |
- | | 20 | Title | | + | | 20| Title | ''< |
- | | 21 | Current Position | + | | 21| Current Position |
+ | |||
+ | <note important> | ||