Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
trs:savegame:tr2 [2017/02/23 01:17] zdimensiontrs:savegame:tr2 [2024/12/05 12:18] (current) – [TR2] stohrendorf
Line 2: Line 2:
  
 <code cpp> <code cpp>
-struct tr2_savegame+struct TR2Savegame
 { {
-    uint8_t SaveName[75]; // ASCII C string; null-terminated (there is always random data after \0, it is ignored); for accents see String Array section of TOMBPC.DAT page +    uint8_t saveName[75]; // ASCII C string; null-terminated (there is always random data after \0, it is ignored); for accents see String Array section of TOMBPC.DAT page 
-    int32_t SaveNumber; +    int32_t saveNumber;
-    uint8_t Unknown2[44];+
     // 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
 +    // For simplicity, this includes the tile menu as a level.
     struct     struct
     {     {
-        uint16_t Header; // Always 0x3E8 +        uint16_t ammoPistols; // Always 0x3E8 (1000) 
-        uint16_t Ammo_AutoPistols; // 65,535 means unlimited +        uint16_t ammoAutoPistols; // 65,535 means unlimited 
-        uint16_t Ammo_Uzis+        uint16_t ammoUzis
-        uint16_t Ammo_Shotgun+        uint16_t ammoShotgun
-        uint16_t Ammo_M16+        uint16_t ammoM16
-        uint16_t Ammo_Grenade+        uint16_t ammoGrenade
-        uint16_t Ammo_Harpoon+        uint16_t ammoHarpoon
-        uint8_t SmallMedipacks; // 255 means unlimited +        uint8_t smallMedipacks; // 255 means unlimited 
-        uint8_t LargeMedipacks+        uint8_t largeMedipacks
-        uint8_t Unknown+        uint8_t unknown
-        uint8_t Flares+        uint8_t flares
-        uint8_t Unknown2[1];+        uint8_t unknown2[1];
         /* 0 None         /* 0 None
          * 1 Pistols          * 1 Pistols
Line 32: Line 32:
          * 7 Harpoon gun          * 7 Harpoon gun
          */          */
-        uint8_t Weapon; // current held weapon +        uint8_t weapon; // equipped weapon 
-        /* 00000001 Always set+        /* 00000001 Level unlocked
          * 00000010 Pistols          * 00000010 Pistols
          * 00000100 Automatic pistols          * 00000100 Automatic pistols
Line 42: Line 42:
          * 10000000 Harpoon gun          * 10000000 Harpoon gun
          */          */
-        uint8_t Weapons+        uint16_t flags
-        uint8_t Unknown3[23]; +        uint8_t unknown3[2]; 
-    } Blocks[23];  +        uint32_t levelTime; // in game ticks 
-    uint32_t ElapsedTime; // in game ticks (1/30th of a second), so divide by 30 for time in seconds +        uint32_t weaponHits; 
-    uint32_t AmmoUsed+        uint32_t weaponShots; 
-    uint32_t Hits+        uint32_t travelledDistance; 
-    uint32_t DistanceTraveled; // Divide by 445.023 for value in meters +        uint16_t kills; 
-    uint32_t Kills;+        uint8_t secretBits; 
 +        uint8_t healthPacksUsed; // Divide by 2 for value. Large medipack = 1; Small = 0.5 
 +    } levelInitData[24];  
 +    uint32_t elapsedTime; // in game ticks (1/30th of a second), so divide by 30 for time in seconds 
 +    uint32_t ammoUsed
 +    uint32_t hits
 +    uint32_t distanceTraveled; // Divide by 445.023 for value in meters 
 +    uint32_t kills;
     /* 00000001 Bronze     /* 00000001 Bronze
      * 00000010 Jade      * 00000010 Jade
      * 00000100 Gold      * 00000100 Gold
      */      */
-    uint8_t Secrets+    uint8_t secrets
-    uint8_t HealthPacksUsed; // Divide by 2 for value. Large medipack = 1; Small = 0.5 +    uint8_t healthPacksUsed; // Divide by 2 for value. Large medipack = 1; Small = 0.5 
-    uint8_t LevelNumber; // First level = 1 +    uint16_t levelNumber; // First level = 1 
-    uint8_t Unknown5a; +    uint8_t unlimitedAmmo; // Enabled = 1 
-    uint8_t UnlimitedAmmo; // Enabled = 1 +    uint8_t numPickups[2]; 
-    uint8_t Unknown5b[2]; +    uint8_t puzzle[4]; // Corresponds to TOMBPC.DAT Puzzle & Keys entries 
-    uint8_t Puzzle[4]; // Corresponds to TOMBPC.DAT Puzzle & Keys entries +    uint8_t keys[4]; 
-    uint8_t Keys[4]; +    uint32_t roomsAreFlipped; 
-    // This part needs to be studied +    uint8_t flipStates[10]; 
-    uint8_t Unknown6[744]; +    uint16_t trackFlags[64]; 
-    uint16_t Health; // Divide by 10 for floating point value between 0 and 10032767 (0x7FFF) means unlimited +    uint8_t cameraFlags[]; // size depends on number of cameras in level 
-    uint8_t Unknown7[1952]; +    uint8_t itemData[]; // item-specific savegame data, needs to be studied 
-    uint16_t Air+    uint16_t laraObjectNumber; // item id of lara 
-    uint8_t ReadToEOF[];+    uint16_t laraHandStatus; 
 +    uint16_t laraWeapon1; 
 +    uint16_t laraWeapon2; 
 +    uint16_t laraWeapon3; 
 +    uint16_t laraFallspeedOverride; 
 +    uint16_t laraWaterState; 
 +    uint8_t unknown7[4]; 
 +    uint16_t laraStumbleFrame; 
 +    uint16_t laraStumbleDir; 
 +    uint16_t laraAirTime; // in game ticks 
 +    uint8_t unknown8[4]; 
 +    uint16_t laraUnderwaterSpeed; 
 +    uint16_t stumbleTimeout; 
 +    uint16_t flareTimer; 
 +    uint16_t currentVehicleId; 
 +    uint16_t currentWeaponItemId; 
 +    uint16_t weaponObjectNumberLeftHand; 
 +    uint16_t weaponFrame; 
 +    uint16_t weaponFlags; 
 +    uint32_t distanceToWaterSurface; 
 +    Vector3_32 travelDistancePrevPos; // position of previous frame to calculate distance 
 +    uint8_t unknown10[8]
 +    uint32_t laraMeshPtrs[15]; 
 +    uint32_t firingAtEnemy; 
 +    Vector2_16 aimAngles
 +    uint16_t turnSpeed; 
 +    uint16_t moveAngle; 
 +    VectorYXZ_16 headRot; 
 +    VectorYXZ_16 torsoRot 
 + 
 +    struct WeaponAnimData { 
 +        uint32_t animFrame; // pointer to anim frame data 
 +        uint16_t frame; 
 +        uint16_t animId; 
 +        uint16_t canShoot; 
 +        VectorXY_16 aimAngles; 
 +        uint8_t unknown[2]; 
 +        uint16_t shooting; 
 +    }; 
 +    WeaponAnimData weaponAnimRight; 
 +    WeaponAnimData weaponAnimLeft; 
 +    uint32_t pistolsAmmo; 
 +    uint32_t magnumsAmmo; 
 +    uint32_t uziAmmo; 
 +    uint32_t shotgunAmmo; 
 +    uint32_t harpoonAmmo; 
 +    uint32_t grenadeLauncherAmmo; 
 +    uint32_t m16Ammo; 
 +    uint32_t unknown11; 
 +    uint32_t laraItemPtr; 
 +    uint32_t gameEffectsPtr; 
 +    uint16_t firstFreeEffect; 
 +    uint16_t firstFreeItem; 
 +    uint16_t firstActiveItem; 
 +    uint16_t lastEffect; 
 +    uint16_t bodyListHead; // for "clear bodies" floordata 
 +     
 +    if(weapon1 != -1) { 
 +        // data about this weapon 
 +        uint16_t weaponObjectId; 
 +        uint16_t weaponAnimNumber; 
 +        uint16_t weaponFrame; 
 +        uint16_t weaponAnimState; 
 +        uint16_t goalAnimState; 
 +    } 
 +     
 +    uint32_t currentFlipEffect; 
 +    uint32_t flipEffectDuration; 
 +    uint32_t unknown12; 
 +    uint32_t activeFlares; 
 +     
 +    struct FlareInfo { 
 +        int32_t x, y, z; 
 +        int16_t rotX, rotY, rotZ; 
 +        uint16_t room; 
 +        uint16_t speed; 
 +        uint16_t fallspeed; 
 +        uint32_t unknown; 
 +    }; 
 +     
 +    FlareInfo flareInfos[numFlares]; 
 +     
 +    // remainder is unused 
 +    uint8_t readToEOF[];
 }; };
 </code> </code>
Line 73: Line 163:
 ===== Identifications ===== ===== Identifications =====
  
-The ''LevelNumber'' field is used for determining what level the game should load when opening the savegame.+The ''levelNumber'' field is used for determining what level the game should load when opening the savegame.
  
 ^ ID ^ Level ^ Puzzle ^^^^ Key ^^^^ ^ ID ^ Level ^ Puzzle ^^^^ Key ^^^^
Line 98: Line 188:
 |  20 |  Wreck of the Maria Doria (//demo// |  Circuit Breaker  |    |    |    |  Rest Room Key  |  Rusty Key  |  Cabin Key  |    | |  20 |  Wreck of the Maria Doria (//demo// |  Circuit Breaker  |    |    |    |  Rest Room Key  |  Rusty Key  |  Cabin Key  |    |
 |  21 |  Tibetan Foothills (//demo// |    |    |    |  The Seraph  |  Drawbridge Key  |  Hut Key  |    |    | |  21 |  Tibetan Foothills (//demo// |    |    |    |  The Seraph  |  Drawbridge Key  |  Hut Key  |    |    |
 +^ Golden Mask levels |||||||||| 
 +|  1  |  The Cold War  |    |    |    |    |  Guardroom Key  |  Shaft 'B' Key  |    |    | 
 +|  2  |  Fool's Gold  |  Circuit Board  |    |    |    |  CardKey 1  |    |    |  CardKey 2  | 
 +|  3  |  Furnace of the Gods  |  Mask Of Tornarsuk  |  Gold Nugget  |    |    |    |    |    |    | 
 +|  4  |  Kingdom  |  Mask Of Tornarsuk  |    |    |    |    |    |    |    | 
 +|  5  |  Nightmare In Vegas  |  Elevator Junction  |  Door Circuit  |    |    |  Hotel Key  |    |    |    |
  
  
trs/savegame/tr2.1487812676.txt.gz · Last modified: 2017/02/23 01:17 (external edit)
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0