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

SunnyD

  • *
  • Posts: 36
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #25 on: 2016-05-07 23:39:35 »
Sorry for being quiet. University deadlines eating up my time. Awesome to see what's been discovered over the past week. And thanks for the answers too :)

Kefka

  • *
  • Posts: 202
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #26 on: 2016-05-11 18:11:56 »
Quote
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 unk;
   BYTE attack_power;
   BYTE hit_bonus;
   BYTE str_bonus;
   BYTE weapon_tier;
   BYTE unk[2];
}

A question about the weapon data: the strength bonus is the increase towards a character's strength stat once the weapon is bought, right? That's what pretty much all websites list as the weapon's attack power. However, here seems to be an additional attack power byte which is the same for every single weapon (just looked in the kernel, and all weapons have a value of 20 for their attack power). What is this byte used for? Is it an additional but invisible strength increase? Or does it serve a different purpose in damage calculation? I'm just confused because all guides around the web always refer to the strength bonus when talking about a weapon's attack power.

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 #27 on: 2016-05-11 19:29:48 »
I'd be willing to offer design help for any potential editor author.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #28 on: 2016-05-11 19:53:11 »
A question about the weapon data: the strength bonus is the increase towards a character's strength stat once the weapon is bought, right? That's what pretty much all websites list as the weapon's attack power. However, here seems to be an additional attack power byte which is the same for every single weapon (just looked in the kernel, and all weapons have a value of 20 for their attack power). What is this byte used for? Is it an additional but invisible strength increase? Or does it serve a different purpose in damage calculation? I'm just confused because all guides around the web always refer to the strength bonus when talking about a weapon's attack power.

str_bonus is the value that is added to the strength stat when you buy the weapon.
attack_power is an additional byte that's use in damage calculation, so it would also give a damage increase if higher than the previous weapon.
See section 4.1 of this guide in step 3:
Step 3: Base Damage Calculation

  Damage = AttackerStr^2 / 16 + AttackerStr
  Damage = Damage * (265 - TargetVit) / 256
  Damage = Damage * Power / 16

  Note: A normal attack has a Power value of 20

EDIT: I haven't actually tested changing the byte but I made an educated guess as to what it is.
« Last Edit: 2016-05-11 20:00:08 by JWP »

SunnyD

  • *
  • Posts: 36
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #29 on: 2016-05-11 20:02:03 »
--------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, see: http://gamehacking.org/czardragon/FF8/FF8.TXT
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 - ? - 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 - ?
25 - 0x4A5C - Rinoa limit breaks - 2 items - 8 bytes each
26 - 0x4A6C - Rinoa limit breaks - 5 items - 20 bytes each
27 - 0x4AD0 - ?
28 - 0x4B0C - ? - 16 bytes each?
29 - 0x4C0C - Devour - 16 items - 12 bytes each
30 - 0x4CCC - ?
31 - 0x4D08 - Misc text pointers - 128 items - 2 bytes each

I've set my hex editor to 24 bytes so I can have a look at Shot so I can look at Limit damage. But on my kernel.bin it goes from 0x47E8 to 0x4800. No 0x47F8 to be found. Maybe I'm doing something wrong.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #30 on: 2016-05-11 20:08:58 »
The actual offset of a byte is the number on the left + the number on the top, the number on the left is the offset of the first byte in the row.
The offset you're looking for isn't on the left in this case due to alignment but that doesn't mean that it doesn't exist.

You're not always going to get data that aligns the way you want it to (first byte of a row being the start of a section) due to all the sections having different sizes that (in your case) aren't multiples of 24.
« Last Edit: 2016-05-11 20:17:24 by JWP »

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #31 on: 2016-05-11 20:41:53 »
I started to work on an editor, but don't get excited, there is very little code at the moment and it's going to be a very long time before this see the light of day (if ever).
I'm pretty much done with the magic section of the gui and i think i managed to load and save the kernel.bin correctly, now i'm struggling to make the editor actually edit something lol. At the moment i have pretty much no idea how to "connect" all the edit boxes to the bytes of the file, if anyone here knows C# well and is willing to help feel free to send me a PM.


Kefka

  • *
  • Posts: 202
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #32 on: 2016-05-12 06:51:32 »
@JWP: ah, thanks, so the power used in the 3rd formula is referring to the weapon's attack power. That makes sense. I've seen that guide before (some years ago), but I couldn't understand the weapon's role in damage calculation, as it just says "a normal attack has a power o 20". If it said "weapon's power" instead of just power and "all weapons in the game have a power value of 20", then it would have been more clear.

@alexfilth: wow, that's like music to my ears! I can't help but feel excited even though you say it's not a lot at the moment, but I'd say it's a good start. And Doomtrain is a pretty cool name 8).

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #33 on: 2016-05-12 13:23:12 »
The 20 attack power is for basic attacks mind, other skills that use str e.g. renzokuken use different power values.

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #34 on: 2016-05-23 10:31:32 »
Just wanting to let you know that things are moving forward with the kernel editor, MaKi is helping with pretty much all the code. An initial release shouldn't be that far away. :)

volvania

  • *
  • Posts: 48
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #35 on: 2016-05-23 11:22:09 »
i will make this post in my fav waiting impatiently every second  :-D :D

SunnyD

  • *
  • Posts: 36
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #36 on: 2016-05-23 11:25:56 »
Just wanting to let you know that things are moving forward with the kernel editor, MaKi is helping with pretty much all the code. An initial release shouldn't be that far away. :)

Awesome. Looking forward to it. Would be good to see some progress on VIII modding.

Kefka

  • *
  • Posts: 202
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #37 on: 2016-05-23 16:26:09 »
Just wanting to let you know that things are moving forward with the kernel editor, MaKi is helping with pretty much all the code. An initial release shouldn't be that far away. :)

This is awesome news, I'm really looking forward to it! :)

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #38 on: 2016-05-24 00:36:51 »
10 - 0x3EE0 - Non-junctionable GF attacks - 16 items - 20 bytes each

Code: [Select]
Zantetsuken (Odin)
Rebirth Flame (Phoenix)
ChocoFire (Boko)
ChocoFlare (Boko)
ChocoMeteor (Boko)
ChocoBocle (Boko)
Moogle Dance (MiniMog)
Excaliber (Gilgamesh)
Excalipoor (Gilgamesh)
Masamune (Gilgamesh)
Excalibur (Gilgamesh)
Zantetsuken (Gilgamesh)
Angelo Rush (Angelo)
Angelo Recover (Angelo)
Angelo Reverse (Angelo)
Angelo Search (Angelo)
Friendship (Moomba)


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


Code: [Select]
2 bytes - Offset to attack name
2 bytes - Magic ID
1 bytes - Unknown
1 bytes - Power
1 byte - Status Enabler
0x00 - disabled
0xFE - enabled (i need to test other values)
4 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 - Power Mod
1 byte - Level Mod

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #39 on: 2016-05-30 01:54:14 »
0x4218 - Stat percentage increasing abilities - 19 items - 8 bytes each

Code: [Select]
HP+20%
HP+40%
HP+80%
STR+20%
STR+40%
STR+60%
VIT+20%
VIT+40%
VIT+60%
MAG+20%
MAG+40%
MAG+60%
SPR+20%
SPR+40%
SPR+60%
SPD+20%
SPD+40%
EVA+30%
LUCK+50%


Code: [Select]
2 bytes - offset to stat percentage name
2 bytes - offset to stat percentage description
2 bytes - unknown
1 byte - increasement value
1 byte - unknown


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


44 - 0x8000 - Stat percentage increasing abilities text

Code: [Select]
7 bytes - name
5 bytes - unknown
7 bytes - description

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #40 on: 2016-06-10 12:52:24 »
We now know what every kernel.bin section does :), see this post.
I'm currently working with alexfilth to get Doomtrain steaming ahead :) - also a big thanks to Maki for the bulk of the coding groundwork.

volvania

  • *
  • Posts: 48
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #41 on: 2016-06-10 22:16:44 »
IM SOO hyped is there an eta so i can check in when its done , my work will be complete finally :DDDDDD i love you guys and i admire your intellegence and work i really do omg!!

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #42 on: 2016-06-10 22:56:58 »
Probably a while, 4/30 data sections have all of the known data done (Magic, GFs, GF Attacks and Weapons), two more have a GUI and alexfilth is working on the code for the Character section atm (with pretty graphs).
If you want to test it, you can use Visual Studio Community to compile it from the git repo.

Kefka

  • *
  • Posts: 202
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #43 on: 2016-06-11 06:01:27 »
Once again, excellent work guys! I'm hyped for this editor as well! Can't wait to get my hands on it!

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #44 on: 2016-06-11 15:25:20 »
Impatient to use this tool. :D I had a look at it and I have a question: do you think it will be posible to edit the amount of AP for the GF's abilities ? For example giving 20 APs to learn for the Draw command.

JWP

  • *
  • Posts: 194
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #45 on: 2016-06-11 16:14:14 »
It's likely that will be in the abilities sections and it will be added if we find the data for it.
The draw command seems to be an odd case though as it's not in any of the ability lists for GFs (according to alexfilth's research), so I'm not sure about that particular case.

Callisto

  • *
  • Posts: 303
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #46 on: 2016-06-11 17:02:30 »
I have a question: do you think it will be posible to edit the amount of AP for the GF's abilities ? For example giving 20 APs to learn for the Draw command.
Yes, I can say for certain that it is possible to edit the required AP for each Ability in kernel.bin. If you want to try for yourself: The ability list starts at offset 0x40E4 in this order (see Ability values).

JWP, whether a GF learns the Draw Ability or not seems to be set in init.out for some reason.

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #47 on: 2016-06-11 22:39:41 »
Well, I totally don't know how to do that, I will wait for the tool to be finished. ^^

alexfilth

  • *
  • Posts: 38
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #48 on: 2016-06-12 03:28:58 »
We documented a lot of kernel sections tonight. :P

It's going to take some time to put everything in the editor, don't quote me on this (i didn't talk with JWP and Maki) but i think we might release a first version when we're happy with the sections that are currently in (magic, GFs, characters, weapons, blue magic and maybe some abilities).

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: How do I edit damage formulas? [FFVIII]
« Reply #49 on: 2016-06-16 07:31:15 »
Do you think you can also find a way to edit the stores ? It's really bad to have lots of items at the beginning of the game.