Quantcast

Jump to content

» «
Photo

GTA III Save File Documentation

190 replies to this topic
thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#181

Posted 26 August 2015 - 08:51 PM Edited by thehambone, 26 August 2015 - 08:51 PM.

BuildingSwap only allows types 0 to 2 and InvisibilitySetting only allows types 0 to 4. I documented this for VC and haven't fully explored III but they should be equivalent.

Interesting. When I used opcode 0363: toggle_model_render_at to remove the Callahan Bridge barrier (the same opcode used in main.scm), an InvisibilitySetting entry was added with a type of 2. You say that type 4 is an unloaded dynamic object, but I don't think the Callahan Bridge barrier is a dynamic object, unless my understanding of static and dynamic objects is wrong.

spaceeinstein, I was reading your post again and I realized that you said that "InvisibilitySetting only allows types 0 to 4." When I first read it, I thought you said that only types 0 and 4 are allowed. My mistake. :p


My definition of a dynamic object is any object that can change when damaged, like streetlights. When you use the opcode on a streetlight that hasn't been loaded, the type is 4. When you use it on one that has been loaded, the type is 3. Barrier objects are static so type 2 is right.

That's what I thought, but I just wanted to be sure :)


1.) Is there a way to confirm that object handles are constant?

For the sake of simplicity consider a handle as an index the pool of same entities. Objects created in the same order will always have the same handle.

Perfect, thanks Seemann! So, as long as the object loading in main.scm hasn't been modified, it's safe to assume that the object handles in question will remain the same, correct?

OrionSR
  • OrionSR

    Chain Game Development Team

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

#182

Posted 27 August 2015 - 04:09 AM Edited by OrionSR, 30 August 2015 - 03:34 AM.

If you can verify the handles of objects before and after your handleless objects that should be good confirmation. A strategy I suggested for locating the handleless hidden packages in III and VC was to use the index of the pickup just prior to the package array plus 1. I think Samutz just went with a scan routine but the premiss is still valid. These suggestions are out of an abundance of caution.

 

And speaking of caution... If you are going to be making scm style edits with your editor you may want to verify that the script version for that save is appropriate. You wouldn't want to break something like an All-In-On script or custom main. I'd recommend a warning rather than locking out edits though.

  • thehambone 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]

#183

Posted 29 August 2015 - 11:28 AM Edited by Seemann, 29 August 2015 - 12:05 PM.

2.) Does anybody know how forbidden car/ped cubes are stored in the save file? I figure they'd be stored in block 5 (PathFind), but I have no idea how this block is structured. I may need to spend some time mapping out the structure of block 5.

 

I've figured what kind of data block 5 stores:

http://www.gtamoddin...ck_5:_Path_Find

 

There are actually not a single array, but two arrays, one for ped paths, and one for car paths. Each byte is a bitmask, setting values for 8 path nodes. If the bit is set, the node is off, otherwise it's on.

Opcodes 01e8 and 022b disable all path nodes in a cube space (there may be multiple ones).

 

Need to figure out which node is which in that arrays.

  • OrionSR and thehambone like this

OrionSR
  • OrionSR

    Chain Game Development Team

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

#184

Posted 30 August 2015 - 05:03 AM Edited by OrionSR, 30 August 2015 - 05:14 AM.

Ah, now I know what was bugging me about this...

 

Objects that are not part of the initial new game start should not have static handles - unless I'm thinking of "handle" incorrectly. If we are talking about slot indexes then the location of later objects will vary depending on things like how many packages have been collected or peds have been run over as each pickup has an associated object in III and VC.

 

I would think that IPL mods could easily alter the sequence of objects. I can't think of a practical method to test for them either.

 

In SA, initial cargen indexes will vary depending on factors such as a fresh start without loading a previous save or how many gargens are near when a new game is restarted (working hypothesis). My hunch is that this is unlikely to be an issue with objects.


thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#185

Posted 04 November 2015 - 11:40 PM Edited by thehambone, 30 December 2015 - 05:43 PM.

Multiplatform Save File Template
I've constructed a 010 Editor binary template for the GTA III save file that will match files created by the PC, Xbox, Android, and iOS versions of the game. The template will automatically detect which version of the save file you're working with. I derived most of it from Seemann's existing template, but also included new findings by OrionSR, spaceeinstein, and myself. Therefore, I deem this template to be the most up-to-date template available. The PS2 format differs drastically from the rest, so it is not supported in the template at this time.
 
Anyone can contribute to this template via GitHub if they choose, just contact me and I'll give you permission to commit.

https://github.com/t...I_save_multi.bt
  • Seemann, OrionSR and MorsPrincipiumEst like this

spaceeinstein
  • spaceeinstein

    Chocolate

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

#186

Posted 17 January 2016 - 11:52 PM Edited by spaceeinstein, 18 January 2016 - 12:15 AM.

Phone structure is now completely documented.
0x00 float[3] x, y, z coordinates
0x0C dword[6] pointer to phone message string (024B, 024C, 0378, 0379, 037A, 037B, 037C, 037D, 0386, 0387, 0388, 0389)
0x24 dword    game time when phone message ends for states 5 and 6
0x28 dword    object index
0x2C dword    phone state
                3 - no ringing
                4 - ringing, message just once (024C, 0379, 037B, 037D, 0387, 0389)
                5 - ringing, message repeated, phone was never picked up (024B, 0378, 037A, 037C, 0386, 0388)
                6 - ringing, message repeated, phone was picked up before
                7 - no ringing, finished state of state 4
                8 - no ringing, finished state of states 5 and 6
                9 - only ringing
0x30 byte     is player within range of phone
0x31 byte[3]  padding
Check out the articles at GTAModding for more information on the special behaviors of the phone.Surprisingly many of these behaviors carried over to Vice City like the cranes. It is possible to recreate them all there.
  • thehambone likes this

thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#187

Posted 18 January 2016 - 12:31 AM

Nice :^:

 

The template has been updated.


automoto95
  • automoto95

    Player Hater

  • Members
  • Joined: 29 Feb 2016
  • Poland

#188

Posted 30 June 2016 - 02:38 PM

The template looks great! I've been meaning to update the GTAModding page but I've been getting sidetracked. I guess I could do that now. I'm going to follow what space did on VC's save file page and indent the tables.

It seems like the game does care about whether or not the file is 201820 bytes. I tried adding and removing 4 bytes from the end of the file (before the checksum) and updating the block size and checksum accordingly and the game showed a "Slot is corrupted" message. Perhaps Seemann can look in the executable for a definite confirmation.

More updates on 5th vehicle immunity
After some testing on VC, I've concluded that the 5th vehicle immunity is NOT Melee-proof. It took 60 hits with a hammer to make a car catch fire, whether the car had the elusive 5th immunity or not. It seems that, in VC at least, setting the collision-proof immunity on a car makes it melee-proof (technically, melee impacts are collisions). GTAG's opcode database probably only reflects SA's parameters for this particular opcode.
What could this immunity be? I've tried checking pop-proof tires (which is only possible from VC onwards), tip-proof, and heavy. It doesn't seem to be any of these. At this point, I would start to think the immunity is unused, but that wouldn't explain why so many cars have it:

securica,  1 1 0 0 1, Van Heist 
stretch,   1 1 1 1 1, Salvatores Called A Meeting
trash,     1 1 0 0 1, Blow Fish
cheetah,   1 1 1 0 1, Turismo
cheetah,   1 1 1 0 1, Turismo 
cheetah,   1 1 1 0 1, Turismo
rhino,     1 0 0 0 0, Arms Shortage
barracks,  1 0 0 0 0, Arms Shortage
bobcat,    1 1 1 0 1, Evidence Dash
patriot,   1 0 0 0 0, Marked Man
securica,  0 0 1 0 0, Escort Service
"Chopper", 1 1 1 1 1, The Exchange

how to open and edit gta3 save file like that  ? what software i need i am new


spaceeinstein
  • spaceeinstein

    Chocolate

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

#189

Posted 30 June 2016 - 05:29 PM

They use the 010 Editor.

crashoverride93
  • crashoverride93

    Street Cat

  • Members
  • Joined: 25 Jul 2015
  • United-States

#190

Posted 30 January 2017 - 04:45 PM

The template looks great! I've been meaning to update the GTAModding page but I've been getting sidetracked. I guess I could do that now. I'm going to follow what space did on VC's save file page and indent the tables.

It seems like the game does care about whether or not the file is 201820 bytes. I tried adding and removing 4 bytes from the end of the file (before the checksum) and updating the block size and checksum accordingly and the game showed a "Slot is corrupted" message. Perhaps Seemann can look in the executable for a definite confirmation.

More updates on 5th vehicle immunity
After some testing on VC, I've concluded that the 5th vehicle immunity is NOT Melee-proof. It took 60 hits with a hammer to make a car catch fire, whether the car had the elusive 5th immunity or not. It seems that, in VC at least, setting the collision-proof immunity on a car makes it melee-proof (technically, melee impacts are collisions). GTAG's opcode database probably only reflects SA's parameters for this particular opcode.
What could this immunity be? I've tried checking pop-proof tires (which is only possible from VC onwards), tip-proof, and heavy. It doesn't seem to be any of these. At this point, I would start to think the immunity is unused, but that wouldn't explain why so many cars have it:

securica,  1 1 0 0 1, Van Heist 
stretch,   1 1 1 1 1, Salvatores Called A Meeting
trash,     1 1 0 0 1, Blow Fish
cheetah,   1 1 1 0 1, Turismo
cheetah,   1 1 1 0 1, Turismo 
cheetah,   1 1 1 0 1, Turismo
rhino,     1 0 0 0 0, Arms Shortage
barracks,  1 0 0 0 0, Arms Shortage
bobcat,    1 1 1 0 1, Evidence Dash
patriot,   1 0 0 0 0, Marked Man
securica,  0 0 1 0 0, Escort Service
"Chopper", 1 1 1 1 1, The Exchange
how to open and edit gta3 save file like that  ? what software i need i am new

Is it possibly the immune to non player immunity?

thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#191

Posted 30 January 2017 - 09:55 PM

Is it possibly the immune to non player immunity?

I don't think so. Spaceeinstein proivided a pretty good explanation as to what the 5th immunity is supposed to do in this post.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users