Author Topic: How do I edit damage formulas? [FFVIII]  (Read 41087 times)

SunnyD

  • *
  • Posts: 36
    • View Profile
How do I edit damage formulas? [FFVIII]
« on: 2016-04-27 23:52:21 »
I'm quite new to modding FFVIII and I'm curious about one thing. How would I exactly edit damage formulas for both party members and allies? In particular I'd like to make some magic spells more useful whilst also nerfing other attacks. I'm using HxD as my editor but admittedly don't know where I should start looking.

Thanks in advance and sorry for what's probably a really simple question.

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #1 on: 2016-04-28 07:00:49 »
I don't know about FF VIII, but for IX, that's far from the most simple thing to modify ^^"
Spell formulas are written in MIPS code in the PSX version.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: How do I edit damage formulas? [FFVIII]
« Reply #2 on: 2016-04-28 11:07:34 »
As far as FFVII goes, if you change formulae for allies, you change it for enemies too. FFVIII probably uses the same data for magics for all PCs and enemies.

But do you actually want to change the math behind the calculations or just change some strengths of individual actions? Those are two pretty different requests.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #3 on: 2016-04-28 11:17:50 »
Is this for the PC or Playstation version of FF8?

SunnyD

  • *
  • Posts: 36
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #4 on: 2016-04-28 17:35:01 »
As far as FFVII goes, if you change formulae for allies, you change it for enemies too. FFVIII probably uses the same data for magics for all PCs and enemies.

But do you actually want to change the math behind the calculations or just change some strengths of individual actions? Those are two pretty different requests.

Just some strengths of individual actions.

Is this for the PC or Playstation version of FF8?

PC version sorry. Steam version specifically.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #5 on: 2016-04-28 20:37:07 »
It's probably in the exe, you'll probably need a disassembler and debugger to modify them.

There's a function at 0x48D200 (in memory) that takes 7 args which might lead to where the values are stored:
arg1: caster id (0-2 for Seeds, 3+ for monsters - each person in a battle has an id)
arg2: either something like 2 (for magic) or a large value that might be some sort of offset/pointer
arg3: integer representing magic type e.g. 0x0C for Bio, 0x23 for haste
arg4: some pointer?
arg5: some dinput call or null (I've not actually investigated it, it might just be an assumption by my debugger)
arg6: target bitmask
arg7: some d3d call or null (I've not actually investigated it, it might just be an assumption by my debugger)

EDIT: Couple of other things:
function at 0x47E970 gets the name of magic from an ID
all the magic is listed in structs of 60 bytes from 0x1CF4064, no idea what these values are or if they're static/loaded from a file. I only know that the first word is an offset for locating the name and the second word is an offset for the description - the rest are a mystery and may relate to damage, status etc. or they could be completely useless for what you want.
The bytes that are usually 0x64 are probably for status/elemental stuff - could also be for junctions.
for example: bio has an id of 0x0C, so all the bio stuff is the 60 bytes at address 0x1CF4334
There's probably magic info stored elsewhere too, I'll see if I can dig out any more information at a later date.
Hope that helps! :)

list of magic can be found in this post:
http://forums.qhimm.com/index.php?topic=11137.msg166280#msg166280
« Last Edit: 2016-04-29 07:40:19 by JWP »

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #6 on: 2016-04-30 09:33:13 »
So after a bit more investigation, I've found that the magic data I mentioned in the previous post is loaded from the kernel.bin file and the magic stuff starts at offset 0x21C in kernel.bin and ends at 0xF78 - so you can use HxD to edit it (kernel.bin is in the main.fi archive and you'll need an archive extractor to remove it - see http://wiki.qhimm.com/view/FF8/Tools - in my case, main.fi is located at: "C:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY VIII\Data\lang-en\main.fi").
!!!--- Don't forget to make a backup of main.fi, main.fs and main.fl files before you edit it ---!!!
the 60 byte structures starting at 0x21C are comprised roughly as follows:

see: http://finalfantasy.wikia.com/wiki/Magic_(Final_Fantasy_VIII) for more information on magic,
see also: http://www.gamefaqs.com/ps/197343-final-fantasy-viii/faqs/58936

2 bytes - offset to spell name
2 bytes - offset to spell description
4 bytes - unknown
1 byte - spell power (basically relates to how much damage it does)
3 bytes - unknown
1 byte - draw resist (how hard it is to draw - higher = harder)
10 bytes - unknown
1 byte - HP junction value
1 byte - str junction value
1 byte - vit junction value
1 byte - mag junction value
1 byte - spr junction value
1 byte - spd junction value
1 byte - eva junction value
1 byte - hit junction value
1 byte - luck junction value
28 bytes - unknown

so modifying the spell damage is simple enough but this will also modify it for enemies.
If you wanted to modify the actual equation (the one listed on the wiki), then you'd need to know x86 ASM, there's a bunch of sub functions called from 0x4922B0:
arg1 - think this is 0x02 for magic but can be other values depending on attack type (e.g. attacking with gunblade is 0x0A)
arg2 - caster_id
arg3 - target_id
arg4 - spell_power
and one of those probably deals with that but I'd not recommend doing that.

EDIT:
function 0x491DA0 is probably the main damage calculation function:
arg1 - caster_id
arg2 - target_id
arg3 - spell_power (I made haste deal damage by changing this on the fly with a debugger :D)
arg4 - 0 = magic damage?, 2 = GF?

The main magic damage calculation is in this section of code (note that it's elsewhere for different damage types) - I'd recommend modifying the spell power listed above instead, since it's a lot easier:
note you can see the formula listed at section 4.2 of http://www.gamefaqs.com/ps/197343-final-fantasy-viii/faqs/58936 listed in the code
Code: [Select]
CPU Disasm
Address   Hex dump          Command                                  Comments
00491C62  |> \E8 B9D3FFFF   CALL 0048F020                            ; [FF8_EN.0048F020, case 0 of switch FF8_EN.491C17 - this call is to get_random_number
00491C67  |.  25 FF000000   AND EAX,000000FF
00491C6C  |.  B9 21000000   MOV ECX,21
00491C71  |.  99            CDQ
00491C72  |.  F7F9          IDIV ECX
00491C74  |.  8BCA          MOV ECX,EDX
00491C76  |.  8D145B        LEA EDX,[EBX*2+EBX]
00491C79  |.  81C1 F0000000 ADD ECX,0F0
00491C7F  |.  8D0493        LEA EAX,[EDX*4+EBX]
00491C82  |.  33D2          XOR EDX,EDX
00491C84  |.  C1E0 04       SHL EAX,4
00491C87  |.  8A90 CF7BD201 MOV DL,BYTE PTR DS:[EAX+1D27BCF]         ;get mag of caster
00491C8D  |.  8BC2          MOV EAX,EDX                              ;EAX = mag of caster
00491C8F  |.  BA 09010000   MOV EDX,109                              ;EDX = 265
00491C94  |.  03C5          ADD EAX,EBP                              ;EAX = mag + spell_power
00491C96  |.  2BD7          SUB EDX,EDI                              ;EDX = 265 - target_spr
00491C98  |.  0FAFC2        IMUL EAX,EDX                             ;EAX = (mag + spell_power) * (265 - target_spr)
00491C9B  |.  99            CDQ                                      ;/*
00491C9C  |.  83E2 03       AND EDX,00000003                         ;correction for signed division with SAR
00491C9F  |.  03C2          ADD EAX,EDX                              ;*/
00491CA1  |.  C1F8 02       SAR EAX,2                                ;EAX = ((mag + spell_power) * (265 - target_spr))/4
00491CA4  |.  0FAFC5        IMUL EAX,EBP                             ;EAX = (((mag + spell_power) * (265 - target_spr))/4) * spell_power
00491CA7  |.  99            CDQ                                      ;/*
00491CA8  |.  81E2 FF000000 AND EDX,000000FF                         ;correction for signed division with SAR
00491CAE  |.  03C2          ADD EAX,EDX                              ;*/
00491CB0  |.  C1F8 08       SAR EAX,8                                ;EAX = ((((mag + spell_power) * (265 - target_spr))/4) * spell_power)/256
00491CB3  |.  0FAFC1        IMUL EAX,ECX
00491CB6  |.  99            CDQ
00491CB7  |.  81E2 FF000000 AND EDX,000000FF
00491CBD  |.  03C2          ADD EAX,EDX
00491CBF  |.  8BF0          MOV ESI,EAX
00491CC1  |.  C1FE 08       SAR ESI,8
00491CC4  |.  83FB 03       CMP EBX,3
00491CC7  |.  7C 02         JL SHORT 00491CCB
00491CC9  |.  D1FE          SAR ESI,1
00491CCB  |>  8B4C24 10     MOV ECX,DWORD PTR SS:[LOCAL.2]
00491CCF  |>  A0 0E8ED201   MOV AL,BYTE PTR DS:[1D28E0E]
00491CD4  |.  24 03         AND AL,03
00491CD6  |.  3C 01         CMP AL,1
00491CD8  |.  75 16         JNE SHORT 00491CF0
00491CDA  |.  85F6          TEST ESI,ESI
00491CDC  |.  74 12         JE SHORT 00491CF0
00491CDE  |.  F681 187BD201 TEST BYTE PTR DS:[ECX+1D27B18],40
00491CE5  |.  74 09         JE SHORT 00491CF0
00491CE7  |.  800D DD7AD201 OR BYTE PTR DS:[1D27ADD],20
00491CEE  |.  D1FE          SAR ESI,1
00491CF0  |>  F781 187BD201 TEST DWORD PTR DS:[ECX+1D27B18],00080000
00491CFA  |.  74 02         JE SHORT 00491CFE
00491CFC  |.  D1FE          SAR ESI,1
00491CFE  |>  A1 44A2D201   MOV EAX,DWORD PTR DS:[1D2A244]
00491D03  |.  84C0          TEST AL,AL
00491D05  |.  0F84 11020000 JE 00491F1C
00491D0B  |.  8D4C24 14     LEA ECX,[LOCAL.1]
00491D0F  |.  25 FF000000   AND EAX,000000FF
00491D14  |.  51            PUSH ECX                                 ; /Arg2 => OFFSET LOCAL.1
00491D15  |.  50            PUSH EAX                                 ; |Arg1 => 0
00491D16  |.  E8 35D2FFFF   CALL 0048EF50                            ; \FF8_EN.0048EF50
00491D1B  |.  8B5424 18     MOV EDX,DWORD PTR SS:[LOCAL.2]
00491D1F  |.  8B4424 1C     MOV EAX,DWORD PTR SS:[LOCAL.1]
00491D23  |.  83C4 08       ADD ESP,8
00491D26  |.  25 FF000000   AND EAX,000000FF
00491D2B  |.  F682 907BD201 TEST BYTE PTR DS:[EDX+1D27B90],40
00491D32  |.  0F84 AC010000 JE 00491EE4
00491D38  |.  83F8 07       CMP EAX,7
00491D3B  |.  0F85 A3010000 JNE 00491EE4
00491D41  |.  B8 BC020000   MOV EAX,2BC
00491D46  |.  E9 B0010000   JMP 00491EFB

there's a bunch of other modification but that's the main part of it. See section 6 of the link above for the rest.
If you know ASM, you could jmp based on the caster ID (it's always <3 for allies) and write custom code for the damage stuff - either in-place, injected dll etc. but it's not exactly trivial unless you're familiar with that sort of thing.
« Last Edit: 2016-05-07 23:39:59 by JWP »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #7 on: 2016-05-01 00:50:34 »
Man you're a hero, now it's finally possible to reduce the strenght of the junction system and make the spells actually worth using! I'm making a difficulty mod and this is going to be of great help so thanks! ;D
Do you think you can find where the values for the "stat +xx%" are stored? I assume it's in the kernel.bin as well.

A lttle test i did to check if i was editing the right things:



Sega Chief

  • *
  • Posts: 4086
  • These guys is sick
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #8 on: 2016-05-01 06:25:26 »
Exciting stuff; fixing Junction bonuses is one of the foundations for making a more intricate difficulty mod. But I think the big problem is going to be fixing the Limit Break system.

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #9 on: 2016-05-01 15:27:10 »
I found elemental and status junctions.

2 bytes - offset to spell name
2 bytes - offset to spell description
4 bytes - unknown
1 byte - spell power (basically relates to how much damage it does)
3 bytes - unknown
1 byte - draw resist (how hard it is to draw - higher = harder)
10 bytes - unknown
1 byte - HP junction value
1 byte - str junction value
1 byte - vit junction value
1 byte - mag junction value
1 byte - spr junction value
1 byte - spd junction value
1 byte - luck junction value
1 byte - eva junction value
1 byte - hit junction value
1 byte - elemental attack enabler*
1 byte - elemental attack value
1 byte - elemental defense enabler*
1 byte - elemental defense value
1 byte - status attack value
1 byte - status defense value
2 bytes - status attack enabler**
2 bytes - status defense enabler**
18 bytes - unknown


*Elemental Enablers Values
0x01 - Fire
0x02 - Ice
0x04 - Thunder
0x08 - Earth
0x10 - Poison
0x20 - Wind
0x40 - Water
0x80 - Holy


**Status Enablers Values
0x0001 - Death
0x0002 - Poison
0x0004 - Petrify
0x0008 - Darkness
0x0010 - Silence
0x0020 - Berserk
0x0040 - Zombie
0x0080 - Sleep
0x0100 - Slow
0x0200 - Stop
0x0400 - Curse (unused for attack)
0x0800 - Confusion
0x1000 - Drain
« Last Edit: 2016-05-01 19:05:45 by alexfilth »

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #10 on: 2016-05-01 16:10:44 »
Nice work :), although you probably didn't need to document every value, it's pretty much a standard bit field: https://en.wikipedia.org/wiki/Bit_field
In other words, each bit toggles something on/off. Just document what each bit toggles i.e.
LSB Fire, Ice, Thunder, Earth, Poison, Wind, Water, Holy MSB
or if you prefer this way:
Code: [Select]
0x01 - Fire    - 00000001
0x02 - Ice     - 00000010
0x04 - Thunder - 00000100
0x08 - Earth   - 00001000
0x10 - Poison  - 00010000
0x20 - Wind    - 00100000
0x40 - Water   - 01000000
0x80 - Holy    - 10000000
To get combinations, you'd just binary or the components together. e.g. to get fire + poison + wind:
Code: [Select]
Binary    Hex Element
00000001  01   Fire
00010000  10   Poison
00100000  20   Wind
Result:
00110001  31   Fire | Poison | Wind

To check two bytes, you'd only need to test the following 16 values (note that some bits might be unused):
0x0001
0x0002
0x0004
0x0008
0x0010
0x0020
0x0040
0x0080
0x0100
0x0200
0x0400
0x0800
0x1000
0x2000
0x4000
0x8000
« Last Edit: 2016-05-01 16:48:59 by JWP »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #11 on: 2016-05-01 16:47:22 »
Thanks, now it makes sense! I added statuses as well.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #12 on: 2016-05-01 17:04:50 »
Nice work! :D. Is that slow petrify supposed to be curse? - I didn't think you could defend against slow petrify specifically.

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #13 on: 2016-05-01 19:06:25 »
Yeah you're right, corrected.

SunnyD

  • *
  • Posts: 36
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #14 on: 2016-05-01 20:10:27 »
Okay I'm having a mild brainfart I think.



That's what I see looking at the kernal.bin on HxD. If I were to (for example) increase Flare's damage where would I start? I'm drawing such a blank here with this so I'm sorry if it's such an obvious question.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #15 on: 2016-05-01 20:41:32 »
ok, so according to this: http://forums.qhimm.com/index.php?topic=11137.msg166280#msg166280
flare has a magic ID of 0x0F.
so we have a few things:
0x21C - start of magic data
--blocks of 60 bytes--

so to get the start offset of flare, we would do 0x21C + (60 * 0x0F) - note the 60 is decimal.
this gives the start offset of flare as 0x5A0.
We want to edit the spell power, so we need to add another 8 bytes - because there are 8 bytes before the spell power.
this gives the byte that we need to edit as 0x5A8.
the current value of this byte is 0x30 or 48 in decimal and you can see that this is correct on:http://finalfantasy.wikia.com/wiki/Magic_(Final_Fantasy_VIII)
You would just increase this value to increase the damage.
« Last Edit: 2016-05-01 22:51:56 by JWP »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #16 on: 2016-05-02 10:39:53 »
I did this for me to make editing a little bit less tedious, might as well post it. Like JWP said every block is 60 bytes.

Fire: 0x258
Fira: 0x294
Firaga: 0x2D0
Blizzard: 0x30C
Blizzara: 0x348
Blizzaga: 0x384
Thunder: 0x3C0
Thundara: 0x3FC
Thundaga: 0x438
Water: 0x474
Aero: 0x4B0
Bio: 0x4EC
Demi: 0x528
Holy: 0x564
Flare: 0x5A0
Meteor: 0x5DC
Quake: 0x618
Tornado: 0x654
Ultima: 0x690
Apocalypse: 0x6CC
Cure: 0x708
Cura: 0x744
Curaga: 0x780
Life: 0x7BC
Full-Life: 0x7F8
Regen: 0x834
Esuna: 0x870
Dispel: 0x8AC
Protect: 0x8E8
Shell: 0x924
Reflect: 0x960
Aura: 0x99C
Double: 0x9D8
Triple: 0xA14
Haste: 0xA50
Slow: 0xA8C
Stop: 0xAC8
Blind: 0xB04
Confuse: 0xB40
Sleep: 0xB7C
Silence: 0xBB8
Break: 0xBF4
Death: 0xC30
Drain: 0xC6C
Pain: 0xCA8
Berserk: 0xCE4
Float: 0xD20
Zombie: 0xD5C
Meltdown: 0xD98
Scan: 0xDD4
Full Cure: 0xE10
Wall: 0xE4C
Rapture: 0xE88
Percent: 0xEC4
Catastrophe: 0XF00
The End: 0xF3C

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #17 on: 2016-05-02 13:29:47 »
Thanks alexfilth and JWP, we could document the whole kernel.bin file, your info is important.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #18 on: 2016-05-02 14:21:54 »
bit more info on kernel.bin:
4 bytes - number of sections
X * 4 bytes - offset to each section
Even though this section contains offsets, most of the offsets are hard-coded into the exe, the only part of this section that seems to be used is the text offsets.

Offsets are for English Steam release, only the text section offsets probably change between languages:
--------DATA SECTION--------
1  - 0x00E4 - Battle commands - 39 items - 8 bytes each
2  - 0x021C - Magic data - 57 items - 60 bytes each
3  - 0x0F78 - Junctionable GFs - 16 items - 132 bytes each
4  - 0x17B8 - Enemy attacks - 384 items - 20 bytes each
5  - 0x35B8 - Weapons - 33 items - 12 bytes each
6  - 0x3744 - Renzokuken finishers - 4 items - 24 bytes each
7  - 0x37A4 - Characters - 11 items - 36 bytes each
8  - 0x3930 - Battle items - 33 items - 24 bytes each
9  - 0x3C48 - Non-battle item name and description offsets - 166 items - 4 bytes each
10 - 0x3EE0 - Non-junctionable GF attacks - 16 items - 20 bytes each
11 - 0x4020 - Command ability data - 12 items - 16 bytes each
12 - 0x40E0 - Junction abilities - 20 items - 8 bytes each
13 - 0x4180 - Command abilities - 19 items - 8 bytes each
14 - 0x4218 - Stat percentage increasing abilities - 19 items - 8 bytes each
15 - 0x42B0 - Character abilities - 20 items - 8 bytes each
16 - 0x4350 - Party abilities - 5 items - 8 bytes each
17 - 0x4378 - GF abilities - 9 items - 8 bytes each
18 - 0x43C0 - Menu abilities - 24 items - 8 bytes each
19 - 0x4480 - Temporary character limit breaks - 5 items - 24 bytes each
20 - 0x44F8 - Blue magic (Quistis limit break) - 16 items - 16 bytes each
21 - 0x45F8 - Quistis limit break parameters - 64 items - 8 bytes each
22 - 0x47F8 - Shot (Irvine limit break) - 8 items - 24 bytes each
23 - 0x48B8 - Duel (Zell limit break) - 10 items - 32 bytes each
24 - 0x49F8 - Zell limit break parameters
25 - 0x4A5C - Rinoa limit breaks - 2 items - 8 bytes each
26 - 0x4A6C - Rinoa limit breaks - 5 items - 20 bytes each
27 - 0x4AD0 - Slot array - 1 byte each (each entry corresponds to a set ID)
28 - 0x4B0C - Selphie limit break sets - 16 items (each slot entry is 1 byte magic ID, 1 byte count) - 16 bytes each
29 - 0x4C0C - Devour - 16 items - 12 bytes each
30 - 0x4CCC - Misc section - status timers (14 bytes), Spd multiplier for ATB (1 byte), Dead Timer (1 byte), status limit effects (32 bytes), Zell limit time + start moves (8 bytes), Irvine shot timers (4 bytes)
31 - 0x4D08 - Misc text pointers - 128 items - 2 bytes each

--------TEXT SECTION--------
32 - 0x4E08 - Battle command text
33 - 0x5188 - Magic text
34 - 0x57B0 - Junctionable GF text
35 - 0x59F0 - Enemy attack text
36 - 0x619C - Weapon text
37 - 0x62F8 - Renzokuken finishers text
38 - 0x6364 - Character names
39 - 0x63A0 - Battle item names
40 - 0x6768 - Non-battle item names
41 - 0x7C28 - Non-junctionable GF attack name
42 - 0x7CDC - Junction abilities text
43 - 0x7E9C - Command abilities text
44 - 0x8000 - Stat percentage increasing abilities text
45 - 0x81A8 - Character ability text
46 - 0x84A8 - Party ability text
47 - 0x8540 - GF ability text
48 - 0x862C - Menu ability text
49 - 0x89C0 - Temporary character limit break text
50 - 0x8A40 - Blue magic text
51 - 0x8C24 - Shot text
52 - 0x8D0C - Duel text
53 - 0x8E04 - Rinoa limit break text
54 - 0x8E38 - Rinoa limit break text
55 - 0x8E74 - Devour text
56 - 0x8F74 - Misc text

Code: [Select]
****************************************
*        Section 2 - Magic Data        *
****************************************

Code: [Select]
2 bytes - offset to spell name
2 bytes - offset to spell description
2 byte - magic id - decides what animation to play
2 bytes - unknown
1 byte - spell power (basically relates to how much damage it does)
1 byte - unknown
1 byte - default target
1 byte - unknown
1 byte - draw resist (how hard it is to draw - higher = harder)
1 byte - hit count (works with meteor animation, not sure about others)
1 byte - element
0x01 - Fire
0x02 - Ice
0x04 - Thunder
0x08 - Earth
0x10 - Poison
0x20 - Wind
0x40 - Water
0x80 - Holy
1 byte - unknown
1 byte - status
0x01 - sleep
0x02 - haste
0x04 - slow
0x08 - stop
0x10 - regen
0x20 - protect
0x40 - shell
0x80 - reflect
1 byte - status
0x01 - aura
0x02 - curse
0x04 - doom
0x08 - invincible
0x10 - petrifying
0x20 - float
0x40 - confuse
0x80 - drain
1 byte - status
0x01 - eject
0x02 - double
0x04 - triple
0x08 - defend
0x10 - ???
0x20 - ???
0x40 - ???
0x80 - ???
1 byte - status
0x01 - vit0
0x02 - ???
Last Edit: Today at 16:40:45
0x04 - ???
0x08 - ???
0x10 - ???
0x20 - ???
0x40 - ???
0x80 - ???
1 byte - status
0x01 - death
0x02 - poison
0x04 - petrify
0x08 - blind
0x10 - silence
0x20 - berserk
0x40 - zombie
0x80 - ???
2 bytes - unknown
1 byte - HP junction value
1 byte - str junction value
1 byte - vit junction value
1 byte - mag junction value
1 byte - spr junction value
1 byte - spd junction value
1 byte - eva junction value
1 byte - hit junction value
1 byte - luck junction value
1 byte - elemental attack enabler*
1 byte - elemental attack value
1 byte - elemental defense enabler*
1 byte - elemental defense value
1 byte - status attack value
1 byte - status defense value
2 bytes - status attack enabler**
2 bytes - status defense enabler**
18 bytes - unknown

Code: [Select]
****************************************
*         Section 3 - GF Data          *
****************************************

See alexfilth's post

Code: [Select]
****************************************
*      Section 4 - Enemy Attacks       *
****************************************

Structure:
Code: [Select]
struct EnemyAttack {
WORD name_offset;
WORD magic_id;
BYTE unk[2];
BYTE attack_type;
BYTE attack_power;
BYTE attack_flags;
BYTE unk;
BYTE element;
BYTE unk;
BYTE status_attack;
BYTE unk;
WORD status_0; //statuses 0-7 (only 8 bits are used)
DWORD status_1; //statuses 8-31
}

Code: [Select]
****************************************
*       Section 5 - Weapon Data        *
****************************************

Structure:
Code: [Select]
struct Weapon {
WORD name_offset;
BYTE renzokuken_finishers; //0x01 = Rough Divide, 0x02 = Fated Circle, 0x04 = Blasting Zone, 0x08 = Lion Heart
BYTE unk;
BYTE character_id;
BYTE attack_type;
BYTE attack_power;
BYTE hit_bonus;
BYTE str_bonus;
BYTE weapon_tier;
BYTE unk[2];
}

Code: [Select]
****************************************
*   Section 6 - Renzokuken Finishers   *
****************************************

Structure:
Code: [Select]
struct Renzokuken_Finisher {
WORD name_offset;
WORD description_offset;
WORD magic_id;
BYTE attack_type;
BYTE unk;
BYTE attack_power;
BYTE unk;
BYTE target_info;
BYTE unk;
BYTE hit_count;
BYTE unk[11];
}

Code: [Select]
****************************************
*      Section 7 - Character Data      *
****************************************

Structure:
Code: [Select]
struct Character {
WORD name_offset;
BYTE crisis_level_hp_multiplier;
BYTE gender; //0x00 for male, 0x01 for female
BYTE limit_break_id;
BYTE limit_break_param; //used for the power of each renzokuken hit before finisher - see address 0x490FCE
BYTE exp_modifier[2]
BYTE HP[4]
BYTE str[4];
BYTE vit[4];
BYTE mag[4];
BYTE spr[4];
BYTE spd[4];
BYTE luck[4];
}
Character order is: Squall, Zell, Irvine, Quistis, Rinoa, Selphie, Seifer, Edea, Laguna, Kiros, Ward.
Squall and Rinoa have name offsets of 0xFFFF because their name is in the save game data rather than kernel.bin.
crisis_level_hp_mulipilier is multiplied by 10 and used in the formula for crisis level

Formulas for character stats:
Note: this is integer arithmetic, so the results of any division are truncated towards zero.
EXP required to reach level X:
Code: [Select]
((lvl-1)^2*exp_b)/256 + (lvl-1)*exp_a*10

HP formula (function 0x496310):
Code: [Select]
HP = ((stat_magic_J_value*magic_count + stat_bonus + lvl*a - (10*lvl^2)/b +c)*percent_modifier)/100

stat_magic_J_value = The junction value of the junctioned magic - this is located with the magic in section 2 of kernel.bin
magic_count = The amount of the junctioned magic that the character holds
stat_bonus = permanent bonus gained from XBonus skills and Devour
percent_modifier = is 100 + any %bonuses added, so if you had stat +20% and stat +60% equipped, it would be 180
a, b, c and d are the bytes in the example below
Note: d appears to be unused in the HP formula

Str, Vit, Mag and Spr formula (function 0x496440):
Code: [Select]
stat = ((X + (stat_magic_J_value*magic_count)/100 + stat_bonus + ((lvl*a)/10 + lvl/b - (lvl*lvl)/d/2 + c)/4)*percent_modifier)/100

X is currently unknown - probably weapon modifier

Spd and Luck formula (function 0x496440):
Code: [Select]
stat = ((X + (stat_magic_J_value*magic_count)/100 + stat_bonus + lvl/b - lvl/d + lvl*a +c)*percent_modifier)/100

X is currently unknown - probably 0

Eva formula (function 0x4968A0):
Code: [Select]
eva = (((stat_magic_J_value*magic_count)/100 + spd/4)*percent_modifier)/100
note that this is for calculating the eva stat in memory, when it is presented, it appears to be a percentage of 256, i.e. (eva*100)/256

Example:
Code: [Select]
Bytes for Squall:
      a  b  c  d
HP:   2C FF B3 00
Str:  1E 05 02 26
Vit:  1A 05 05 29
Mag:  1C 04 06 27
Spr:  18 05 05 29
Spd:  00 05 14 1E
Luck: 00 07 0F 0E
Eva:  calculated from speed
Hit:  based entirely on weapon and Hit-J

This gives stats with no modifiers at level 100 as:
Code: [Select]
HP:   4187
Str:  47 (+11 from starting weapon)
Vit:  41
Mag:  45
Spr:  36
Spd:  37
Luck: 22
Eva:  3%
Hit:  0% (+255% from starting weapon)
« Last Edit: 2016-06-15 11:01:14 by JWP »

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #19 on: 2016-05-02 17:15:37 »
Magic ID list

ID--File Load Function--Main Function--Description
0x0001--0x008D69E0--0x008D6A00--Cure
0x0002--0x00629880--0x006298A0--Fire
0x0003--0x00575610--0x00700C10--Thunder
0x0004--0x008D5060--0x008D5080--Double
0x0005--0x008D4430--0x008D4450--Phoenix Down
0x0006--0x00B58050--0x00B58080--Leviathan Summon (Tsunami)
0x0007--0x008CE3B0--0x008CE3D0--Mega Phoenix
0x0008--0x008C4960--0x008C4980--Doom
0x0009--0x008C0360--0x008C0380--Doom Activation
0x000A--0x00627E40--0x00627E60--Ray-Bomb
0x000B--0x006EA510--0x006EA500--Storm Breath
0x000C--0x006E8AC0--0x006E8AE0--Blade Shot
0x000D--0x008BE1D0--0x008BE1F0--Dark Mist/Poison Mist
0x000E--0x008B68A0--0x008B68C0--Death/Death Stone
0x000F--0x008B08F0--0x008B0910--Draw
0x0010--0x008AB120--0x008AB140--Recover
0x0011--0x00575600--0x007003C0--Elvoret Entrance
0x0012--0x00B4A500--0x00B4A530--Elvoret Death
0x0013--0x008A3280--0x008A32A0--
0x0014--0x0089FBA0--0x0089FBC0--NORG Pod Opening
0x0015--0x0089DED0--0x0089DEF0--Triple
0x0016--0x0089A690--0x0089A6B0--Bio
0x0017--0x00893000--0x00893020--Psycho Blast
0x0018--0x0088CF50--0x0088CF70--Esuna
0x0019--0x00889D40--0x00889D60--Cura
0x001A--0x008885B0--0x008885D0--Clash
0x001B--0x008830F0--0x00883110--Full-Life
0x001C--0x0087DAF0--0x0087DB10--Curaga
0x001D--0x00879480--0x008794A0--Wind Blast
0x001E--0x008735D0--0x008735F0--Counter Laser-Eye
0x001F--0x0086C9C0--0x0086C9E0--Heartbreak
0x0020--0x0086B980--0x0086B9A0--Protect
0x0021--0x00865FF0--0x00866010--Shell
0x0022--0x008655E0--0x00865600--Pain
0x0023--0x008649A0--0x008649C0--Life
0x0024--0x0085F4C0--0x0085F4E0--Confuse
0x0025--0x008569D0--0x008569F0--Drink Magic
0x0026--0x00575620--0x008D8510--Quake
0x0027--0x008513B0--0x008513D0--Drain
0x0028--0x0084D010--0x0084D030--Scan
0x0029--0x008465A0--0x008465C0--Dribble
0x002A--0x0083ECA0--0x0083ECC0--Shoot
0x002B--0x00839920--0x00839940--Melting Bubble
0x002C--0x006E7AF0--0x006E7AE0--Junk
0x002D--0x00836570--0x00836590--Stare
0x002E--0x00831B30--0x00831B50--Sigh
0x002F--0x0082A7D0--0x0082A7F0--Curse
0x0030--0x00824CD0--0x00824CF0--Magma Breath
0x0031--0x00821520--0x00821540--Resonance
0x0032--0x0081F9F0--0x0081FA10--Potion/Potion+
0x0033--0x0081C7E0--0x0081C800--Hi-Potion/Hi-Potion+
0x0034--0x008173F0--0x00817410--X-Potion
0x0035--0x00811F50--0x00811F70--Mega-Potion
0x0036--0x0080CA90--0x0080CAB0--Everyone's Grudge
0x0037--0x00808800--0x00808820--Aqua Breath
0x0038--0x008031E0--0x00803200--Absorb
0x0039--0x007FD130--0x007FD150--Treatment
0x003A--0x007F7C90--0x007F7CB0--Elixir
0x003B--0x007F27F0--0x007F2810--Megalixir
0x003C--0x007EB070--0x007EB090--
0x003D--0x007E58A0--0x007E58C0--Revive
0x003E--0x007E4AB0--0x007E4B00--Devour
0x003F--0x006E6BF0--0x006E6BE0--
0x0040--0x006E5190--0x006E5180--Griever Tail Falling Off
0x0041--0x006E0360--0x006E0350--Great Attractor
0x0042--0x006225F0--0x00622610--Griever + Ultimecia Death
0x0043--0x007DEA00--0x007DEA20--Remedy/Remedy+
0x0044--0x007DC180--0x007DC1A0--
0x0045--0x005755F0--0x006FE040--Griever Summon
0x0046--0x006DD8E0--0x006DD8D0--Shockwave Pulsar
0x0047--0x007D6130--0x007D6150--Laser Eye (Quistis)
0x0048--0x007D1E60--0x007D1E80--Aqua Breath (Quistis)
0x0049--0x007CBD90--0x007CBDB0--Mighty Guard (Quistis)
0x004A--0x007C4440--0x007C4460--LV?Death (Quistis)
0x004B--0x00B3E8B0--0x00B3E8E0--Hell's Judgement
0x004C--0x0061F980--0x0061F9A0--Ultimecia Final Form Spawn
0x004D--0x00B302C0--0x00B302F0--Ultimecia Final Form Death
0x004E--0x007BE2B0--0x007BE2D0--Mighty Guard
0x004F--0x007B4BB0--0x007B4BD0--Griever Death
0x0050--0x007AB540--0x007AB560--Ultimecia Junctioning to Griever
0x0051--0x007A5190--0x007A51B0--
0x0052--0x0079EE10--0x0079EE30--Ultimecia Blow Away Magic
0x0053--0x007976A0--0x007976C0--Absorbed into time...
0x0054--0x0078D790--0x0078D7B0--Angel Wing
0x0055--0x00784480--0x007844A0--The End
0x0056--0x0077F230--0x0077F250--Angelo Cannon
0x0057--0x00773850--0x00773870--Angelo Strike
0x0058--0x007684D0--0x007684F0--Invincible Moon
0x0059--0x005755E0--0x006F9CF0--Wishing Star
0x005A--0x00762320--0x00762360--Tonberry Summon (Chef's Knife)
0x005B--0x00759350--0x00759370--Angelo Rush
0x005C--0x00755110--0x00755130--Angelo Search
0x005D--0x0074E370--0x0074E390--Angelo Recover
0x005E--0x007475D0--0x007475F0--Angelo Reverse
0x005F--0x00739D80--0x00739DA0--Siren Summon (Silent Voice)
0x0060--0x00731DC0--0x00731DE0--Moogle Dance
0x0061--0x00729A40--0x00729A60--ChocoFire
0x0062--0x00721840--0x00721860--ChocoFlare
0x0063--0x00717D10--0x00717D30--ChocoMeteor
0x0064--0x0070D370--0x0070D390--ChocoBocle
0x0065--0x006DD0D0--0x006DD0C0--
0x0066--0x006DC2B0--0x006DC2D0--Thundara
0x0067--0x006DA2E0--0x006DA300--Blizzara
0x0068--0x006D62F0--0x006D6310--Blizzaga
0x0069--0x006D3DC0--0x006D3DB0--Thundaga
0x006A--0x006D2AC0--0x006D2AE0--Reflect
0x006B--0x006D1320--0x006D1310--Demi
0x006C--0x006CFCE0--0x006CFCD0--Berserk
0x006D--0x006CF4B0--0x006CF4A0--Dispel
0x006E--0x006CE220--0x006CE210--Biggs + Wedge 1st Death
0x006F--0x006CD930--0x006CD920--Aura
0x0070--0x006CBBF0--0x006CBBE0--
0x0071--0x006CAC30--0x006CAC20--Bad Breath
0x0072--0x006C99D0--0x006C99C0--Zombie
0x0073--0x006C9390--0x006C9380--Float
0x0074--0x006C3560--0x006C3550--Quezacotl Summon (Thunder Storm)
0x0075--0x006C16B0--0x006C16A0--Break
0x0076--0x006C0C90--0x006C0C80--Aero
0x0077--0x006BEFE0--0x006BEFD0--Stop
0x0078--0x006BE970--0x006BE960--Petrify Stare
0x0079--0x006BDE90--0x006BDE80--Blind
0x007A--0x006BD8F0--0x006BD8E0--Silence
0x007B--0x006BD1D0--0x006BD1C0--Slow
0x007C--0x006BBDB0--0x006BBDA0--Flare
0x007D--0x006BB6C0--0x006BB6B0--Haste
0x007E--0x006B9A20--0x006B9A10--Electric Discharge
0x007F--0x006B93B0--0x006B93A0--Petrify Stare
0x0080--0x006B7D10--0x006B7D00--Gastric Juice
0x0081--0x006B4C10--0x006B4C00--Breath
0x0082--0x006B4250--0x006B4240--Eerie Sound Wave
0x0083--0x006B2BE0--0x006B2BD0--Bad Breath
0x0084--0x006B1A00--0x006B19F0--Disolving Acid
0x0085--0x006B0FC0--0x006B0FB0--Hypnotize
0x0086--0x006B0080--0x006B0070--Beam Laser
0x0087--0x006AEEB0--0x006AEEA0--Reflect Beam
0x0088--0x006AD1B0--0x006AD1A0--Oil Shot
0x0089--0x006AB860--0x006AB850--Oil Blast
0x008A--0x006A9F20--0x006A9F10--Saliva
0x008B--0x006A8840--0x006A8830--Sonic Wave
0x008C--0x006A6310--0x006A6300--Phoenix Pinion (Rebirth Flame)
0x008D--0x0061DE50--0x0061DE70--Renzokuken - 5 Hits
0x008E--0x0061CDF0--0x0061CE10--Fira
0x008F--0x0061BFC0--0x0061BFE0--Firaga
0x0090--0x0061AB80--0x0061ABA0--Blizzard
0x0091--0x006185B0--0x006185D0--Sleep
0x0092--0x00614D50--0x00614D70--Tornado
0x0093--0x00614270--0x00614290--Regen
0x0094--0x006120B0--0x006120D0--Meltdown
0x0095--0x0060F670--0x0060F690--Ultima
0x0096--0x0060E320--0x0060E340--Gatling Gun
0x0097--0x0060C9A0--0x0060C9C0--Cannon Blow
0x0098--0x0060AF90--0x0060AFB0--Ultrasonic Waves
0x0099--0x00609620--0x00609640--Sticky Web
0x009A--0x00607BF0--0x00607C10--Ultra Waves
0x009B--0x00606CD0--0x00606CF0--Sand Storm
0x009C--0x00605510--0x00605530--Wild Cannon Blow
0x009D--0x00603E70--0x00603E90--Breath
0x009E--0x00602EB0--0x00602ED0--Melt-Eye
0x009F--0x00600BA0--0x00600BC0--Renzokuken (vs X-ATM092)
0x00A0--0x005FF060--0x005FF080--Renzokuken - 4 Hits
0x00A1--0x005FD0E0--0x005FD100--Renzokuken (vs Elnoyle/Elvoret)
0x00A2--0x005F90D0--0x005F90F0--Fated Circle
0x00A3--0x005F5B60--0x005F5B80--Rough Divide
0x00A4--0x005F0240--0x005F0260--Blasting Zone
0x00A5--0x005E9450--0x005E9470--Lion Heart
0x00A6--0x005E4E70--0x005E4E90--Megido Flame
0x00A7--0x005E29F0--0x005E2A10--Zantetsuken
0x00A8--0x005E1730--0x005E1750--Sleeping Gas
0x00A9--0x005DEE40--0x005DEE60--Gastric Juice
0x00AA--0x005DC910--0x005DC930--Acid
0x00AB--0x005DB250--0x005DB270--Poison Gas
0x00AC--0x005D9CB0--0x005D9CD0--Morph
0x00AD--0x005D7490--0x005D74B0--Ice Breath
0x00AE--0x005D4580--0x005D45A0--Degenerator
0x00AF--0x005D1AB0--0x005D1AD0--Holy
0x00B0--0x005D00D0--0x005D00F0--Sand Storm
0x00B1--0x005CF740--0x005CF760--1,000 Needles
0x00B2--0x005CEDB0--0x005CEDD0--10,000 Needles
0x00B3--0x005CDF20--0x005CDF40--
0x00B4--0x005CC820--0x005CC840--Suicide
0x00B5--0x005CB530--0x005CB550--Kamikaze
0x00B6--0x005C9FC0--0x005C9FE0--Card
0x00B7--0x005C9A30--0x005C9A50--Defend
0x00B8--0x005C7FA0--0x005C7FC0--Ultra Waves (Quistis)
0x00B9--0x005C0D30--0x005C0D50--Shiva Summon (Diamond Dust)
0x00BA--0x005BF6D0--0x005BF6F0--Blaster
0x00BB--0x00575570--0x006472E0--Odin Summon (Zantetsuken)
0x00BC--0x005BE320--0x005BE340--Shot - Normal Shot
0x00BD--0x005BC940--0x005BC960--Wall
0x00BE--0x005BB2A0--0x005BB2C0--Chain Gun
0x00BF--0x00575560--0x0063E730--Doomtrain Summon (Runaway Train)
0x00C0--0x005B96D0--0x005B96F0--Shot - Scatter Shot
0x00C1--0x005B7170--0x005B7190--Shot - Dark Shot
0x00C2--0x005B4C40--0x005B4C60--Shot - Flame Shot
0x00C3--0x005B2A20--0x005B2A40--Shot - Canister Shot
0x00C4--0x005B18E0--0x005B1900--Shot - Quick Shot
0x00C5--0x005AED10--0x005AED30--Shot - Armor Shot
0x00C6--0x005AA3C0--0x005AA3E0--Shot - Hyper Shot
0x00C7--0x005A8730--0x005A8750--Cactuar Summon (1,000 Needles)
0x00C8--0x00575530--0x006391D0--No Mercy
0x00C9--0x00B25750--0x00B25780--Ifrit Summon (Hell Fire)
0x00CA--0x00B18970--0x00B189A0--Bahamut Summon (Mega Flare)
0x00CB--0x00B0C170--0x00B0C1A0--Cerberus Summon (Counter Rockets)
0x00CC--0x00AFFC70--0x00AFFCA0--Alexander Summon (Holy Judgment)
0x00CD--0x00AF44F0--0x00AF4520--Brothers Summon (Brotherly Love)
0x00CE--0x00AE2DA0--0x00AE2DD0--Eden Summon (Eternal Breath)
0x00CF--0x006A3AC0--0x006A3AB0--Maelstrom
0x00D0--0x00AD78D0--0x00AD7900--Final "Sorceress" Death
0x00D1--0x00575520--0x00637500--"Sorceress" Spawn
0x00D2--0x005755D0--0x006F6800--Bloodfest
0x00D3--0x00ACA0F0--0x00ACA120--Adel Death
0x00D4--0x006A0D30--0x006A0D20--
0x00D5--0x0069EAD0--0x0069EAC0--Storm Breath
0x00D6--0x0069D5C0--0x0069D5B0--Gravija
0x00D7--0x0069AB70--0x0069AB60--
0x00D8--0x006959F0--0x006959E0--
0x00D9--0x00694E70--0x00694E60--Energy Bomber
0x00DA--0x00575550--0x006326D0--
0x00DB--0x00ABD3F0--0x00ABD420--Terra Break
0x00DC--0x00AB32F0--0x00AB3320--Light Pillar
0x00DD--0x00AA5530--0x00AA5560--Apocalypse
0x00DE--0x00A9B1D0--0x00A9B200--Water
0x00DF--0x00A8F860--0x00A8F890--Meteor
0x00E0--0x00000000--0x00000000--
0x00E1--0x00000000--0x00000000--
0x00E2--0x00694530--0x00694520--White Wind
0x00E3--0x006937A0--0x00693790--Ultimecia First Death
0x00E4--0x00A85590--0x00A855C0--Ice Strike
0x00E5--0x00A7A9F0--0x00A7AA20--Homing Laser (Quistis)
0x00E6--0x00A70B40--0x00A70B70--Fire Breath (Quistis)
0x00E7--0x00A66470--0x00A664A0--Disease Breath
0x00E8--0x00A5C2B0--0x00A5C2E0--Breath of Death
0x00E9--0x00A51F10--0x00A51F40--Earthquake
0x00EA--0x00A488C0--0x00A488F0--Fart
0x00EB--0x00A3E340--0x00A3E370--Breath
0x00EC--0x00A34210--0x00A34240--Gas
0x00ED--0x00A29C00--0x00A29C30--Explosion
0x00EE--0x00A1FD90--0x00A1FDC0--Breath
0x00EF--0x00A15A00--0x00A15A30--Ochu Dance
0x00F0--0x00A0B330--0x00A0B360--Earthquake
0x00F1--0x00A01DE0--0x00A01E10--BGH251F2 Gatling Gun
0x00F2--0x009F7CE0--0x009F7D10--Beam Cannon
0x00F3--0x009EEA60--0x009EEA90--BGH251F2 1st Turret Exploding
0x00F4--0x009E57E0--0x009E5810--BGH251F2 2nd Turret Exploding
0x00F5--0x009DC560--0x009DC590--BGH251F2 3rd Turret Exploding
0x00F6--0x009D32E0--0x009D3310--BGH251F2 4th Turret Exploding
0x00F7--0x009C9860--0x009C9890--BGH251F2 Death
0x00F8--0x009C08A0--0x009C08D0--Soldier Entrance After BGH251F2 Death
0x00F9--0x009B7350--0x009B7380--
0x00FA--0x009ABFC0--0x009ABFF0--Beam Cannon
0x00FB--0x005755C0--0x006F44D0--Demon Slice
0x00FC--0x009A2840--0x009A2870--Corona
0x00FD--0x00997CE0--0x00997D10--Twin Homing Laser
0x00FE--0x0098D180--0x0098D1B0--Homing Laser
0x00FF--0x00982620--0x00982650--Homing Laser
0x0100--0x009793D0--0x00979400--Sand Shake
0x0101--0x0096F260--0x0096F290--Mega Flare
0x0102--0x009649D0--0x00964A00--Mad Cow Special
0x0103--0x005A6C00--0x005A6C20--Renzokuken - 6 Hits
0x0104--0x006906A0--0x00690690--Shockwave Pulsar (Quistis)
0x0105--0x009598A0--0x009598D0--Desperado
0x0106--0x0094F9C0--0x0094F9F0--Blood Pain
0x0107--0x009457E0--0x00945810--Massive Anchor
0x0108--0x00937E80--0x00937EB0--
0x0109--0x0092CBA0--0x0092CBD0--
0x010A--0x0091F5B0--0x0091F5E0--
0x010B--0x00911FC0--0x00911FF0--
0x010C--0x009049D0--0x00904A00--
0x010D--0x008F71F0--0x008F7220--
0x010E--0x008E9C00--0x008E9C30--Ultima Weapon Death
0x010F--0x0068F560--0x0068F550--LV Up
0x0110--0x0068DC80--0x0068DC70--LV Down
0x0111--0x0068D660--0x0068D650--Mad Rush
0x0112--0x006897F0--0x006897E0--Duel
0x0113--0x00687B50--0x00687B40--Electrocute (Quistis)
0x0114--0x00684EF0--0x00684EE0--
0x0115--0x00683F20--0x00683F10--
0x0116--0x00680C60--0x00680C50--Carbuncle Summon (Ruby Light)
0x0117--0x0067EFE0--0x0067EFD0--Mega Spark
0x0118--0x0067E740--0x0067E730--Full Cure
0x0119--0x0067DCF0--0x0067DCE0--Shotgun
0x011A--0x0067D410--0x0067D400--Evil-Eye
0x011B--0x0067C410--0x0067C400--Magic Summon
0x011C--0x0067B7B0--0x0067B7A0--Micro Missiles
0x011D--0x0067A870--0x0067A860--Thunder Summon
0x011E--0x00679E20--0x00679E10--Mini Pulse Cannon
0x011F--0x005755B0--0x006F2E80--Mega Pulse Cannon
0x0120--0x00679200--0x006791F0--Rapture
0x0121--0x006777F0--0x006777E0--"Brrawghh!"
0x0122--0x00675290--0x00675280--
0x0123--0x005755A0--0x006ED250--Pandemona Summon (Tornado Zone)
0x0124--0x00674DA0--0x00674D90--Soft
0x0125--0x00674880--0x00674870--Eye Drops
0x0126--0x00674400--0x006743F0--Antidote
0x0127--0x00673E80--0x00673E70--Echo Screen
0x0128--0x00673980--0x00673970--Holy Water
0x0129--0x00673010--0x00673000--White Wind (Quistis)
0x012A--0x00670980--0x00670970--
0x012B--0x0066FCD0--0x0066FCC0--Micro Missiles (Quistis)
0x012C--0x0066EF10--0x0066EF00--Bad Breath (Quistis)
0x012D--0x0066D8F0--0x0066D8E0--
0x012E--0x0066CA60--0x0066CA50--Snipe Laser
0x012F--0x0066A830--0x0066A820--
0x0130--0x006697A0--0x00669790--Boomerang Sword
0x0131--0x005A57B0--0x005A57D0--Gatling Gun (Quistis)
0x0132--0x005A2C70--0x005A2C90--Degenerator (Quistis)
0x0133--0x005A1150--0x005A1170--Ray-Bomb (Quistis)
0x0134--0x00667680--0x00667670--
0x0135--0x00666DE0--0x00666DD0--Hero-trial/Hero
0x0136--0x006664B0--0x006664A0--Holy War-trial/Holy War
0x0137--0x006652D0--0x006652C0--
0x0138--0x0059CB70--0x0059CB90--
0x0139--0x0059B0B0--0x0059B0D0--
0x013A--0x006628A0--0x00662890--
0x013B--0x00598D90--0x00598DB0--Fake President Death
0x013C--0x006610C0--0x006610B0--
0x013D--0x0065F850--0x0065F840--Acid (Quistis)
0x013E--0x0065E520--0x0065E510--
0x013F--0x0065DB40--0x0065DB30--
0x0140--0x0065BC20--0x0065BC10--Dark Flare
0x0141--0x005979E0--0x00597A00--Ker Plunk
0x0142--0x0065AB80--0x0065AB70--Zan
0x0143--0x00659A90--0x00659A80--Metsu
0x0144--0x00596BA0--0x00596BC0--Tonberry King Death
0x0145--0x006541F0--0x006541E0--Diablos Summon (Dark Messenger)
0x0146--0x00575540--0x0062A7E0--Zantetsuken Reverse
0x0147--0x0058D6E0--0x0058D760--Gilgamesh - Zantetsuken
0x0148--0x0058D700--0x0058D930--Gilgamesh - Masamune
0x0149--0x0058D720--0x0058DB10--Gilgamesh - Excaliber
0x014A--0x0058D740--0x0058DCF0--Gilgamesh - Excalipoor
0x014B--0x008DFF70--0x008DFFA0--
0x014C--0x0058B910--0x0058B930--Renzokuken - 7 Hits
0x014D--0x00589BB0--0x00589BD0--Renzokuken - 8 Hits
0x014E--0x00587770--0x00587790--Renzokuken (vs Bahamut)
0x014F--0x00585690--0x005856B0--Renzokuken (vs NORG)
0x0150--0x00583020--0x00583040--Renzokuken (vs Ultima Weapon)
0x0151--0x00580970--0x00580990--Renzokuken (vs Final "Sorceress")
0x0152--0x00575590--0x006EBD50--Friendship (MoombaMoomba)
0x0153--0x0057E5B0--0x0057E5D0--Renzokuken (vs Adel)
0x0154--0x0057BBE0--0x0057BC00--Renzokuken (vs Ultimecia Final Form)
0x0155--0x00579A60--0x00579A80--Renzokuken (vs Jumbo Cactuar)
0x0156--0x005776B0--0x005776D0--Renzokuken (vs Griever + Ultimecia)
0x0157--0x00575630--0x00575650--Renzokuken (vs Griever)
0x0158--0x00575580--0x0062A650--Final Battle Music
0x0159--0x00705A60--0x00705A80--LV5 Death


LV5 Death is definitely the max magic ID because all the pointers after that are NULL. Most of the missing ones are probably main boss death anims and there's also 2 NULL ones (0xE0 and 0xE1), I've just left them in for the sake of continuity.

EDIT: Managed to find a couple of limit breaks :D - There appear to be at least 2 sets for Renzokuken though =/ - different crisis levels or vs different enemies?
According to the code, the magic IDs go up to 400 - Illegal Magic ID error gets thrown higher than this - see function 0x50AF20
There's a lookup table of DWORDs in memory starting at 0xC81774 (1 is subtracted from the ID first) - looks like a series of function pointers, these probably do most of the work for each magic ID.
0xC81DB8 contains a series of function pointers for the IDs (after subtracting 1) listed above and those functions seem to load textures.

EDIT 1: I put a breakpoint at 0x50AF2E - ESI will contain the magic ID at this point, so I can get the magic ID from any attack that's used, it's like learning Blue Magic :D.
So many Renzokuken IDs >_> - think I managed to get all 16 of them

EDIT 2: Some data located here: http://gamehacking.org/czardragon/FF8/FF8-Code.txt
« Last Edit: 2016-05-06 23:45:49 by JWP »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #20 on: 2016-05-02 22:28:48 »
Making progress :D




Goodbye Card Mod   :-D


« Last Edit: 2016-05-03 02:38:15 by alexfilth »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #21 on: 2016-05-03 00:13:31 »
0x0F78 - Junctionable GFs - 16 items - 132 bytes each

Code: [Select]
0x0F78 - Quetzacotl
0x0FFC - Shiva
0x1080 - Ifrit
0x1104 - Siren
0x1188 - Brothers
0x120C - Diablos
0x1290 - Carbuncle
0x1314 - Leviathan
0x1398 - Pandemona
0x141C - Cerberus
0x14A0 - Alexander
0x1524 - Doomtrain
0x15A8 - Bahamut
0x162C - Cactuar
0x16B0 - Tonberry
0x1734 - Eden


-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Code: [Select]
2 bytes - Offset to GF attack name
2 bytes - Offset to GF attack description
2 bytes - Magic ID
1 byte - Unknown
1 byte - GF Power
5 bytes - Unknown
1 byte - Element
0x00 - Non-elemental
0x01 - Fire
0x02 - Ice
0x04 - Thunder
0x08 - Earth
0x10 - Poison
0x20 - Wind
0x40 - Water
0x80 - Holy
1 byte - status
1 byte - status
1 byte - status
1 byte - status
1 byte - status
1 byte - Unknown
1 byte - GF HP Modifier
6 bytes - Unknown
1 byte - Status Attack Enabler
0x00 - disabled
0xFE - enabled (i need to test other values)
2 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
3 bytes - Unknown
1 byte - Ability
19 bytes - Unknown
1 byte - Power Mod (used in damage formula)
1 byte - Level Mod (used in damage formula)


Ability Values
Code: [Select]
0x01 - HP-J
0x02 - STR-J
0x03 - VIT-J
0x04 - MAG-J
0x05 - SPR-J
0x06 - SPD-J
0x07 - EVA-J
0x08 - HIT-J
0x09 - LUCK-J
0x0A - Elem-Atk-J
0x0B - ST-Atk-J
0x0C - Elem-Def-J
0x0C - ST-Def-J
0x0E - Elem-Defx2
0x0F - Elem-Defx4
0x10 - ST-Def-Jx2
0x11 - ST-Def-Jx4
0x12 - Abilityx3
0x13 - Abilityx4
0x14 - Magic
0x15 - GF
0x16 - Draw
0x17 - Item
0x18 - Empty*
0x19 - Card
0x1A - Doom
0x1B - MadRush
0x1C - Treatment
0x1D - Defend
0x1E - Darkside
0x1F - Recover
0x20 - Absorb
0x21 - Revive
0x22 - LVDown
0x23 - LVUp
0x24 - Kamikaze
0x25 - Devour
0x26 - MiniMog
0x27 - HP+20%
0x28 - HP+40%
0x29 - HP+80%
0x2A - Str+20%
0x2B - Str+40%
0X2C - Str+60%
0X2D - Vit+20%
0X2E - Vit+40%
0X2F - Vit+60%
0X30 - Mag+20%
0X31 - Mag+40%
0X32 - Mag+60%
0X33 - Spr+20%
0X34 - Spr+40%
0X35 - Spr+60%
0X36 - Spd+20%
0X37 - Spd+40%
0X38 - Eva+30%
0X39 - Luck+50%
0X3A - Mug
0X3B - MedData
0X3C - Counter
0X3D - Return Damage
0X3E - Cover
0X3F - Initiative
0x40 - Move-HPUp
0x41 - HPBonus
0x42 - StrBonus
0x43 - VitBonus
0x44 - MagBonus
0x45 - SprBonus
0x46 - Auto-Protect
0x47 - Auto-Shell
0x48 - Auto-Reflect
0x49 - Auto-Haste
0x4A - Auto Potion
0x4B - Expendx2-1
0x4C - Expendx3-1
0x4D - Ribbon (requires 1 ap to be learned)
0x4E - Alert
0x4F - Move-Find
0x50 - Enc-Half
0x51 - Enc-None
0x52 - RareItem
0x53 - SumMag+10%
0x54 - SumMag+20%
0x55 - SumMag+30%
0x56 - SumMag+40%
0x57 - GFHP+10%
0x58 - GFHP+20%
0x59 - GFHP+30%
0x5A - GFHP+40%
0x5B - Boost
0x5C - Haggle
0x5D - Sell-High
0x5E - Familiar
0x5F - CallShop
0x60 - JunkShop
0x61 - T Mag-RF
0x62 - IMag-RF
0x63 - FMag-RF
0x64 - LMag-RF
0x65 - TimeMag-RF
0x66 - STMag-RF
0x67 - SuptMag-RF
0x68 - ForbidMag-RF
0x69 - RecovMed-RF
0x6A - STMed-RF
0x6B - Ammo-RF
0x6C - Tool-RF
0x6D - ForbidMed-RF
0x6E - GFRecovMed-RF
0x6F - GFAblMed-RF
0x70 - Mid Mag-RF
0x71 - HighMag-RF
0x72 - MedLVUp
0x73 - Card Mod

*Command Ability that does nothing, if equipped it's an unselectable empty space in battle. Maybe just a placeholder for something they wanted to use.
« Last Edit: 2016-05-24 00:38:51 by alexfilth »

Kefka

  • *
  • Posts: 202
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #22 on: 2016-05-06 18:20:27 »
Wow, I'm amazed by how much progress has been made on FF8 in one single week! Finally, being able to edit spells, junction boosts, GF abilities, stat growth etc., that's something I've been eagerly awaiting for ages, glad to see that it's finally possible. One question, though, does anybody plan on making an editor for all this stuff? That would greatly help in making the entire editing process more comfortable. I'd do it myself if only I knew how. Anyway, kudos to all of you who worked on uncovering these things, you rock!

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #23 on: 2016-05-06 20:28:32 »
I'm currently learning C#, if by the time i'm competent enough with it to make an editor and one is not available yet then i'll do it.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #24 on: 2016-05-06 21:57:20 »
I could but I don't think I'd have enough time to reverse engineer stuff and make an editor :(