Anonymous

Changes

From Final Fantasy Inside

FF7/Battle and growth data

2,985 bytes added, 05:11, 23 May 2019
m
25 revisions imported
| 0x0000
| 56 bytes
| Character data: Cloud ([[#Character_data_layoutCharacter_data_record|see below]])
|-
| 0x0038
| 0xF1C
| 64 bytes
| Scene.bin look-up table ([[#Scene.bin_Look-up_file_layoutup_file|see below]])
|-
| 0xF5C
70 * ((13-1) ^ 2) /10
70 * (144 / 10)
70 * Floor( 14.4) 1008 980 additional XP
The savemap contains information about the needed XP to get to the next level for each character so it can be assumed that the game only performs this calculation at level up and changes the needed XP stat accordingly and compares that against the total XP the character has to determine when the next level occurs.<br/>
To calculate the total XP needed for a given level:
XP = XP + [Mod * (I ^ 2) / 10]
Next I
Remember, the The Mod will need only needs to be adjusted to assigned based on the character and 's current level group each time I increments.
==== Character AI data ====
Section contains 24-byte header representing 2-bytes per script block (1 per character?). Each number is an offset from the beginning of this block to the actual AI data. Each script block follows the same AI data found in the [[FF7/Battle/Battle_scenes#AI_Data|Battle Scenes]].
A basic disassembly of the characters' scripts can be found [http://forums.qhimm.com/index.php?topic=7928.msg97889#msg97889 here]
==== Scene.bin Look-up file Table ====
As you may know, In order to understand the purpose of this table we must understand the structure of the compressed and packed [[FF7/Battle/Battle_scenes|scene.bin]] file . It is divided into banks or sections. There are 33 total sections, and each one is 8192 longblocks of 8K in size. Each section contains 5 - 20 files, based on their length. If archive is modified and one of the files is bigger than before, it must be put in the next section, which'll probably cause last these blocks begins with an array of pointers that point to a compressed array of bytes that contain a single scene file in this section to . There can be put in next one, etc. This look-up table contains data about how many files are between 1 and 16 inclusive scenes in each sectionof these blocks. It begins like this:
00 0C 12 19 21 27 2D There is no direct indication of how many scenes are in each block other than searching through all the headers to find the desired one.It would take a noticeable amount of time to search through each block when the greater valued formations are requested.The working solution to this is a look up table that would tell the scene retrieval method which block contains the desired scene. Enter the Scene Look-Up Table (hereafter abbreviated SLUT because I can :) ).
Which meansWhen a specific formation ID is requested, the Scene File that contains it can be determined like this: Scene File = ( Formation ID AND FFFC ) >> 2So, for example, we know that formation 134h would be in scene 4Dh.
Without searching through all the blocks as noted above, this table serves to indicate what the first scene is in each block of 8K. When a formation is to be loaded, the containing scene file is retrieved as mentioned above then the SLUT is looped through to find the lowest value greater than the requested scene then uses the value BEFORE that.  Section 1 contains 0x0C - 0x00 = Example Unmodded SLUT: 00 0C 12 files19 21 27 2D 35 3D 49 51 5A ...etc Section 2 contains 0x12 - 0x0C = 6 files Section 3 Desired scene is 4D. 51 is first in that list greater than 4D. Value to the left of that is used (49). Then we know that the 10th block in the scene.bin contains 0x19 the scene and formation we're looking for. The rest of the details of what happens next don't matter. This is all that involves the SLUT. This needs to be checked/updated each time the scene.bin is compressed and repacked. If not it can lead to errors and out- 0x12 of-place formations being used. As an example, if a modder changes the one of the scenes in the first block it may not be able to fit together in an 8K block of compressed space with all its original "brothers." The last scene in this block is then kicked out of that block and into the next. Now each scene in the next block is off by one file. This will domino onward displacing scene after scene until a block with enough padding can absorb a new scene without going over the 8K limit. So if formation 31h is requested it will see that formation is part of scene 0Ch which is the first scene of block three. But since one of the scenes from block 1 became the first scene in block 2, the game will load the second formation in the first scene which won't match the one we're really looking for. The solution is to change the second byte in the SLUT to 0Bh which will correctly indicate that the desired scene is actually the second scene of block two. Also consider if scene 0Bh were requested. The scene retrieval mentioned above leads the game to conclude that scene 0Bh is in the first block. However, when it tries to loop through the pointers in the block, it will find a null pointer. Then an error beyond your imagination will occur: the game will crash!! D: (not verified, but probably around 0x5D116B) Both [[http://forums.qhimm.com/index.php?topic= 7 files 7186.0 Hojo]] and [[http://forums.qhimm.com/index.php?topic=8481.0 Proud Clod]] will examine this SLUT automatically and make changes accordingly.The moral of the above story is use one of these programs when altering the scene. bin and so let them take action accordingly onthe KERNEL.BIN.
Everytime you modify scene.bin file, you must also keep this table updated, or you'll end with VERY random encounters (wrong battles in wrong places). You can use [http://forums.qhimm.com/index.php?topic=7127.0 SceneFix] program, which'll update the table for you.
Bonus Info: Since there are only 64 bytes allotted to this table, there must be no more than 64 blocks in a scene.bin file which indirectly limits its size to 64 * 8K or 512K.
==== Magic Order ====
NOTES:
*If a value is repeated, that attack will override the previous listing.
*The final two bytes are NULL (0xFF) so the game moves the Attack pointer ahead to load the summon attacks(?).**Even if these were not NULL, they would be ignored.