Author Topic: FF7 Save File Mapping... Qhimm/Others?  (Read 7060 times)

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« on: 2004-07-15 00:11:20 »
I'd be interested to know if the FF7 save files have been documented any further than Qhimm's latest Jenova release (0.3.1) or whether it's been done and just not been updated yet. I ask because I've been doing a bit of digging into the "unknowns" described in Qhimm's Jenova source and found a few things, and would like to keep going but don't know if it's already been done.

Here's some things I've found out how to adjust by editing Qhimm's save file structure (changing the "unknowns") and editing the save file:

- The purpose of _UNKNOWN z_1[6] - extra strength, vitality etc. points added on solely by Power Source, Guard Source etc.
- Turning on and off the visibility and locking of menu items (Item, Magic, enable PHS in Midgar etc)
- Chocobos in the pen outside the chocobo farm, including the value to produce the 'quality' of each chocobo
- Various chocobo related dialogs/behaviour of Choco Billy
- Whether the helpers (arrows/finger) are on/off
- Turning the submarine on and off, and also the position/heading of the sub on the map
- Turning the Highwind on and off, and it's position/heading
- Adjusting the position/heading of Cloud on the world map
- Displaying World map/vehicle instructions
- World map camera and map display type
- Turning on rain in field screens (a nifty effect, can't remember where it's actually used!)
- The visibility and locking of characters on the PHS screen (so you can add/remove characters from the PHS, and also unlock Cloud (or anyone else) so you can move him in/out at any point)
- A few "game states" - by these I mean if you do one important action then resave, the value changes so it knows exactly what you've done so far (eg give Mythril to the guy in the workshop, value changes to reflect this).

I also got different locations for the number of battles fought, which seems to me to be in a different "unknown", and also the current location of the character on the world map, which I found in another unknown.

So is there any point in carrying on or has this all been done?  :)

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #1 on: 2004-07-15 00:20:33 »
And there are some values that really shouldn't be messed with:  :)



I even managed to turn Cloud into a piece of Rocket Town and walk around the map.  :-?

Terence Fergusson

  • *
  • Posts: 262
    • View Profile
FF7 Save File Mapping... Qhimm/Others?
« Reply #2 on: 2004-07-15 00:22:13 »
It's not exactly already done (but some of the things like sources *WERE* known), but a lot of the unknowns (especially plot unknowns) are going to be mapped in the near future without requiring so much gruntwork now that we have a script dumper.  (For example, I have a large majority of the Fort Condor and Bone Village variables, simply from being able to see their scripts)

So, you'd probably want to leave off most script/plot/minigame-related stuff until we've gone through the script, at a guess.

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #3 on: 2004-07-15 00:26:11 »
I realised a fair number of the unknowns must have been plot related and hadn't planned to go through the entire thing scribbling down the values for every change.  :) But I think there are a surprising number of things that aren't plot related that are left to do. I'd like to get the vehicles sorted ideally but positioning them on the world map (as with Cloud) is a real pain.

I wonder, what purpose does holding the added stats seperately to 'base' stats serve?

Terence Fergusson

  • *
  • Posts: 262
    • View Profile
FF7 Save File Mapping... Qhimm/Others?
« Reply #4 on: 2004-07-15 00:27:57 »
Level ups, for one thing, need to know your base stats without sources.  And base stats can't progress past 100 from sheer levelling.

And I said minigame and scripting as well; if it's altered in a scene, we can generally find it.  The World Map is kinda off-limits to the script dumper at the moment though, so stuff there is worth picking through.

Cyberman

  • *
  • Posts: 1572
    • View Profile
FF7 Save File Mapping... Qhimm/Others?
« Reply #5 on: 2004-07-16 15:25:25 »
Ahh cool beans, I've never monkeyed with the unknown values, I should add 'unknown' hex editing so I can find out myself. DUH :)

Did the game correct Rocket Town/Cloud if you resaved the game afterword?

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #6 on: 2004-07-16 17:30:49 »
I'm putting the save map into gears right now. Because the scripting language directly writes to this map, it should be pretty easy to fill in the blanks.

Cyberman

  • *
  • Posts: 1572
    • View Profile
FF7 Save File Mapping... Qhimm/Others?
« Reply #7 on: 2004-07-16 21:52:22 »
Quote from: halkun
I'm putting the save map into gears right now. Because the scripting language directly writes to this map, it should be pretty easy to fill in the blanks.


That's an important point.  I wonder how similar FF7's script engine is to FF8 and FF9's.

It might be interesting to see if animations are precanned then played back via the script as well. (IE standing gesticulation etc.)

Too much mind can't take more (pop), I feel better now. :roll:

I try to do too many things at once, that's my problem.

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #8 on: 2004-07-17 13:40:43 »
Everything so far documented about the save map is now in Gears. If you want, fill in the blanks and I'll put them in the correct spot. I did have some problems, some of the Jenova source was hard to read and I don't know if I have the addresses correct or not.

Also, This shoulld also serve as a map for the scripting globals. This needs to be split up into each of the 256 byte banks thats access with the scripting field scripting language.

Anyway, the save map is in Gears in the "Menu" section on page 12 (That is, until I write more above it) It's accessable with my WWW button at the bottom. I can't post the save map here because it extesively uses tables and I loose my formatting.

Let me know if you guys find anything and also let me know where my addresses are messed up at, thanks!

Let me know if there is anything I need to expand on....

(WOW 144 pages in Gears so far!)

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #9 on: 2004-07-17 16:11:08 »
Okay, here's what I scribbled when messing with Jenova.

0x0BC9/A is the menu visibility mask. For 0x0BC9 the most significant bit is Item, then down to the least significant bit which is Config (in the same order as the menu appears); for 0x0BC9 the least significant bit is Save, and to the left of that is PHS (note: Quit cannot be made invisible). Then simply use a 1 for "visible" in each bit to make that menu item visible

0x0BCB is the menu locking mask. The MSB is Item, LSB is Config. (Note: I cannot adjust the lock for PHS or Save and it doesn't appear to be 0x0BCC, like the visibility mask). Use a 1 to lock each menu item

0x0C02 to 0x0C05 are for the chocobos in the pen outside the Chocobo Farm; 01 for the best chocobo type ("Wonderful chocobo!") down to 08 (the worst kind)

I do have some more values in this "unknown" block but altering them is a bit hit and miss. But the values that do produce a change all affect chocobos in some way

0x0ECB turns the finger & red/green arrows off(00) or on(01)

** 0x0EFD turns off(00)/on(FF) the submarine

0x0F32 Don't(00)/Do(08) display World Map instructions; display buggy instructions(28)

* 0x0F66/7 World map character positioners
0x0F68 World map character heading (some examples: 00 South, 40 East, 80 North, C0 West)
* 0x0F69/A/B World map character positioners

* 0x0F86/7 Submarine positioners
0x0F88 Submarine heading (as world map character heading)
* 0x0F89/A/B Submarine heading positioners

0x0FA6 World map camera & map display; 1) Camera - Aerial(00) Closeup (20) 2) Map - Off (80), Small (00), Large (40). Add two values together (one from camera, one from map) and set the byte

0x0FAB *must* be 00, else the game crashes

0x1030 is the field screen rain switch. Non-zero turns on the rain effect

0x10AD/E is the PHS locking mask. Similar to menu locking mask; MSB is Cloud, LSB Cait Sith (from MSB to LSB it is: Cloud-Barret-Tifa-Aeris-Red-Yuffie-Vincent-Cait Sith).Cid has his own byte (0x10AE) and he is the MSB for that byte. Use a 1 for each bit to lock that character so they cannot be moved in the PHS screen.

0x10AF/010B0 is the PHS visibility mask. Use a 1 to make that character visible in the PHS screen. Note this won't turn off characters in your party in the PHS screen, only those available for putting into your party.

NB: * - it is correct but I'm not sure exactly how to use them correctly
   ** - this *could* be a "secondary vehicle" switch, but it definetly turns the submarine off on Disc 3. I don't have any save files with the buggy/Tiny Bronco in so I can't test this.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #10 on: 2004-07-17 16:44:18 »
I'm talking out loud, just jottong down things that are missing.

Where is the proper offset for the Location name in the save file?
What's the "flag bits" at 0x10DA if it's not the menu?
What's the format of the charater flags in the character record?

0x1030 turns on the rain on the 2d field screen, or the 3d world map? (the lost in the snowstorm event)

0x0ECB is in the Chocobo name field, which is it? Finger & arrows or Cocobo name?


The map actually uses 6 bytes to discribe it's location. (two bytes for X, Y and Z) however you have it where it's only using 1 byte for X, Y, and Z.

Now I know the map is actually broken up into a 255x255 tile map, is this what the second X, Y and X, Y, Z relate to? when it comes to the party's position?




That's missing in the save map....(More to come as I fill in the blanks)

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #11 on: 2004-07-17 16:53:21 »
I get it as being 0x0F15 though Qhimm documents it as 0x0F14.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #12 on: 2004-07-17 18:21:28 »
I've updated gears and I'm  done with my talking out loud notes. Can you shed some more light into some of these mystries? You can get the new gear at the same old place.

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #13 on: 2004-07-17 19:39:12 »
I actually get the Chocobo names to start at 0x0ECD  :roll:  and as such the fingers and arrow comes just before that (at 0x0ECB).

The flag bits at 0x10DA, I get to be 00 (and in the middle of a large section of 00s). I'm certain the menu flags are correct as I actually added a new section to Jenova to adjust this and it works fine at that position.

The character/submarine "positioners" act unusually but I can find no way of producing a simple X, Y and Z location on the map. If you look it does use 6 bits but not just X, Y and Z. The "heading" byte for example, I know for sure is correct. But the first two bytes seem to adjust X and Y, but not over the entire map - only within about a half-a-map diameter. The ones after 'heading' seem to act like a 'multiplier' and send the character/submarine further across the map.  :-? The existing FF7XYZ 'coord' in the Jenova source does not seem to work; if I adjust them, Cloud stays in the exact same place.

0x1030 turns on the rain in 2d field screens only.

If it helps, download the header file FF7.h which I used to adjust Jenova and try out the new values. Compile Jenova with it and you can use the new variables I created and adjust them, then examine the changes in the save file in a hex editor and in the game to examine the effect they have.

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #14 on: 2004-07-17 19:47:14 »
Oh and the "Unknown" 6 bytes at 0x08 in the Character Record are: Extra Strength, Extra Vitality, Extra Magic, Extra Spirit, Extra Dexterity, Extra Luck, that are added on when you take a Power Source, Luck Source etc. So if you use 5 Power Sources, 0x08 will be 05. Terence tells me it's to do with Strength, Vitality etc. calculation when you level up as it needs remain seperate from character stats.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #15 on: 2004-07-17 19:48:57 »
I use linux :P

That makes for some problems using MFC and all. I was using FF7.h as the template, but sometimes the comments don't sem to alogn with the data. That's where I was getting confused.

You also know, I'm not including the save header with my save slot discription, so everything is at an offset of -9 (I think) I'm doing that to keep the data universal. the PSX uses a different header format for it's save games.

I'll wait till Terrence gets up and he might be able to share some of his discoveries with the chocobo breeding.

Synergy Blades

  • Guest
FF7 Save File Mapping... Qhimm/Others?
« Reply #16 on: 2004-07-17 19:54:27 »
Ah, gotcha  :) And that might explain a few things, basically I was adjusting the FF7.h file as you can see, altering the unknowns, and looking for changes when playing the game/adjusting a large number of values to look for changes. So I was working off the structures in the code, and not the hex, hence when I gave the values in that post I simply put the save file in a hex editor and read off the position of the new values I'd found.  :oops: So I figure having uploaded the FF7.h I was using you can find out the locations based on the no-header-included method.  :)

Terence Fergusson

  • *
  • Posts: 262
    • View Profile
FF7 Save File Mapping... Qhimm/Others?
« Reply #17 on: 2004-07-17 20:20:13 »
Glanced over the save map in Gears.  You've got Battles and Escapes at 0x0BB0 and 0x0BB2... they should be at 0x0BBC and 0x0BBE instead.  The script variables start at 0x0BA4 with the PPV, and will carry on until 0x10A3, naturally.

In the Character table, 0x26 is the amount of times Limit L1-1 has been used.  0x28 is for Limit L2-1, and 0x2A is for Limit 3-1.

For the Chocobo Table, 0x08 is Accel, 0x09 is Co-Op, 0x0A is Int (ONLY 1 BYTE), 0x0B is Personality, 0x0C is PCount.  Note that only Chocobos #1-#4 are stored at 0x0DC4-0x0E03.  Chocobos #5-#6 are instead at 0x1084-0x10A3 (the very last values of the global script variables).

 ===

Edit: Synergy needs more practice in identify MSB and LSB ^_^;;  Item is the *Least Significant Bit* in both visibility and disable bytes.  (You got PHS and Save's position correct though)

In addition, Menu Invisibility is 0x0BB4/5, and Menu Disabling is 0x0BB6/7.  PHS and Save *are* effected by disabling, so long as you remember that Invisibility and Disabling are both 2-byte addresses.

Field Chocobo ratings are at 0x0BF9 - 0x0BFC.  And regarding PHS... Cloud and Cid are both *LSB* in their individual addresses.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
FF7 Save File Mapping... Qhimm/Others?
« Reply #18 on: 2004-07-18 07:50:58 »
cocobo ratings are in 0x0BF9 - 0x0BFC and not 0x0C02-0x0C05

How many chocobos are in the pen? Only four?

What is PCount in the cocobo stats?

Thoer than that? I've updated gears, There are some varibles that terrence has mentioned like the "World counter" that tells how for you have progressed in the stroy.

YOu know, I just realized I play this game on an emulater and use save states... I can manually alter the save state and load at a button push...

I will have to experiment..