spaceeinstein Posted August 21, 2010 Share Posted August 21, 2010 (edited) 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. 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 Vars0x00 dword size of block 00x04 - 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 Pool0x0000 dword size of block 10x0004 - 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: Garages0x0000 dword size of block 20x0004 - 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 Logic0x0000 dword size of block 30x0004 - 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 Pool0x0000 dword size of block 40x0004 - 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 Pool0x00 dword size of block 50x04 - 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: Cranes0x00 dword size of block 70x04 - 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: Pickups0x0000 dword size of block 80x0004 - 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 Info0x0000 dword size of block 90x0004 - 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 Blips0x0000 dword size of block 110x0004 - 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: Zones0x0000 dword size of block 120x0004 - 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: Gangs0x00 dword size of block 130x04 - 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 Generators0x0000 dword size of block 140x0004 - 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: Particles0x00 dword size of block 150x04 - start of block 15, data below 0x00 dword size of subblock 0x04 - start of subblock Block 16: Audio Script Objects0x00 dword size of block 160x04 - 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 Paths0x00 dword size of block 170x04 - 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 Info0x00 dword size of block 180x04 - 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: Stats0x00 dword size of block 190x04 - 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 Pieces0x00 dword size of block 200x04 - 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: Streaming0x00 dword size of block 210x04 - 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 Types0x00 dword size of block 220x04 - 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 Savefile Editor GTAModding.com article, pool everything here! Edited July 31, 2016 by spaceeinstein Link to comment Share on other sites More sharing options...
Narcis_speed6 Posted August 21, 2010 Share Posted August 21, 2010 this is helpful, should probably go into tutorials section Link to comment Share on other sites More sharing options...
Seemann Posted August 23, 2010 Share Posted August 23, 2010 space, I remember how I enjoyed exploring the GTA SA Saves format, so wish you good luck with this stuff Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
spaceeinstein Posted August 23, 2010 Author Share Posted August 23, 2010 Thanks 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. Link to comment Share on other sites More sharing options...
Seemann Posted January 11, 2015 Share Posted January 11, 2015 (edited) 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 each0x198 [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.. Edited January 11, 2015 by Seemann thehambone 1 Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
Silent Posted January 11, 2015 Share Posted January 11, 2015 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. Link to comment Share on other sites More sharing options...
TJGM Posted January 11, 2015 Share Posted January 11, 2015 (edited) 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. Edited January 11, 2015 by TJGM Seemann 1 Link to comment Share on other sites More sharing options...
Silent Posted January 11, 2015 Share Posted January 11, 2015 Um, why are some blocks completely missing from gtamodding? These are Block 4 - Vehicle PoolBlock 6 - Path FindBlock 15 - Particle ObjectsBlcok 21 - StreamingBlcok 22 - Ped TypesBlock 23 - PlanesI 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. Link to comment Share on other sites More sharing options...
OrionSR Posted January 11, 2015 Share Posted January 11, 2015 (edited) 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. Edited January 11, 2015 by OrionSR Link to comment Share on other sites More sharing options...
spaceeinstein Posted January 11, 2015 Author Share Posted January 11, 2015 (edited) 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! Edited January 11, 2015 by spaceeinstein thehambone 1 Link to comment Share on other sites More sharing options...
spaceeinstein Posted January 12, 2015 Author Share Posted January 12, 2015 (edited) 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. Edited January 12, 2015 by spaceeinstein Silent and thehambone 2 Link to comment Share on other sites More sharing options...
OrionSR Posted January 13, 2015 Share Posted January 13, 2015 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. Link to comment Share on other sites More sharing options...
spaceeinstein Posted January 13, 2015 Author Share Posted January 13, 2015 (edited) 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 Edited January 14, 2015 by spaceeinstein Link to comment Share on other sites More sharing options...
OrionSR Posted May 31, 2015 Share Posted May 31, 2015 (edited) 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 file0A 01 0C 00 // No Escape? - $1288 at offset +0x1420 (+5152) from start of global variable spaceFloat_X Float_Y Float_Z asset_float object_pool det_grenade ammo_asset timestamp asset model count char[8]? PT PU F0 F1 F2 F300 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 0000 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 value0x10 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 dword0x20 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 nulls0x2E 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. Edited May 31, 2015 by OrionSR Link to comment Share on other sites More sharing options...
ThirteenAG Posted May 31, 2015 Share Posted May 31, 2015 Pickup structure was in Alien's idb for a while now: 00000000 CPickup struc ; (sizeof=0x34) ; XREF: .bss:_pickupsr00000000 pos RwV3d ?0000000C fStandProximity dd ? ; //how close the player is standing to the pickup?00000010 object dd ? ; //entity associated with the pickup00000014 pExtraObject dd ? ; //extra entity (for minigun for example)00000018 dwPickupQuantity dd ? ; //used for weapons and money0000001C regenerationTime dd ? ; //either the time it was created or when it should disappear00000020 wMoneyGenerationRate dw ? ; //how quickly this pickup generates money00000022 wModelId dw ?00000024 wUniqueId dw ? ; //unique identifier of this pickup00000026 szPickupTextKey db 8 dup(?)0000002E type db ?0000002F byteRemoved db ? ; //pickup has been removed00000030 db ? ; undefined00000031 db ? ; undefined00000032 db ? ; undefined00000033 field_33 db ?00000034 CPickup ends00000034 Seemann 1 Widescreen Fixes Pack || Project2DFX || SaveLoader || WindowedMode || CLEO Scripts Link to comment Share on other sites More sharing options...
Seemann Posted May 31, 2015 Share Posted May 31, 2015 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. Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
ThirteenAG Posted June 1, 2015 Share Posted June 1, 2015 Try this one, it should be a backup of Alien's idb, don't remember exactly and can't check right now. Widescreen Fixes Pack || Project2DFX || SaveLoader || WindowedMode || CLEO Scripts Link to comment Share on other sites More sharing options...
Seemann Posted June 1, 2015 Share Posted June 1, 2015 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. Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
OrionSR Posted June 3, 2015 Share Posted June 3, 2015 (edited) Block 22: Pedtype 0x00 dword size of block0x04 - start of block, data below 0x00 dword size of subblock0x04 - 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 ID0x04 float - Float1/500x08 float - Float2/500x0C float - Float3/500x10 float - Float40x14 float - Float5*0x18 dword - Threat Flags0x1C dword - Avoid Flags Threat/Avoid Flags Threat/Avoid Flags Bit ID Threat** Avoid**pedtype 0 Player1 1 bit 00 01 00 00 00 00 00 00 00 00 00 00 00pedtype 1 Player2 2 bit 01 02 00 00 00 00 00 00 00 00 00 00 00pedtype 2 Player3 4 bit 02 04 00 00 00 00 00 00 00 00 00 00 00pedtype 3 Player4 8 bit 03 08 00 00 00 00 00 00 00 00 00 00 00pedtype 4 CivMale 16 bit 04 10 00 00 00 00 00 90 02 FF FF 0C 00pedtype 5 CivFemale 32 bit 05 20 00 00 00 00 00 90 02 FF FF 0C 00pedtype 6 Cop 64 bit 06 40 00 00 00 00 00 90 02 70 00 00 00pedtype 7 Gang1 128 bit 07 80 00 00 00 00 FF 90 00 80 00 00 00 pedtype 8 Gang2 256 bit 08 00 01 00 00 80 FE 90 00 00 01 00 00pedtype 9 Gang3 512 bit 09 00 02 00 00 80 FD 90 00 00 02 00 00pedtype 10 Gang4 1024 bit 10 00 04 00 00 80 FB 90 00 00 04 00 00pedtype 11 Gang5 2048 bit 11 00 08 00 00 80 F7 90 00 00 08 00 00pedtype 12 Gang6 4096 bit 12 00 10 00 00 80 EF 90 00 00 10 00 00pedtype 13 Gang7 8192 bit 13 00 20 00 00 80 DF 90 00 00 20 00 00pedtype 14 Gang8 16384 bit 14 00 40 00 00 80 BF 90 00 00 40 00 00pedtype 15 Gang9 32768 bit 15 00 80 00 00 80 7F 90 00 00 80 00 00pedtype 16 Emergency 65536 bit 16 00 00 01 00 00 00 80 00 70 00 00 00pedtype 17 Prostitute 131072 bit 17 00 00 02 00 00 00 90 02 C0 FF 00 00pedtype 18 Criminal 262144 bit 18 00 00 04 00 40 00 B0 00 C0 FF 00 00pedtype 19 Special 524288 bit 19 00 00 08 00 00 00 00 00 00 00 00 00 Additional Threats Gun 1048576 bit 20 00 00 10 00 CopCar 2097152 bit 21 00 00 20 00 mHitTheCourier 4194304 bit 22 00 00 40 00 Explosion 8388608 bit 23 00 00 80 00 mVigilante 16777216 bit 24 00 00 00 01 DeadPeds 33554432 bit 25 00 00 00 02 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. Bit Float1/50 Float2/50 Float3/50 Float4 Float5 Threat Avoidbit 00 01 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 00 00 00 00 70 41 00 00 00 00 00 00 00 00bit 01 02 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 00 00 00 00 70 41 00 00 00 00 00 00 00 00bit 02 04 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 00 00 00 00 70 41 00 00 00 00 00 00 00 00bit 03 08 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 00 00 00 00 70 41 00 00 00 00 00 00 00 00bit 04 10 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 00 00 90 02 FF FF 0C 00bit 05 20 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 00 00 90 02 FF FF 0C 00bit 06 40 00 00 00 0A D7 23 3D 0A D7 23 3D 0A D7 23 3D 00 00 A0 41 00 00 F0 40 00 00 90 02 70 00 00 00bit 07 80 00 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 00 FF 90 00 80 00 00 00bit 08 00 01 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 FE 90 00 00 01 00 00bit 09 00 02 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 FD 90 00 00 02 00 00bit 10 00 04 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 FB 90 00 00 04 00 00bit 11 00 08 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 F7 90 00 00 08 00 00bit 12 00 10 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 EF 90 00 00 10 00 00bit 13 00 20 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 DF 90 00 00 20 00 00bit 14 00 40 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 BF 90 00 00 40 00 00bit 15 00 80 00 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 80 7F 90 00 00 80 00 00bit 16 00 00 01 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 A0 41 00 00 F0 40 00 00 80 00 70 00 00 00bit 00 01 00 00 00 00 00 00 00 00 00 00 00 02 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00bit 18 00 00 04 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 40 00 B0 00 C0 FF 00 00bit 00 01 00 00 00 00 00 00 00 00 00 00 00 64 41 1A 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00bit 17 00 00 02 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 00 00 90 02 C0 FF 00 00bit 19 00 00 08 00 0A D7 23 3D 8F C2 F5 3D 8F C2 F5 3D 00 00 88 41 00 00 F0 40 00 00 00 00 00 00 00 00bit 00 01 00 00 00 00 00 00 00 00 00 00 00 EF 91 04 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PED.DAT (PS2) PLAYER1 2.0 6.0 6.0 0.0 15.0PLAYER2 2.0 6.0 6.0 0.0 15.0PLAYER3 2.0 6.0 6.0 0.0 15.0PLAYER4 2.0 6.0 6.0 0.0 15.0SPECIAL 2.0 6.0 6.0 17.0 7.5CIVMALE 2.0 6.0 6.0 17.0 7.5 Threat GUN EXPLOSION DEADPEDS Avoid PLAYER1 PLAYER2 PLAYER3 PLAYER4 CIVMALE CIVFEMALE COP GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 CRIMINAL SPECIALCIVFEMALE 2.0 6.0 6.0 17.0 7.5 Threat GUN EXPLOSION DEADPEDS Avoid PLAYER1 PLAYER2 PLAYER3 PLAYER4 CIVMALE CIVFEMALE COP GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 CRIMINAL SPECIALCOP 2.0 2.0 2.0 20.0 7.5 Threat GUN EXPLOSION DEADPEDS Avoid CIVMALE CIVFEMALE COPGANG1 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG1GANG2 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG2GANG3 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG3GANG4 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG5 GANG6 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG4GANG5 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG4 GANG6 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG5GANG6 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG4 GANG5 GANG7 GANG8 GANG9 EXPLOSION Avoid GANG6GANG7 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG8 GANG9 EXPLOSION Avoid GANG7GANG8 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG9 EXPLOSION Avoid GANG8GANG9 2.0 6.0 6.0 17.0 7.5 Threat GUN GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 EXPLOSION Avoid GANG9EMERGENCY 2.0 6.0 6.0 20.0 7.5 Threat EXPLOSION Avoid CIVMALE CIVFEMALE COPCRIMINAL 2.0 6.0 6.0 17.0 7.5 Threat GUN COP COP_CAR EXPLOSION Avoid COP GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9PROSTITUTE 2.0 6.0 6.0 17.0 7.5 Threat GUN EXPLOSION DEADPEDS Avoid COP GANG1 GANG2 GANG3 GANG4 GANG5 GANG6 GANG7 GANG8 GANG9 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 NewGame NobodyLikesMe FightFightFight00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 0000 00 90 02 01 00 90 02 FF FF 0F 0000 00 90 02 01 00 90 02 FF FF 0F 0000 00 90 02 01 00 90 02 FF FF 0F 0000 FF 90 00 01 FF 90 00 FF FF 0F 0080 FE 90 00 81 FE 90 00 FF FF 0F 0080 FD 90 00 81 FD 90 00 FF FF 0F 0080 FB 90 00 81 FB 90 00 FF FF 0F 0080 F7 90 00 81 F7 90 00 FF FF 0F 0080 EF 90 00 81 EF 90 00 FF FF 0F 0080 DF 90 00 81 DF 90 00 FF FF 0F 0080 BF 90 00 81 BF 90 00 FF FF 0F 0080 7F 90 00 81 7F 90 00 FF FF 0F 0000 00 80 00 01 00 80 00 FF FF 0F 0000 00 00 00 01 00 00 00 FF FF 0F 0040 00 B0 00 41 00 B0 00 FF FF 0F 0000 00 00 00 01 00 00 00 FF FF 0F 0000 00 90 02 01 00 90 02 FF FF 0F 0000 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 Gang Table for Reference Gang ID GangName PedType/bit Ped.dat ThreatGang 0 Cubans pedtype 7 Gang1 128Gang 1 Haitians pedtype 8 Gang2 256Gang 2 Wannabees pedtype 9 Gang3 512Gang 3 Columbians pedtype 10 Gang4 1024Gang 4 RentaCops pedtype 11 Gang5 2048Gang 5 Bikers pedtype 12 Gang6 4096Gang 6 Vercetti pedtype 13 Gang7 8192Gang 7 Golfers pedtype 14 Gang8 16384Gang 8 Army pedtype 15 Gang9 32768 Edited June 4, 2015 by OrionSR phob0s 1 Link to comment Share on other sites More sharing options...
OrionSR Posted June 9, 2015 Share Posted June 9, 2015 (edited) 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. Edited June 9, 2015 by OrionSR Lethal Vaccine and thehambone 2 Link to comment Share on other sites More sharing options...
gangster2332 Posted June 9, 2015 Share Posted June 9, 2015 (edited) 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) Edited June 9, 2015 by gangster2332 OrionSR 1 Link to comment Share on other sites More sharing options...
OrionSR Posted June 10, 2015 Share Posted June 10, 2015 (edited) 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. // block 1 - Player Peds /* Skipping this one for now because the wiki docs don't match up with my observations or even the health/armor offsets I'm using for GTASnP.com. */ case 1: struct Player_Peds { local int block_start = FTell(); DWORD block_size; struct { DWORD block_size; struct { DWORD playerCount ; DWORD unknownDword; WORD unknownWord; DWORD unknown_pedref; struct { DWORD unknown_vtbl; struct { BYTE _unknown_CMatrix[48]; } unknown_CMatrix; RwV3D playerCoords; struct { BYTE unknown[12]; } unknownBytes; DWORD unknown_rwObject; BYTE unknown_flags; BYTE unknown_type; BYTE unknown_ImmunityEx <comment="2=explosion">; BYTE unknown_ImmunityBF <comment="2=bullet, 4=fire">; DWORD unknownDword; WORD unknown_scanCode; struct { BYTE unknown[2]; } unknownBytes; WORD unknown_modelIndex; BYTE unknown_buildingIsland; BYTE unknown_interior; struct { BYTE unknown[12]; } unknownBytes; DWORD lastCollisionTime; FLOAT moveSpeed[3]; FLOAT turnSpeed[3]; struct { BYTE unknown[48]; } unknownBytes; FLOAT weight; struct { BYTE unknown[42]; } unknownBytes; BYTE onGround; struct { BYTE unknown[90]; } unknownBytes; BYTE unknown_fastReloadAnim; struct { BYTE unknown[10]; } unknownBytes; BYTE unknown_shootingAnim; BYTE unknown_jumpingAnim; BYTE unknownAnim[2]; BYTE unknown_crouchAnim; struct { BYTE unknown[163]; } unknownBytes; BYTE unknown_subAnim; struct { BYTE unknown[79]; } unknownBytes; BYTE playerStatus; struct { BYTE unknown[7]; } unknownBytes; BYTE walking; struct { BYTE unknown[263]; } unknownBytes; FLOAT health; FLOAT armor; struct { BYTE unknown[28]; } unknownBytes; FLOAT unknown_rotation; struct { BYTE unknown[40]; } unknownBytes; BYTE unknown_targetObjective; struct { BYTE unknown[3]; } unknownBytes; DWORD pLastVehicle <comment="pointer">; BYTE unknown_inVehicle; struct { BYTE unknown[91]; } unknownBytes; struct { DWORD weaponID; DWORD unknownStatus; DWORD clipAmmo; DWORD weaponAmmo; DWORD unknownWeapon; DWORD unknownWeapon; } weaponslots[10]; struct { BYTE unknown[12]; } unknownBytes; BYTE currentWeaponSlot; struct { BYTE unknown[19]; } unknownBytes; BYTE unknown_meleeAnim1; struct { BYTE unknown[7]; } unknownBytes; BYTE unknown_meleeAnim2; struct { BYTE unknown[11]; } unknownBytes; FLOAT unknown_torsoRotation; struct { BYTE unknown[60]; } unknownBytes; DWORD pNearestPeds[10] <comment="pointer">; struct { BYTE unknown[4]; } unknownBytes; BYTE unknown_lastDamage; struct { BYTE unknown[91]; } unknownBytes; DWORD pWantedLevel <comment="pointer">; struct { BYTE unknown[8]; } unknownBytes; FLOAT stamina; FLOAT staminaAgain; FLOAT unknown_sprintDistance; BYTE weaponSlotAgain; struct { BYTE unknown[43]; } unknownBytes; FLOAT unknown_drunkVisuals; struct { BYTE unknown[156]; } unknownBytes; DWORD maxWantedLevel; DWORD maxCriminalPoints; CHAR skinTexture[8]; struct { BYTE unknown14[14]; } unknownBytes; } CPed; } datablock; } subblock; FSeek(block_start+block_size+4); } block <comment="incomplete">; break; 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 structure0x10 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 Outfitplayer2 - Raphael's Outfitplayer3 - Spandex Outfitplayer4 - Golf Outfitplayer5 - Cuban Outfitplayer6 - Cop Uniformplayer7 - "The Job" Outfitplayer8 - Casual Outfitplayer9 - Collars & Cuffs Outfitplay10 - Black Tracksuitplay11 - Wine Red Tracksuitplay12 - 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 Edited June 10, 2015 by OrionSR Link to comment Share on other sites More sharing options...
OrionSR Posted June 11, 2015 Share Posted June 11, 2015 (edited) 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? //--------------------------------------//--- 010 Editor v6.0.1 Binary Template//// Author: Samutz// Edited by OrionSR// Purpose: translation from http://www.gtamodding.com/wiki/Saves_(GTA_VC)// Last edit: 10 June 2015//--------------------------------------// Standard coordinate structtypedef struct RwV3D { FLOAT X, Y, Z;}; struct { DWORD unknown_vtbl; RwV3D cam_roll_xyz; DWORD unknown_CMatrix; RwV3D cam_direction_xyz; DWORD unknown_CMatrix; RwV3D cam_was_xyz; DWORD unknown_CMatrix; RwV3D playerCoords; DWORD unknown_playerCoords; struct { BYTE unknown[8]; } unknownBytes; DWORD unknown_rwObject; BYTE unknown_flags; BYTE unknown_type; BYTE unknown_ImmunityEx <comment="2=explosion">; // doubtful BYTE unknown_ImmunityBF <comment="2=bullet, 4=fire">; // doubtful FLOAT unknownFloat; WORD unknown_scanCode; struct { BYTE unknown[2]; } unknownBytes; WORD unknown_modelIndex; BYTE unknown_buildingIsland; BYTE unknown_interior; struct { BYTE unknown[12]; } unknownBytes; DWORD lastCollisionTime; FLOAT moveSpeed[3]; FLOAT turnSpeed[3]; struct { BYTE unknown[48]; } unknownBytes; FLOAT weight; struct { BYTE unknown[42]; } unknownBytes; BYTE onGround; struct { BYTE unknown[90]; } unknownBytes; BYTE fastReloadAnim; struct { BYTE unknown[10]; } unknownBytes; BYTE shootingAnim; BYTE jumpingAnim; BYTE unknownAnim[2]; BYTE crouchAnim; struct { BYTE unknown[163]; } unknownBytes; BYTE subAnim; struct { BYTE unknown[79]; } unknownBytes; BYTE playerStatus; struct { BYTE unknown[7]; } unknownBytes; BYTE walking; struct { BYTE unknown[15]; } unknownBytes; DWORD unknownTimer; struct { BYTE unknown[244]; } unknownBytes; FLOAT health; FLOAT armor; struct { BYTE unknown[28]; } unknownBytes; FLOAT rotation; struct { BYTE unknown[40]; } unknownBytes; BYTE targetObjective; struct { BYTE unknown[3]; } unknownBytes; DWORD pLastVehicle; BYTE inVehicle; struct { BYTE unknown[91]; } unknownBytes; struct { DWORD weaponID; DWORD WeaponState; DWORD clipAmmo; DWORD weaponAmmo; DWORD LastShotTime; BYTE WepCamMode; BYTE align[3]; } weaponslots[10]; struct { BYTE unknown[12]; } unknownBytes; BYTE currentWeaponIcon; struct { BYTE unknown[19]; } unknownBytes; BYTE meleeAnim1; struct { BYTE unknown[7]; } unknownBytes; BYTE meleeAnim2; struct { BYTE unknown[7]; } unknownBytes; DWORD pTouchedEntity; FLOAT torsoRotation; struct { BYTE unknown[60]; } unknownBytes; DWORD nearestPeds[10]; BYTE pedsLoaded; struct { BYTE unknown[3]; } unknownBytes; BYTE lastDamage; struct { BYTE unknown[55]; } unknownBytes; DWORD unknownTimer; DWORD unknownTimer; struct { BYTE unknown[28]; } unknownBytes; DWORD pWantedLevel; struct { BYTE unknown[8]; } unknownBytes; FLOAT currentStamina; FLOAT maxStamina; // unverified FLOAT sprintDistance; BYTE currentWeaponSlot; struct { BYTE unknown[3]; } unknownBytes; DWORD unknownTimer; struct { BYTE unknown[32]; } unknownBytes; DWORD adrenalineTimer; FLOAT drunkVisuals; BYTE adrenalineMode; struct { BYTE unknown[151]; } unknownBytes; DWORD coachCounter; DWORD maxWantedLevel; DWORD maxCriminalPoints; CHAR skinTexture[8]; struct { BYTE unknown[14]; } unknownBytes; } CPed; Is this one of those things that someone has in an IDA reference lying about with all the proper offsets fully documented? Edited June 11, 2015 by OrionSR Link to comment Share on other sites More sharing options...
OrionSR Posted June 15, 2015 Share Posted June 15, 2015 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. Link to comment Share on other sites More sharing options...
gangster2332 Posted June 16, 2015 Share Posted June 16, 2015 (edited) 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 Edited June 16, 2015 by gangster2332 OrionSR 1 Link to comment Share on other sites More sharing options...
Lethal Vaccine Posted June 16, 2015 Share Posted June 16, 2015 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... Link to comment Share on other sites More sharing options...
gangster2332 Posted June 17, 2015 Share Posted June 17, 2015 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 Link to comment Share on other sites More sharing options...
OrionSR Posted June 17, 2015 Share Posted June 17, 2015 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. Link to comment Share on other sites More sharing options...
Lethal Vaccine Posted June 17, 2015 Share Posted June 17, 2015 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... Link to comment Share on other sites More sharing options...
gangster2332 Posted June 17, 2015 Share Posted June 17, 2015 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now