Quantcast

Jump to content

» «
Photo

Vice City Save File Format

44 replies to this topic
spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#1

Posted 21 August 2010 - 06:49 AM Edited by spaceeinstein, 31 July 2016 - 09:05 PM.

facedesk.gif Save file documentation is one of the most difficult task I've done. This is one of the biggest documentation project that I've undertaken (the bigger one is the list of opcodes) and I'm proud to have filled in major gaps of knowledge and discover the intricate details of the save format. Surprisingly, the limits imposed within the save file matches the limit listed here. This made me certain that I have the correct data. colgate.gif

This topic will be everything about Vice City's save file format, with pretty tables and up-to-date information. Apparently almost all knowledge of the format is nearly lost on this site. I can only retrieve one page from archive.org. Can anyone retrieve anymore information on this?

Each block starts with the size of the current block. To reach the next block, read the size of the block and add that to the current address plus four. Many blocks' sizes are not constant. See below on an example on how to reach each block. The initial offset of the block written in the tables starts after the size of the block (4 sometimes 8 bytes after), not at the block.

Merely changing the values will cause the game to read the save file as corrupt. The last four bytes of the save file is a checksum, the sum of all bytes, except the last four bytes, in the file. If you do not change the checksum, when adding one byte to some place, you must subtract one from another place.

In this page, assume every number without 0x is a decimal. For most blocks, all that's left is filling the unknowns. I will try to keep this post updated along with GTAModding's article.
Block 0: Simple Vars
0x00  dword            size of block 0
0x04  -                start of block 0, data below
    0x0000    wchar_t[24]  last mission passed (0318)
    0x0030    word         SYSTEMTIME wYear
    0x0032    word         SYSTEMTIME wMonth
    0x0034    word         SYSTEMTIME wDayOfWeek
    0x0036    word         SYSTEMTIME wDay
    0x0038    word         SYSTEMTIME wHour
    0x003A    word         SYSTEMTIME wMinute
    0x003C    word         SYSTEMTIME wSecond
    0x003E    word         SYSTEMTIME wMilliseconds
    0x0040    dword        unknown, value is always 12609
    0x0044    dword        current island
    0x0048    float[3]     camera coordinates (x,y,z)
    0x0054    dword        unknown, but only present in Steam version saves. If present, n = 4 in following offsets for this block, otherwise n = 0.
    0x0054+n  dword        length (ms) of in-game minute (1000 = normal)
    0x0058+n  dword        weather timer
    0x005C+n  byte         game hour
    0x005D+n  byte[3]      align
    0x0060+n  byte         game minute
    0x0061+n  byte[3]      align
    0x0064+n  dword        pad number?
    0x0068+n  dword        global timer
    0x006C+n  float        time scale (015D)
    0x0070+n  float        time step (frame delta time)
    0x0074+n  float        time step (not clipped)
    0x0078+n  dword        number of the frames processed from the beginning of the game
    0x007C+n  float        time step #2 (constant 1.0, unused)
    0x0080+n  float        frames per update (constant 1.0, unused)
    0x0084+n  float        time scale (constant 1.0, unused)
    0x0088+n  word         old (previous) weather type
    0x008A+n  byte[2]      align
    0x008C+n  word         new (next) weather type
    0x008E+n  byte[2]      align
    0x0090+n  word         forced weather type (01B5 or 01B6), -1 if not forced
    0x0092+n  byte[2]      align
    0x0094+n  float        weather interpolation value
    0x0098+n  dword        current weather table offset (between 0 and 63)
    0x009C+n  float        current vehicle camera view (between 0.0 and 5.0)
    0x00A0+n  float        current on foot camera view (classic controls only)
    0x00A4+n  dword        current interior (04BB)
    0x00A8+n  byte         taxi boost jump (0572)
    0x00A9+n  byte[3]      align
    0x00AC+n  byte         invert look option
    0x00AD+n  byte[3]      align
    0x00B0+n  dword        extra color (04F9)
    0x00B4+n  dword        extra color active (0 = inactive, 1 = active)
    0x00B8+n  float        extra color fade (between 0.0 and 1.0)
    0x00BC+n  dword[10]    unknown, relates to radio station?
    0x00E4+n  dword        size of script block
    0x00E8+n  -            start of script block, see below
        Subblock A
        0x0000  char[4]           "SCR\0"
        0x0004  dword             size of script block again
        0x0008  dword             size of subblock A
        0x000C  -                 start of subblock A: global variables - each variable is 4 bytes long
        Subblock B
        0x0000  dword             size of subblock B (constant 0x248)
        0x0004  dword             on mission flag (0180) offset in global variable space
        0x0008  dword             game timer when mission is passed (0318 or 0595), -1 if never passed a mission
        0x000C  BuildingSwap[25]  swapped building model (03B6) structures (see below)
            BuildingSwap (16/0x10 bytes)
            0x0000  dword  object type
            0x0004  dword  object index
            0x0008  dword  new building IDE model, -1 if no model
            0x000C  dword  old building IDE model, -1 if no model
        0x019C  InvisibilitySetting[20]  object visibility structure (0363) (see below)
            InvisibilitySetting (8 bytes)
            0x0000  dword  object type
            0x0004  dword  object index
        0x023C  -            start of another set of offset below
            0x0000  byte     is mission script running
            0x0001  byte     Kaufman Cabs radio
            0x0002  byte[2]  align
            0x0004  dword    size of main
            0x0008  dword    size of largest mission
            0x000C  word     number of missions
            0x000E  word     unknown
            0x0010  dword    number of running scripts
            0x0014  -        136 bytes each, script structure (see below)
                Script structure
                0x0000  dword      pointer to previous script
                0x0004  dword      pointer to next script
                0x0008  char[8]    name
                0x0010  dword      current instruction pointer
                0x0014  dword[4]   return stack
                0x0024  dword      unknown
                0x0028  dword      unknown
                0x002C  word       stack counter
                0x002E  word       unknown
                0x0030  dword[16]  16 local variables
                0x0070  dword      timerA (local variable 16)
                0x0074  dword      timerB (local variable 17)
                0x0078  byte       is active
                0x0079  byte       "if" statement result
                0x007A  byte       uses mission cleanup
                0x007B  byte       skip wake time (always 0)
                0x007C  dword      wake time
                0x0080  word       "if" check result
                0x0082  byte       "not" flag
                0x0083  byte       death/arrest state
                0x0084  byte       death/arrest has been executed
                0x0085  byte       mission flag
Block 1: Ped Pool
0x0000  dword  size of block 1
0x0004  -      start of block 1, data below
    0x0000  dword  size of subblock
    0x0004  -      start of subblock, data below
        0x0000  dword         number of players
        0x0004  PlayerPed[n]  start of player structure where n is the number of players
            PlayerPed (1791/0x6FF bytes)
            0x0006  dword     index
            0x000A  CPed      ped structure dump (see structure below)
                CPed (1752/0x6D8 bytes)
                0x0034  float[3]  x,y,z coordinates
                0x0053  byte      bit 1 = bullet proof
                                  bit 2 = fire proof
                                  bit 3 = collision proof
                                  bit 4 = melee proof
                0x00B8  float     weight
                0x0354  float     health
                0x0358  float     armor
                0x03A8  dword     pointer to last car entered/car about to be entered
                0x03AC  byte      is ped in any vehicle (0 = not in vehicle, 1 = in vehicle)
                0x0504  byte      currently selected weapon type
                0x0598  byte      last damaged by weapon
            0x06E2  dword     max wanted level
            0x06E6  dword     max criminal points, in tandem with max wanted level
            0x06EA  char[21]  current model name
Block 2: Garages
0x0000  dword  size of block 2
0x0004  -      start of block 2, data below
    0x0000  dword  size of subblock (constant 0x1EC4)
    0x0004  -      start of subblock, data below
        0x0000  dword          number of garages
        0x0004  dword          free bombs (021D)
        0x0008  dword          free resprays (0335)
        0x0010  dword          number of Securicars collected (unused)
        0x0014  dword          number of Police cars collected (unused)
        0x0018  dword          cars collected by garage type 8 in flag field representation
        0x001C  dword          cars collected by garage type 9 in flag field representation
        0x0020  dword          cars collected by garage type 10 in flag field representation
        0x0024  dword          cars collected by garage type 22 in flag field representation
        0x0028  dword          game timer when garage full message was last shown
        0x002C  StoredCar[48]  stored car structures (see below)
            StoredCar (40/0x28 bytes)
            0x0000  dword     model ID
            0x0004  float[3]  x,y,z position
            0x0010  float[3]  x,y,z vector rotation
            0x001C  dword     proofs
            0x0020  byte      primary color
            0x0021  byte      secondary color
            0x0022  byte      current radio station
            0x0023  byte      variation 1
            0x0024  byte      variation 2
            0x0025  byte      bomb type
        0x07AC  Garage[32]     garage structures (see below)
            Garage (168/0xA8 bytes)
            0x0000  byte      type
            0x0001  byte      state
            0x0002  byte      maximum number of cars in garage (4 = default)
            0x0004  byte      closed but nothing dropped off (mission keepcar)
            0x0005  byte      is deactive (unused)
            0x0006  byte      has respray happened (0329)
            0x0007  byte      align
            0x0008  dword     target model (unused)
            0x000C  pointer   door object
            0x0010  pointer   crusher top object (unused)
            0x0019  byte      rotating door (03BB)
            0x001A  byte      special camera for garage (03DA)
            0x001B  byte      align
            0x001C  float[3]  primary x,y,z coordinates (garage opcode parameters 1, 2, 3)
            0x0028  float[4]  rx,ry,rz,rw quaternion rotation
            0x0038  float     ceiling z coordinate (garage opcode parameter 8)
            0x0044  float     lower x coordinate (min of x1 + x2 - x primary, x primary, x1, or x2)
            0x0048  float     upper x coordinate (max of x1 + x2 - x primary, x primary, x1, or x2)
            0x004C  float     lower y coordinate
            0x0050  float     upper y coordinate
            0x0054  float     door current height relative to base of garage
            0x0058  float     door maximum height relative to base of garage
            0x005C  float     door object x position, 0 if no door
            0x0060  float     door object y position, 0 if no door
            0x0064  float     crusher top object x position (unused)
            0x0068  float     crusher top object y position (unused)
            0x006C  float     door object z position
            0x0070  float     crusher top object z position (unused)
            0x0074  dword     game timer to open a closed garage
            0x007C  pointer   target vehicle
Block 3: Game Logic
0x0000  dword  size of block 3
0x0004  -      start of block 3, data below
    0x0000  dword  size of subblock (constant 0x104)
    0x0004  -      start of subblock, data below
        0x0000  dword             number of taxi shortcut pick-up points for mission (058D)
        0x0004  TaxiShortcut[16]  taxi shortcut structures (see structure below)
            TaxiShortcut (16/0x10 bytes)
            0x0000  float[3]  x,y,z coordinates
            0x000C  float     heading
Block 4: Vehicle Pool
0x0000  dword  size of block 4
0x0004  -      start of block 4, data below
    0x0000  dword  size of subblock
    0x0004  -      start of another set of offset below
        0x0000  dword       number of general vehicles
        0x0004  dword       number of boats
        0x0008  dword       number of bikes
        0x000C  Vehicle[n]  vehicle structures where n is the number of general vehicles, boats, and bikes
            Vehicle (0x5E6 (general) | 0x4CA (boat) | 0x4F6 (bike) bytes)
            0x0000  dword  vehicle type
            0x0004  word   vehicle IDE model
            0x0006  dword  vehicle index
            0x000A  -      vehicle structure dump (see below, dependent on vehicle type)
                General vehicle structure (1500/0x5DC bytes)
                0x0034  float[3]  x,y,z coordinates
                0x005C  word      IDE model number
                Boat structure (1216/0x4C0 bytes)
                0x0034  float[3]  x,y,z coordinates
                0x005C  word      IDE model number
                Bike structure (1260/0x4EC bytes)
                0x0034  float[3]  x,y,z coordinates
                0x005C  word      IDE model number
Block 5: Object Pool
0x00  dword  size of block 5
0x04  -      start of block 5, data below
    0x00  dword  size of subblock (4 bytes less than block header)
    0x04  -      start of another set of offset below
        0x00  dword  number of objects
        0x04  -      88 bytes each, object structures (see struct below)
            Object structure
            0x00  word      object IDE number
            0x06  float[3]  x,y,z coordinates
Block 7: Cranes
0x00  dword  size of block 7
0x04  -      start of block 7, data below
    0x00  dword  size of subblock (constant 0x3E8)
    0x04  -      start of subblock, data below
        0x00  dword         number of cranes
        0x04  dword         number of vehicles collected by military crane
        0x08  124 bytes[8]  crane structures (see below)
            Crane structure
            0x00  dword     index in static objects pool
            0x08  float     pickup zone x1 (crane opcode parameter 3)
            0x0C  float     pickup zone x2 (crane opcode parameter 5)
            0x10  float     pickup zone y1 (crane opcode parameter 6)
            0x14  float     pickup zone y2 (crane opcode parameter 4)
            0x18  float     drop off point x (crane opcode parameter 7)
            0x1C  float     drop off point y (crane opcode parameter 8)
            0x20  float     drop off point z (crane opcode parameter 9)
            0x24  float     drop off heading in radians (crane opcode parameter 10)
            0x28  float     crane arm pick up rotation in radians
            0x2C  float     crane arm drop off rotation in radians
            0x30  float     crane arm pick up distance from center of crane
            0x34  float     crane arm drop off distance from center of crane
            0x38  float     crane arm pick up height
            0x3C  float     crane arm drop off height
            0x40  float     crane arm current rotation in radians
            0x44  float     crane arm current distance from center of crane
            0x48  float     crane arm current height
            0x4C  float[3]  crane hook initial x, y, z
            0x58  float[3]  crane hook current x, y, z
            0x6C  dword     pointer to vehicle to pick up
            0x70  dword     current game time + 10000 (only updates when crane has finished lifting car)
            0x74  byte      crane activity
            0x75  byte      crane status
            0x76  byte      number of vehicles collected
            0x77  byte      is crusher crane
            0x78  byte      is military crane
            0x7A  byte      model is not doc_crane_cab0
            0x7B  byte      align
Block 8: Pickups
0x0000  dword  size of block 8
0x0004  -      start of block 8, data below
    0x0000  dword        size of subblock (constant 0x4494)
    0x0004  Pickup[336]  pickup structures (see below)
        Pickup (52/0x34 bytes)
        0x0000  float[3]  x,y,z coordinates
        0x000C  float     current protection revenue (04A6)
        0x0010  dword     pickup object entity
        0x0014  dword     pickup extra object entity (weapons bomb or minigun for example)
        0x0018  dword     ammo/money/text/protection revenue limit
        0x001C  dword     timer
        0x0020  word      protection revenue rate
        0x0022  word      IDE model
        0x0026  char[8]   string to display in help box (0517/0518)
        0x002E  byte      type
        0x002F  byte      has been picked up
    0x4444  word         collected index for below, always between 0 and 19
    0x4446  byte[2]      align
    0x4448  dword[20]    pickup index, latest collected pickup pointed by collected index from above
Block 9: Phone Info
0x0000  dword  size of block 9
0x0004  -      start of block 9, data below
    0x0000  dword  size of subblock (constant 0xA30)
    0x0004  -      start of subblock, data below
        0x0000  dword      number of phone objects
        0x0004  dword      number of active phones
        0x0008  Phone[50]  phone structures (see below)
            Phone (52/0x34 bytes)
            0x0000  float[3]  x,y,z coordinates
            0x000C  dword[6]  pointer to phone message string
            0x0024  dword     game timer when phone message ends for states 5 and 6
            0x0028  dword     object index
            0x002C  dword     phone state
            0x0030  byte      is player within range of phone
            0x0031  byte[3]   align
Block 10: Restart Points
Block 11: Radar Blips
0x0000  dword  size of block 11
0x0004  -      start of block 11, data below
    0x0000  dword  size of subblock (constant 0xE18)
    0x0004  -      start of subblock, data below
        0x0000  char[4]       "RDR\0"
        0x0004  dword         size of rest of subblock
        0x0008  48 bytes[75]  blip structures (see below)
            Blip structure
            0x0000  dword     blip color
            0x0004  dword     blip type
            0x0008  dword     entity (0 = not an entity)
            0x0010  float[2]  x,y coordinates (does not apply to entities)
            0x0018  float[3]  x,y,z coordinates (does not apply to entities)
            0x0026  byte      dim blip
            0x0028  byte      is short range
            0x002A  word      blip scale
            0x002C  word      blip display
            0x002E  word      sprite blip
Block 12: Zones
0x0000  dword  size of block 12
0x0004  -      start of block 12, data below
    0x0000  dword  size of subblock (constant 0x8BE0)
    0x0004  -      start of subblock, data below
        0x0000  char[4]        "ZNS\0"
        0x0004  dword          size of rest of subblock
        0x0008  dword          current level
        0x000E  byte[2]        align
        0x0010  Zone[20]       type 0 and 1 (navig) zone structures (see below)
        0x0470  Zone[169]      type 2 (info) zone structures (see below)
        0x2968  68 bytes[338]  ped/car/gang info zone structures
        0x8330  word           total number of type 0 and 1 (navig) zones
        0x8332  word           total number of type 2 (info) zones
        0x8334  word           total number of type 2 (info) zones * 2 - 1
        0x8336  byte[2]        align
        0x8338  Zone[39]       type 3 (map) zone structures (see below)
        0x8BC0  word[14]       crime report audio zones
        0x8BDC  word           total number of type 1 (map) zones
        0x8BDE  word           total number of crime report audio zones
            Zone (56/0x38 bytes)
            0x0000  char[8]   name
            0x0008  float[3]  x1,y1,z1 coordinates
            0x0014  float[3]  x2,y2,z2 coordinates
            0x0020  dword     type
            0x0024  dword     level
            0x0028  word      zone info id night
            0x002A  word      zone info id day
            0x002C  dword     child zone index
            0x0030  dword     parent zone index
Block 13: Gangs
0x00  dword  size of block 13
0x04  -      start of block 13, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock, data below
        0x00  char[4]      "GNG\0"
        0x04  dword        total size of gang structures
        0x08  24 bytes[9]  gang structures (see below)
            Gang structure
            0x00  dword  car model (0236)
            0x04  dword  ped model 1
            0x08  dword  ped model 2
            0x10  dword  weapon number 1 (0237)
            0x14  dword  weapon number 2
Block 14: Car Generators
0x0000  dword  size of block 14
0x0004  -      start of block 14, data below
    0x0000  dword  size of subblock
    0x0004  -      start of subblock, data below
        0x0000  char[4]            "CGN\0"
        0x0004  dword              size of all data below
        0x0008  dword              size of subdata before car generator structures (constant 0xC)
        0x000C  dword              total number of car generators
        0x0010  dword              total number of active car generators
        0x0014  byte               process counter
        0x0015  byte               generate even if player is close counter
        0x0016  byte[2]            align
        0x0018  dword              size of all data below (constant 0x1FCC)
        0x001C  CarGenerator[185]  car generator structures (see below)
            CarGenerator (44/0x2C bytes)
            0x0000  dword     vehicle IDE model
            0x0004  float[3]  x,y,z coordinates
            0x0010  float     heading
            0x0014  word      primary color
            0x0016  word      secondary color
            0x0018  byte      force spawn
            0x0019  byte      alarm
            0x001A  byte      lock
            0x001B  byte      align
            0x001C  word      min delay
            0x001E  word      max delay
            0x0020  dword     game timer when car is generated, game timer + 60000 when car is stolen
            0x0024  dword     vehicle index, -1 if not spawned or is stolen
            0x0028  word      014C, 101 = -1
            0x002A  byte      has recently been stolen
            0x002B  byte      align
Block 15: Particles
0x00  dword  size of block 15
0x04  -      start of block 15, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock
Block 16: Audio Script Objects
0x00  dword  size of block 16
0x04  -      start of block 16, data below
    0x00  dword  size of subblock
    0x04  -  start of subblock, data below
        0x00  char[4]      "AUD\0"
        0x04  dword        size of all audio structures + 4 (n * 24 bytes + 4)
        0x08  dword        number of audio objects (n)
        0x12  24 bytes[n]  audio structures (see below)
            Audio structure
            0x04  word      audio index (018D)
            0x08  float[3]  x,y,z coordinates
Block 17: Script Paths
0x00  dword  size of block 17
0x04  -      start of block 17, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock, data below
        0x00  dword  total number of paths
        0x0C  float  speed (049E)
        0x10  float  distance along path (049F)
        0x14  float  some sort of offset
        0x1C  -      object handle, up to 6 supported
Block 18: Player Info
0x00  dword  size of block 18
0x04  -      start of block 18, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock, data below
        0x00  dword  current money
        0x04  byte   wasted/busted status
        0x0F  dword  currently displayed money
        0x13  dword  number of packages picked up
        0x17  dword  total number of packages (02ED)
        0x1B  byte   infinite run (0330)
        0x1C  byte   fast reload (0331)
        0x1D  byte   fireproof (055D)
        0x1E  byte   max health
        0x1F  byte   max armor
        0x20  byte   free busted once
        0x21  byte   free wasted once (0414)
        0x22  byte   driveby enabled (0501)
Block 19: Stats
0x00  dword  size of block 19
0x04  -      start of block 19, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock, data below
        0x00   dword     people wasted by player
        0x04   dword     people wasted by others
        0x08   dword     road vehicles destroyed
        0x0C   dword     boats destroyed
        0x10   dword     tires popped with gunfire
        0x14   dword     bullets fired
        0x18   dword[23] peds of ped type wasted
        0x74   dword     planes and helicopters destroyed
        0x78   float     current progress (030C)
        0x7C   float     total progress (030D)
        0x80   dword     kilograms of explosives used
        0x84   dword     bullets that hit
        0x88   dword     number of headshots
        0x8C   dword     total number of wanted stars attained
        0x90   dword     total number of wanted stars evaded
        0x94   dword     times busted
        0x98   dword     hospital visits
        0x9C   dword     days passed in game
        0xA0   dword     safehouse visits
        0xA4   dword     sprayings
        0xA8   float     max insane stunt jump distance (030E)
        0xAC   float     max insane stunt jump height (030F)
        0xB0   dword     max insane stunt flips (0310)
        0xB4   dword     max insane stunt rotation (0311)
        0xB8   dword     best insane stunt so far (0312)
        0xBC   dword     unique jumps completed (0313)
        0xC0   dword     total unique jumps (0314)
        0xC4   dword     mission attempts (0317)
        0xC8   dword     passengers dropped off (0315)
        0xCC   dword     cash made in taxi (0316)
        0xD0   dword     unused stat
        0xD4   dword     unused stat
        0xD8   dword     unused stat
        0xDC   dword     porn leaflet rubbish visibility (055A)
        0xE0   dword     allows hurricane weather (057C)
        0xE4   float     distance traveled foot
        0xE8   float     distance traveled car
        0xEC   float     distance traveled bike
        0xF0   float     distance traveled boat
        0xF4   float     distance traveled golf cart
        0xF8   float     distance traveled helicopter
        0xFC   float     distance traveled plane
        0x100  dword     people saved in an ambulance (0401)
        0x104  dword     criminals killed on vigilante mission (0402)
        0x108  dword     total fires extinguished (0404)
        0x10C  dword     highest vigilante mission level (0578)
        0x110  dword     highest paramedic mission level (0403)
        0x114  dword     fire truck mission level (0599)
        0x118  dword     photographs taken
        0x11C  dword     rampages passed
        0x120  dword     total number of rampages (0408)
        0x124  dword     total number of missions (042C)
        0x128  dword     flight hours
        0x12C  dword     fishes fed (number of times drowned)
        0x130  dword     seagulls sniped
        0x134  float     weapon budget (0528)
        0x138  float     fashion budget (04CF)
        0x13C  float     visits from loan sharks (unused)
        0x140  float     stores knocked off (0531)
        0x144  float     movie stunts (unused)
        0x148  float     assassination contracts completed (0533)
        0x14C  float     pizzas delivered (0534)
        0x150  float     garbage pickups made (unused)
        0x154  float     'ice cream' sold (0536)
        0x158  float     top shooting range score (unused, see 0x1FF)
        0x15C  float     shooting range rank (unused, see 0x1FF)
        0x160  dword     longest wheelie time (04FC)
        0x164  dword     longest stoppie time (04FC)
        0x168  dword     longest 2wheel time (04FC)
        0x16C  dword     longest wheelie distance (04FC)
        0x170  dword     longest stoppie distance (04FC)
        0x174  dword     longest 2wheel distance (04FC)
        0x178  dword     property budget (0529)
        0x17C  dword     auto repair and painting budget
        0x180  dword     property destroyed
        0x184  dword     number of properties owned (0542)
        0x188  dword     bloodring kills (0543)
        0x18C  dword     longest time in bloodring (0544)
        0x190  byte[15]  properties owned (0542)
        0x19F  dword     highest media attention
        0x1A3  dword[23] best times for races/vehicle missions in seconds (042E)
        0x1FF  dword[5]  minigame records (042F)
        0x213  dword     Hotring Best Result (0582)
        0x217  dword     peds killed recently (always zero while saving)
        0x21B  dword     total peds killed (used for calculating rating)
        0x21F  char[8]  last passed mission GXT entry name (0318)
        0x227  dword     cheat rating
        0x22B  float[10] listening time per radio station in milliseconds
Block 20: Set Pieces
0x00  dword  size of block 20
0x04  -      start of block 20, data below
    0x00  dword  size of subblock
    0x04  -      start of subblock, data below
        0x00  dword  number of trigger zones (04F8)
        0x04  [96]   56 bytes each, trigger zone structures (see below)
            Trigger zone structure
            0x00  dword     type
            0x08  float     timer
            0x08  float     trigger area x1
            0x0C  float     trigger area y2
            0x10  float     trigger area x2
            0x14  float     trigger area y1
            0x18  float[2]  policeA spawn x,y
            0x20  float[2]  policeB spawn x,y
            0x28  float[2]  policeA heading x,y
            0x30  float[2]  policeB heading x,y
Block 21: Streaming
0x00  dword  size of block 21
0x04  -      start of block 21, data below
    0x00  dword  size of subblock (constant 0x12C)
    0x04  -      start of subblock, data below
        0x00  20 bytes[15]  streaming structures
Block 22: Ped Types
0x00  dword  size of block 22
0x04  -      start of block 22, data below
    0x00  dword  size of subblock (constant 0x2E8)
    0x04  -      start of subblock, data below
        0x00  char[4]       "PTP\0"
        0x04  dword         total size of pedtype structures
        0x08  32 bytes[23]  pedtype structures (see below)
            Pedtype structure
            0x00  dword  bitstring (each associated to an entry in ped.dat)
            0x04  float  first value/50.0
            0x08  float  second value/50.0
            0x0C  float  third value/50.0
            0x10  float  fourth value
            0x14  float  fifth value
            0x18  dword  threat flags
            0x1C  dword  avoid flags

Narcis_speed6
  • Narcis_speed6

    The Saint

  • The Connection
  • Joined: 28 Feb 2008
  • None
  • Most Talented [Expression] 2012
    Most Helpful [Expression] 2012
    Most Helpful 2011
    Most Talented [Expression] 2011
    Most Helpful [Expression] 2011
    Best Member in a Group 2011
    Most Helpful [GTA Series] 2011
    Most Respected 2010
    Most Helpful 2010
    Most Talented [Visual Arts] 2010
    Most Helpful [Visual Arts] 2010
    Most Helpful [GTA Series] 2010

#2

Posted 21 August 2010 - 10:55 AM

this is helpful, should probably go into tutorials section

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#3

Posted 23 August 2010 - 12:03 PM

space, I remember how I enjoyed exploring the GTA SA Saves format, so wish you good luck with this stuff icon14.gif

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#4

Posted 23 August 2010 - 01:49 PM

Thanks smile.gif I'm not sure if I'm labeling the stuff correctly. It's very interesting to discover how much stuff are saved in the game.

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#5

Posted 11 January 2015 - 09:07 PM Edited by Seemann, 11 January 2015 - 09:39 PM.

Bump.

space, I haven't looked into VC save files yet, but have a strong feeling that mostly it's structure taken from GTA3.

These ones at Subblock B:
 

0x08	[25]	16 bytes each
0x198	[20]	8 bytes each

seem to be StaticReplacement[25] and InvisibleObject[20] which also are present in both GTA 3 and SA.

Cranes: are they usable in Vice City? I can't remember where they are. It could be a leftover from GTA 3, you may find a description of a Crane struct in my GTA3 template (most fields are unknown though).

 

p.s. huh, did not realize that this topic is not in the III Coding section where GTAIII save docs's one is..

  • thehambone likes this

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#6

Posted 11 January 2015 - 09:11 PM

Odd, quick inspect around the code suggests they are fully working. They are even added to the map if the objects exists!

I never seen a crane in VC though, I think it's purely a III leftover. Might be very wrong, though.

TJGM
  • TJGM

    Boss

  • Members
  • Joined: 14 Jun 2011
  • Ireland
  • Helpfulness Award
    Contribution Award [Mods]

#7

Posted 11 January 2015 - 09:13 PM Edited by TJGM, 11 January 2015 - 09:14 PM.

p.s. huh, did not realize that this topic is not in the III Coding section where GTAIII save docs's one is..

Yeah, after the update to the modding boards a lot of threads got mixed up in the process. Threads as old as this aren't in the correct sections, a lot of map mods are still in Art Support.

 

I've tried my best to move as many threads as possible, but there are way too many. If people want their thread moved to the correct subforum they'll have to submit a report instead.

 

Thread moved to the correct section.

  • Seemann likes this

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#8

Posted 11 January 2015 - 09:23 PM

Um, why are some blocks completely missing from gtamodding? These are

Block 4 - Vehicle Pool
Block 6 - Path Find
Block 15 - Particle Objects
Blcok 21 - Streaming
Blcok 22 - Ped Types
Block 23 - Planes
I have a feeling those two padding blocks in III save might be those, too. I haven't found any trace of the blocks in III Mobile, though.

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#9

Posted 11 January 2015 - 09:54 PM Edited by OrionSR, 11 January 2015 - 09:56 PM.

If I had to guess about the nature of the fields in a crane structure I'd say, inactive cranes are probably entered via IPL and contain coordinates. Active cranes also have float fields that I suspect are added by the activate opcode. I suspect these are xy coords for movement and z is handled by the crane. The end of the record might contain flags for the vehicles collected. However, my memory of the cranes is extremely fuzzy. This is all simply speculation to test.


spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#10

Posted 11 January 2015 - 10:53 PM Edited by spaceeinstein, 11 January 2015 - 10:54 PM.

Um, why are some blocks completely missing from gtamodding?

Since my absence I didn't manage to research further into those blocks so data from them have been empty. All the blocks are in my first post though.

I'll see if I can get the doc updated when I find the time. So much information to explore!
  • thehambone likes this

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#11

Posted 12 January 2015 - 07:37 PM Edited by spaceeinstein, 12 January 2015 - 07:46 PM.

Oh, I forgot to mention about the cranes. They are for the cranes that move in Viceport. If you want the coordinates:
  • -813.69 -1581.16 20.0
  • -937.84 -1487.03 20.0
  • -879.11 -1543.67 20.0
  • -803.18 -1513.07 20.0
  • -896.26 -1471.15 20.0
There is one crane with no coordinates that I don't know what it is for. There are a total of six cranes in the save. There are also several moving cranes at Portland Docks in III.
  • Silent and thehambone like this

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#12

Posted 13 January 2015 - 03:30 AM

Viceport? Yeah, VC. I am so lost. It's been years since I've visited these maps. Anyway, the coords format above suggests you converted hex to float from the save. Have you identified any text ipl lines associated with installing the cranes to the save? I'm assuming that III has the definitive crane structure with EV and Crusher cranes and VC doesn't include these features in a standard game (corrections? sorry, it's been a very long time). Having all 3 types of bomb garages in SA suggests that these features tend to persist or expand in the engine rather than get cut.


spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#13

Posted 13 January 2015 - 11:51 PM Edited by spaceeinstein, 14 January 2015 - 09:50 PM.

There are leftover code for the crusher and EV features but I don't know if they can be activated. When loading the game, the game searches the map and checks against a hardcoded list of six cranes models (three cranes models for III):
  • doc_crane_cab0
  • doc_crane_cab01
  • doc_crane_cab02
  • doc_crane_cab03
  • boatcranelg0
  • LODnetopa0
They are then added to a list of cranes ready to be manipulated and saved. I don't know how they are handled yet.

EDIT: Thanks for labeling the static replacement and object visibility structures, Seemann. I just checked it out now and it is how opcodes 03B6 and 0363 save the swapped building models and object visibility. Interestingly swapping the model back to its original model as defined in the IPL file will reset the entry as if no swapped had happened. The same happens for the object visibility. This section might be interesting to explore the issue of modding the map of a saved game and having the swapped models be completely misplaced.

EDIT2: Some data for streaming block. It looks like it's heavily related to requesting and loading models. This is outside of my understanding unfortunately.
0x00 - dword - size of subblock, constant 0x12C
  0x00 - 20 bytes[15] - streaming structures, 20 bytes each, 15 total
EDIT3: Zones
0x00 - dword - size of subblock, constant 0x8BE0
  0x0000 - char[4] - "ZON\0"
  0x0010 - navig.zon structures, 56 bytes each, 20 total
    0x00 - char[8] - name
    0x08 - float[3] - x1, y1, z1
    0x14 - float[3] - x2, y2, z2
    0x20 - dword - type
    0x24 - dword - island number
    0x28 - word - ?
    0x2A - word - ?
    0x2C - dword - ?
    0x30 - dword - ?
    0x34 - dword - ?
  0x0470 - info.zon structures, 56 bytes each, 169 total
    0x00 - char[8] - name
    0x08 - float[3] - x1, y1, z1
    0x14 - float[3] - x2, y2, z2
    0x20 - dword - type
    0x24 - dword - island number
    0x28 - word - ?
    0x2A - word - ?
    0x2C - dword - ?
    0x30 - dword - ?
    0x34 - dword - ?
  0x2968 - ped/car/gang info zone structures, 68 bytes each, 338 total
  0x8330 - word - ?
  0x8332 - word - ?
  0x8338 - dword - ?
  0x833C - map.zon structures, 56 bytes each, 39 total
    0x00 - char[8] - name
    0x08 - float[3] - x1, y1, z1
    0x14 - float[3] - x2, y2, z2
    0x20 - dword - type
    0x24 - dword - island number
    0x28 - word - ?
    0x2A - word - ?
    0x2C - dword - ?
    0x30 - dword - ?
    0x34 - dword - ?
  0x8BC4 - crime report audio?, 2 bytes each, 14 bytes total

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#14

Posted 31 May 2015 - 06:06 PM Edited by OrionSR, 31 May 2015 - 11:03 PM.

I've been looking into the VC pickup structure in an effort to document how to edit the location of the Havana outfit and wanted to record a few notes.
 

Pickup records of Havana outfit. Only two Bit Hit, the top record below, is accessible.

 

The lower word in the global variable is the index in the pickup pool. The upper word might be some sort of counter. When a pickup is destroyed and recreated this value will increment. I never knew how this value is incremented when the global value is 0 after it is destroyed. Now I suspect this value is associated with the field at 0x24.

12 01 16 00  // Two Bit Hit - $1288 at offset 0x1518 (5400) from beginning of file
0A 01 0C 00  // No Escape? - $1288 at offset +0x1420 (+5152) from start of global variable space

Float_X     Float_Y     Float_Z     asset_float object_pool det_grenade ammo_asset  timestamp   asset model count char[8]?                PT PU F0 F1 F2 F3
00          04          08          0C          10          14          18          1C          20    22    24    26    28          2C    2E 2F 30                                
66 26 80 C4 9A 99 D6 C3 CD CC 2C 41 00 00 00 00 76 01 00 00 00 00 00 00 05 00 00 00 65 EF 82 00 00 00 99 01 16 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 10 80 C4 33 F3 D8 C3 66 66 2E 41 00 00 00 00 44 01 00 00 00 00 00 00 05 00 00 00 04 7D A0 01 00 00 99 01 0C 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00

Pickup Structure - draft

 

My confidence in a accuracy of this table is low. A lot of guess work was involved; I am unable to run my own tests.

0x00  Float_X      float    
0x04  Float_Y      float  
0x08  Float_Z      float   
0x0C  asset_float  float    current asset value
0x10  object_pool  dword    guess based on III structure 
0x14  extraobject  dword    extra object (detonator and grenades, mini-gun)
0x18  ammo_asset   dword    weapon ammo, max asset value, clothing type                                 
0x1C  timestamp    dword
0x20  max_asset    dword    asset rate 
0x22  model        word     pickup model ID 
0x24  unique_id    word     
0x26  string       char[8]  string from opcode 0518 for buy properties; 'SKUM_L'. Max chars observed is 6 with 2 nulls
0x2E  PT           byte     pickup type 
0x2F  PU           byte     picked up 
0x30  F0           byte     always(?) 00 
0x31  F1 F2 F3     bytes[3] unknown bytes that look like flags

 
There appears to be a 32 byte unknown collected pickup structure at end of pickup records.


ThirteenAG
  • ThirteenAG

    Gangsta

  • Feroci
  • Joined: 29 Dec 2008
  • None
  • Contribution Award [Mods]

#15

Posted 31 May 2015 - 09:30 PM

Pickup structure was in Alien's idb for a while now:

00000000 CPickup         struc ; (sizeof=0x34)   ; XREF: .bss:_pickupsr
00000000 pos             RwV3d ?
0000000C fStandProximity dd ?                    ; //how close the player is standing to the pickup?
00000010 object          dd ?                    ; //entity associated with the pickup
00000014 pExtraObject    dd ?                    ;    //extra entity (for minigun for example)
00000018 dwPickupQuantity dd ?                   ;  //used for weapons and money
0000001C regenerationTime dd ?                   ;  //either the time it was created or when it should disappear
00000020 wMoneyGenerationRate dw ?               ; //how quickly this pickup generates money
00000022 wModelId        dw ?
00000024 wUniqueId       dw ?                    ;  //unique identifier of this pickup
00000026 szPickupTextKey db 8 dup(?)
0000002E type            db ?
0000002F byteRemoved     db ?                    ; //pickup has been removed
00000030                 db ? ; undefined
00000031                 db ? ; undefined
00000032                 db ? ; undefined
00000033 field_33        db ?
00000034 CPickup         ends
00000034
  • Seemann likes this

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#16

Posted 31 May 2015 - 10:24 PM

Pickup structure was in Alien's idb for a while now:

Weird, I checked that ones I have (ViceIDB_25.10.13, Vice_17_04_15, libGTA.idb), none of them have the detailed description of the pickup structure you posted.

ThirteenAG
  • ThirteenAG

    Gangsta

  • Feroci
  • Joined: 29 Dec 2008
  • None
  • Contribution Award [Mods]

#17

Posted 01 June 2015 - 08:08 PM

Try this one, it should be a backup of Alien's idb, don't remember exactly and can't check right now.


Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#18

Posted 01 June 2015 - 08:51 PM

Try this one, it should be a backup of Alien's idb, don't remember exactly and can't check right now.

nope, same thing.

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#19

Posted 03 June 2015 - 10:51 AM Edited by OrionSR, 04 June 2015 - 05:37 AM.

Block 22: Pedtype


0x00 dword size of block
0x04 - start of block, data below

0x00 dword size of subblock
0x04 - start of subblock, data below

0x00 char[4] "PTP\0"
0x04 dword - size of pedtype records

0x08 PedType Records - 32 bytes[23]

0x00 4 bytes - Bit ID
0x04 float - Float1/50
0x08 float - Float2/50
0x0C float - Float3/50
0x10 float - Float4
0x14 float - Float5*
0x18 dword - Threat Flags
0x1C dword - Avoid Flags

 

Threat/Avoid Flags

Spoiler

 

New Game PedType Records

 

The records are in an odd order. I'm not sure what to make of this just yet.

 

Float1 through Float5 are based on the floating point numbers in ped.dat.
Float1, Float2 and Float3 are divided by 50 before encoding.
Float4 and Float5 are encoded without modification.
Default threat and avoid settings as seeded by ped.dat

 

Added: Float4 and Float5 look just like the Flee Distance and Heading Change Rate values in pedstats.dat.

Spoiler

PED.DAT (PS2)

Spoiler

 

Threat Changes During Game Play

 

Very few of these settings are adjusted during game play.

 

Rub Out $239 == 1

Columbians threatened by Player1  add

Trojan Voodoo $282 == 1

Haitians threatened by Player1  add

Haitians threatened by Golfers  remove

Cubans threatened by Haitians  remove

Haitians threatened by Cubans  remove

Keep your Friends Close...  $270 == 1

Vercetti threatened by Wannabees  remove

Wannabees threatened by Vercetti  remove

 

Uncancelable Cheats - Cheat Changes to Threats

Spoiler

 

 

Gang Table for Reference

Spoiler

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#20

Posted 09 June 2015 - 04:53 AM Edited by OrionSR, 09 June 2015 - 04:53 AM.

Android and iOS Save Conversions

 

I'm continuing my investigation into mobile save compatibility issues, gathering information, and looking for support files for Vice City.

 

Vice City Save Wiki

010 Template for Vice City PC (retail and Steam)

 

PlayerInfo notes from Samutz
 

These are in decimal, starting after the first block size of block 1.

 

PC:

    'health'    => 870,
    'armor'        => 874,

iOS:

    'health'    => 862,
    'armor'        => 866,

Android:

    'health'    => 870,
    'armor'        => 874,

 

I'm looking for PC, iOS, and Android versions of VC's main.scm - original compiled versions.

 

It would help if I had similar starter saves for all three versions. This time I can't make my own PC saves. Sorry. Please complete the first mission and save in the most direct and simplest way possible. Try to avoid killing peds (it's hard - they kill each other anyway so don't worry too much) and picking up weapons or dropped cash, or doing anything that isn't necessary to save.

 

The Android and iOS version saves will also be used to run tests for too much time issues on those platforms.

  • MorsPrincipiumEst and thehambone like this

gangster2332
  • gangster2332

    wandering encyclopedia

  • BUSTED!
  • Joined: 18 Apr 2015
  • United-Arab-Emirates

#21

Posted 09 June 2015 - 08:35 PM Edited by gangster2332, 09 June 2015 - 08:42 PM.

Android and iOS Save Conversions
 
I'm continuing my investigation into mobile save compatibility issues, gathering information, and looking for support files for Vice City.
 
Vice City Save Wiki
010 Template for Vice City PC (retail and Steam)
 
PlayerInfo notes from Samutz
 

These are in decimal, starting after the first block size of block 1.
 
PC:
    'health'    => 870,
    'armor'        => 874,
iOS:
    'health'    => 862,
    'armor'        => 866,
Android:
    'health'    => 870,
    'armor'        => 874,

 
I'm looking for PC, iOS, and Android versions of VC's main.scm - original compiled versions.
 
It would help if I had similar starter saves for all three versions. This time I can't make my own PC saves. Sorry. Please complete the first mission and save in the most direct and simplest way possible. Try to avoid killing peds (it's hard - they kill each other anyway so don't worry too much) and picking up weapons or dropped cash, or doing anything that isn't necessary to save.
 
The Android and iOS version saves will also be used to run tests for too much time issues on those platforms.
so i should make a save with nothing completed and stats minimized?

edit: http://gtasnp.com/MDTpZH drove to ocean view hotel and saved. didnt trigger an old friend.
all stats are at 0, except playing time (1 minute) and car distance (43 seconds)
  • OrionSR likes this

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#22

Posted 10 June 2015 - 08:26 AM Edited by OrionSR, 10 June 2015 - 09:03 PM.

Block 1 - Player Peds (draft)

 

I tried to round out this block in my 010 template but I too am confused about much of the data. This template case for PC is a mix of what is in the VC wiki, the III wiki, and the VC memory address documentation. Note that the VC wiki offsets for health and armor start at 0x0A. A lot of data matches up with expected or reasonable values, other data makes no sense to me. I'm not sure how to verify the accuracy of the memory documentation.

 

Spoiler

 

Inconsistencies (out of order, reduces confidence):

  • +0x378 - [float] - rotation (related to north)
  • +0x3A8 - [pointer] - last controlled vehicle
  • +0x3A4 - [1 byte] - target objective
  • +0x3AC - [1 byte] - is in vehicle (0=on foot,1=in car)
  • +0x504 - [1 byte] - current weapon slot
  • +0x598 - [1 byte] - last damage (031D)
  • +0x518 - [1 byte] - melee anim 1
  • +0x520 - [1 byte] - melee anim 2
  • +0x52C - [float] - upper torso rotation
  • +0x56C - [10 pointers] - Nearest peds
  • +0x5F4 - [pointer] - wanted level pointer
  • +0x600 - [float] - stamina
  • +0x60C - [1 byte] - current weapon slot again?
  • +0x608 - [float] - sprint distance

 

Speculation:

// WeaponSlot structure
0x10 DWORD unknownWeapon <comment="timestamp">; // always (?) a little less than the global timer; last use?
0x14 FLOAT unknownWeapon; // Only seen on 4temp's saves. 

0x14 - This value looks similar to other small floats - there appears to be a negative/positive relation to the values and int32s looked out of range for a reasonable setting. So far this field is usually blank in saves other than the one provided by 4temp. And slots with a value in this field didn't have any data in the previous "timestamp" field. (not updated)

 

_____________________________________________________

 

Updates:

 

Block 1 - Player Peds; CPed

0x6E0 CHAR[8] skin texture (template case updated)

(probably 7 characters + null terminator)

player  - Steet Outfit
player2 - Raphael's Outfit
player3 - Spandex Outfit
player4 - Golf Outfit
player5 - Cuban Outfit
player6 - Cop Uniform
player7 - "The Job" Outfit
player8 - Casual Outfit
player9 - Collars & Cuffs Outfit
play10  - Black Tracksuit
play11  - Wine Red Tracksuit
play12  - Frankie T-shirt

 

Do player skins applied through cheats, cleo, or other tool persist when saved?

 

0x04 FLOAT _unknown_CMatrix[12]; // looks about right. What's a CMatrix?

0x54 FLOAT unknownFloat; //was unknown dword, looks better as a float


OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#23

Posted 11 June 2015 - 09:22 AM Edited by OrionSR, 11 June 2015 - 10:03 AM.

VC_CPed,bt

 

This 010 template applies to only the CPed structure copied to a new hex file. This strategy allows the use of absolute addresses for offsets, which 010 displays in the Start column, and makes searches within the structure much more practical. I found a few more offsets in the memory documentation topic but I think I've run out of everything I can do without loading up the game and running a few experiments. I'm pretty skeptical of those early flag and immunity bytes. Those values don't look right at all. Or anything near them.

 

There's still a lot of guesswork involved in this process. I've gathered all the easy clues but can't verify anything.

 

How can I get a template like this to operate on a segment of active game memory?

 

Spoiler

 

Is this one of those things that someone has in an IDA reference lying about with all the proper offsets fully documented?


OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#24

Posted 15 June 2015 - 11:41 PM

Vice City Android and iOS Save Compatibility - Initial Report

 

Vice City appears to share the same incompatibility issues as GTA3. Most of the save appears to be identical between versions except:

  • Player Info CPed structure is much different. Working out a conversion will be difficult as little of this fairly large structure has been documented or verified.
  • Object records are 2 bytes shorter on iOS. It appears that all bytes within the object record align correctly, it's just shorter. My hypothesis is that iOS is much less fussy about starting on doubly-even offsets and this is an artifact.

I'm assuming that iOS and Android share identical scripts for Vice City as the first block was the same size in both barebones saves. I'm not sure if I ever found original main.scm files from both versions. It would be wise to finish the investigation so if anyone has these files then please post a link.

 

Thanks for the great saves, btw. You two did a nice job avoiding extraneous things like dropped pickups from working their way into the saves. Both were a really good match and idea for this purpose. Sample saves from various stages of the game for Android and  iOS would be helpful at this point. The garages and player weapon structures look the same but it's hard to tell when everything is empty.

 

I'll try to document the offsets as best I can but my confidence is low on the accuracy some of the documentation and I don't want to propagate misinformation that I can't verify. Currently I'm working with different templates for each version and it's hard to sort out. I'm going to try Samutz's trick of getting version detection and adjustment working within a single template.


gangster2332
  • gangster2332

    wandering encyclopedia

  • BUSTED!
  • Joined: 18 Apr 2015
  • United-Arab-Emirates

#25

Posted 16 June 2015 - 11:02 AM Edited by gangster2332, 16 June 2015 - 11:09 AM.

I'm assuming that iOS and Android share identical scripts for Vice City as the first block was the same size in both barebones saves. I'm not sure if I ever found original main.scm files from both versions. It would be wise to finish the investigation so if anyone has these files then please post a link.

ill upload the main.scm for you :)

main.scm
main_d.scm
main.sc
  • OrionSR likes this

MorsPrincipiumEst
  • MorsPrincipiumEst

    GTA Series Special Vehicle Collector

  • Feroci
  • Joined: 15 Nov 2013
  • United-States
  • The collector [Amazing work on the Special Vehicle Guide!]

#26

Posted 16 June 2015 - 09:42 PM

I don't even know what a main.scm is or where it's located.  All I can find on my iPhone 6 through iExplorer is the Game Saves, VC.set, and things like that.  Never heard of the main.scm files for any of the Mobile Ports...


gangster2332
  • gangster2332

    wandering encyclopedia

  • BUSTED!
  • Joined: 18 Apr 2015
  • United-Arab-Emirates

#27

Posted 17 June 2015 - 05:57 PM

I don't even know what a main.scm is or where it's located.  All I can find on my iPhone 6 through iExplorer is the Game Saves, VC.set, and things like that.  Never heard of the main.scm files for any of the Mobile Ports...


it should be somewhere in the game files

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#28

Posted 17 June 2015 - 07:22 PM

I'm not sure how easy it is to get at the program files on iOS. Isn't that stuff filtered by the default file browser? I think I saw reference to an app that can do a bit more without any need to modify the OS, but this is all too far out of my experience base to offer any practical solution. How does the process work on Android? Aren't the data files stored in a compressed file of some sort?

 

One of the interesting tricks we learned in SA mobile was it was pretty easy to make modifications to many of the data files and implement them in-game by placing them in a particular user folder. The files in the user folder would override the standard files so it was pretty easy to use a custom main.scm (Darkpact on iOS anyone?), IPL files, transfender list, car colors, car groups, and... plenty of interesting things people don't mess with much anymore. I'm not sure how any of this might apply to Vice City yet though.


MorsPrincipiumEst
  • MorsPrincipiumEst

    GTA Series Special Vehicle Collector

  • Feroci
  • Joined: 15 Nov 2013
  • United-States
  • The collector [Amazing work on the Special Vehicle Guide!]

#29

Posted 17 June 2015 - 08:26 PM

When I open iExplorer, there is 4 folders or so within the Game App, but I checked EVERY folder and I don't see anything that has .scm attached to it or anything remotely close...


gangster2332
  • gangster2332

    wandering encyclopedia

  • BUSTED!
  • Joined: 18 Apr 2015
  • United-Arab-Emirates

#30

Posted 17 June 2015 - 10:00 PM

I'm not sure how easy it is to get at the program files on iOS. Isn't that stuff filtered by the default file browser? I think I saw reference to an app that can do a bit more without any need to modify the OS, but this is all too far out of my experience base to offer any practical solution. How does the process work on Android? Aren't the data files stored in a compressed file of some sort?


yeah, you have a big file (and in sa 2) which is always called for big apps (appname).obb (in the case of vice city com.rockstargames.gtavc.obb)
you just rename .obb to .zip and extract main.scm from the data folder ;)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users