Difference between revisions of "Saves (GTA VC)"

From GTAMods Wiki
Jump to navigation Jump to search
(car generator, player info)
(object, set pieces, stuff)
Line 2: Line 2:
 
{{TocRight}}
 
{{TocRight}}
 
This article deals with the format of a '''save game file''' for the PC version of [[GTA Vice City]].
 
This article deals with the format of a '''save game file''' for the PC version of [[GTA Vice City]].
 +
 +
==Location==
 +
By default, the game places its save game files into the folder "GTA Vice City User Files" which is located in the current user's Documents folder. The location of this folder varies depending upon the version of Windows installed.
 +
 +
The save files themselves are named in the format '''GTAVCsfX.b''' where '''X''' represents the in-game slot number. There are 8 slots available in the game (1-8).
  
 
==Format Details==
 
==Format Details==
 +
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. Initial offset here starts four bytes after the start of the block.
 +
 
===Block 0: Miscellaneous and Script===
 
===Block 0: Miscellaneous and Script===
 
{| class="sortable" {{prettytable}}
 
{| class="sortable" {{prettytable}}
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x30
 
| 0x30
Line 167: Line 174:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 186: Line 193:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 213: Line 220:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
<!--
 
<!--
 
|-
 
|-
Line 254: Line 261:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
<!--
 
<!--
Line 282: Line 289:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x34
 
| 0x34
Line 305: Line 312:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| dword
 +
| size of subblock (4 bytes less than block header, constant 0x1EC4)
 +
|-
 +
| 0x04
 +
| -
 +
| start of another set of offset below
 +
|}
 +
{| class="sortable" {{prettytable}}
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 378: Line 398:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 425: Line 445:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 478: Line 498:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| dword
 +
| size of subblock (4 bytes less than block header, constant 0x104)
 +
|-
 +
| 0x04
 +
| -
 +
| start of another set of offset below
 +
|}
 +
{| class="sortable" {{prettytable}}
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 493: Line 526:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x0
 
| 0x0
Line 502: Line 535:
 
| float
 
| float
 
| z angle rotation
 
| z angle rotation
 +
|}
 +
 +
===Block 5: Object Pool===
 +
{| class="sortable" {{prettytable}}
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| dword
 +
| number of objects
 +
|-
 +
| 0x04
 +
| -
 +
| 88 bytes each, object structures (see below)
 +
|}
 +
 +
{| class="sortable" {{prettytable}}
 +
|+ style="text-align: left;"| Object structure:
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| word
 +
| object IDE number
 +
<!--
 +
0x02 - -
 +
-->
 +
|-
 +
| 0x06
 +
| float[3]
 +
| x,y,z coordinates
 +
<!--
 +
0x1E - -
 +
0x22 - -
 +
0x3A - -
 +
0x3B - -
 +
0x3C - -
 +
0x3D - -
 +
0x3E - -
 +
0x3F - -
 +
0x40 - -
 +
0x41 - -
 +
0x42 - -
 +
0x44 - -
 +
0x46 - -
 +
0x4A - -
 +
0x4B - -
 +
0x4C - -
 +
0x50 - -
 +
-->
 
|}
 
|}
  
Line 508: Line 593:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 528: Line 613:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
<!--
 
<!--
 
0x00 - -
 
0x00 - -
Line 579: Line 664:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x0
 
| 0x0
Line 617: Line 702:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
<!--
 
<!--
Line 635: Line 720:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x0
 
| 0x0
Line 650: Line 735:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 706: Line 791:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 724: Line 809:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 772: Line 857:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 787: Line 872:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 817: Line 902:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 842: Line 927:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 899: Line 984:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 917: Line 1,002:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x04
 
| 0x04
Line 938: Line 1,023:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 972: Line 1,057:
 
! Offset
 
! Offset
 
! Type
 
! Type
! width="350px"| Description
+
! width="400px"| Description
 
|-
 
|-
 
| 0x00
 
| 0x00
Line 1,032: Line 1,117:
 
0x6A - -
 
0x6A - -
 
-->
 
-->
 +
|}
 +
 +
===Block 20: Set Pieces===
 +
{| class="sortable" {{prettytable}}
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| dword
 +
| number of trigger zones ([[04F8]])
 +
|-
 +
| 0x04
 +
| [96]
 +
| 56 bytes each, trigger zone structures (see below)
 +
|}
 +
 +
{| class="sortable" {{prettytable}}
 +
|+ style="text-align: left;"| Trigger zone structure:
 +
! Offset
 +
! Type
 +
! width="400px"| Description
 +
|-
 +
| 0x00
 +
| dword
 +
| type
 +
<!--
 +
0x04 - -
 +
-->
 +
|-
 +
| 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
 +
|-
 +
| 0x28
 +
| float[2]
 +
| policeA heading x
 +
|-
 +
| 0x30
 +
| float[2]
 +
| policeB heading x
 
|}
 
|}
  

Revision as of 06:11, 14 September 2010

This article deals with the format of a save game file for the PC version of GTA Vice City.

Location

By default, the game places its save game files into the folder "GTA Vice City User Files" which is located in the current user's Documents folder. The location of this folder varies depending upon the version of Windows installed.

The save files themselves are named in the format GTAVCsfX.b where X represents the in-game slot number. There are 8 slots available in the game (1-8).

Format Details

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. Initial offset here starts four bytes after the start of the block.

Block 0: Miscellaneous and Script

Offset Type Description
0x30 word Year
0x32 word Month
0x34 word Day of week
0x36 word Day
0x38 word Hour
0x3A word Minutes
0x3C word Seconds
0x3E word Milliseconds
0x48 float[3] camera coordinates (x,y,z)
0x54 dword length (ms) of in-game minute (1000=normal)
0x5C dword game hour
0x60 dword game minute
0x6C float game speed (015D)
0x90 dword current weather
0x98 dword current weather table offset (between 0 and 63)
0x9C float current vehicle camera view (between 0.0 and 5.0)
0xA0 float current on foot camera view (classic controls only)
0xA4 dword current interior (04BB)
0xA8 dword taxi boost jump (0572)
0xB0 dword sky color (04F9)
0xB4 dword sky atmosphere (0=normal,1=interior)
0xB8 float sky atmosphere blue overlay (between 0.0 and 1.0)
0xE4 dword size of script block
0xE8 - start of script block, see below
Script and subblock A:
Offset Type Description
0x00 string SCR
0x04 dword size of subblock A
0x08 - start of subblock A: global variables - each variable is 4 bytes long
Subblock B:
Offset Type Description
0x00 dword size of subblock B
0x238 - misc., see below
Offset Type Description
0x01 byte kaufman cabs radio (0551)
0x04 dword size of main
0x08 dword size of largest mission
0x0C dword number of missions

Subblock C:

Block 1: Ped Pool

Ped structure:
Offset Type Description
0x0A - ped structure, see below
0x6E2 dword max wanted level
0x6E6 dword max criminal points, in tandem with max wanted level
Ped structure:
Offset Type Description
0x34 float[3] x,y,z coordinates
0xB8 float weight
0x354 float health
0x358 float armor

Block 2: Garages

Offset Type Description
0x00 dword size of subblock (4 bytes less than block header, constant 0x1EC4)
0x04 - start of another set of offset below
Offset Type Description
0x00 dword number of garages (0219)
0x04 dword free bombs (0=not,1=yes)
0x08 dword free respray (0335)
0x18 dword garage type 8 status, see below
0x1C dword garage type 9 status
0x20 dword garage type 10 status
0x24 dword garage type 22 status
0x2C [48] 40 bytes each, garage car structures (see below)
0x7AC [32] 168 bytes each, garage structures (see below)

Export garage status (binary format):

  • 0b000001=car 1 collected
  • 0b000010=car 2 collected
  • 0b000100=car 3 collected
  • 0b001000=car 4 collected
  • 0b010000=car 5 collected
  • 0b100000=car 6 collected

Add them up to set the garage as car already collected:

0b000011, cars 1 and 2 collected
0b100011, cars 1, 2, and 6 are collected
Garage car structure:
Offset Type Description
0x00 dword model ID
0x04 float[3] x,y,z position
0x10 float[3] x,y,z vector rotation
0x1C dword immunities
0x20 byte primary color
0x21 byte secondary color
0x22 byte current radio station
0x23 byte variation 1
0x24 byte variation 2
0x25 byte bomb type
Garage structure:
Offset Type Description
0x00 byte type
0x01 byte door status (0=closed,1=opened,2=closing,3=opening)
0x02 byte max number of cars to store (4=default)
0x19 byte swing door (03BB)
0x1A byte camera follow player (03DA)
0x1C float[3] entrance bottom left x,y,z coordinates
0x28 float[4] rx,ry,rz,rw quaternion rotation
0x38 float ceiling z coordinate

Block 3: Game Logic

Offset Type Description
0x00 dword size of subblock (4 bytes less than block header, constant 0x104)
0x04 - start of another set of offset below
Offset Type Description
0x00 dword number of restart taxis (058D)
0x04 [16] 16 bytes each, restart taxi structures (see below)
Restart taxi structure:
Offset Type Description
0x0 float[3] x,y,z coordinates
0xC float z angle rotation

Block 5: Object Pool

Offset Type Description
0x00 dword number of objects
0x04 - 88 bytes each, object structures (see below)
Object structure:
Offset Type Description
0x00 word object IDE number
0x06 float[3] x,y,z coordinates

Block 7: Cranes

Offset Type Description
0x00 dword number of cranes
0x08 [8] 124 bytes each, crane structures (see below)
Crane structure:
Offset Type Description
0x40 float current z rotation

Block 8: Pickups

Pickup structure, each is 0x34 in size:
Offset Type Description
0x0 float[3] x,y,z coordinates
0x18 dword ammo or asset revenue
0x2E byte type
0x2F byte has been picked up

Block 9: Phone Info

Offset Type Description
0x04 dword number of phones
0x08 [50] 52 bytes each, phone structures (see below)
Phone structure:
Offset Type Description
0x0 float[3] x,y,z coordinates
0x2C dword phone status (3=idle,9=ringing,others=leftover GTA III stuff)

Block 10: Restart Points Buffer

Offset Type Description
0x00 string RST
0x8 float[3] hospital x,y,z coordinates (016C)
0x14 float hospital z angle
Each point is 0x8 in size
0x88 float[3] police x,y,z coordinates (016D)
0x94 float police z angle
Each point is 0x8 in size
0x110 float[3] override x,y,z coordinates (016E)
0x11C float override z angle

Block 11: Radar Blips Buffer

Offset Type Description
0x00 string RDR
0x08 [75] 48 bytes each, blip structures (see below)
Blip structure:
Offset Type Description
0x00 dword color
0x10 float[2] x,y coordinates
0x18 float[3] x,y,z coordinates
0x26 byte brightness (0166)
0x2A word size (0168)
0x2C word show (018B)
0x2E word type

Block 13: All Gang Data

Offset Type Description
0x00 string GNG
0x04 [9] 24 bytes each, gang structures (see below)
Gang structure:
Offset Type Description
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: All Car Generators

Offset Type Description
0x00 string CGN
0x1C [185] 44 bytes each, car generator structures (see below)
Car generator structure:
Offset Type Description
0x00 dword model ID
0x04 float[3] x,y,z coordinates
0x10 float z angle rotation
0x14 word primary color
0x16 word secondary color
0x18 byte force spawn
0x19 byte alarm
0x1A byte lock
0x28 word 014C
0x2A byte has recently been stolen

Block 16: All Audio Script Objects

Offset Type Description
0x00 string AUD
0x12 - 24 bytes each, audio structures (see below)
Audio structure:
Offset Type Description
0x04 word ID number
0x08 float[3] x,y,z coordinates

Block 17: Script Paths

Offset Type Description
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

Offset Type Description
0x00 dword current money
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 20: Set Pieces

Offset Type Description
0x00 dword number of trigger zones (04F8)
0x04 [96] 56 bytes each, trigger zone structures (see below)
Trigger zone structure:
Offset Type Description
0x00 dword type
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
0x28 float[2] policeA heading x
0x30 float[2] policeB heading x

See also

External links