Qhimm.com Forums

Miscellaneous Forums => Gameplay => Topic started by: nejay on 2011-10-05 13:50:36

Title: FFVII: Changing Weapon Damage formulas
Post by: nejay on 2011-10-05 13:50:36
I was wondering if anyone knew of a gameshark code to change the damage formulas on wepons for the PSX version.  I wanted to change arround some of the ultimate weapons.  I have searched many different sites but have never come accross codes for it. I came across this http://wiki.qhimm.com/FF7/Damage_Calculation (http://wiki.qhimm.com/FF7/Damage_Calculation), where the ultimate weapons fomulas are the last ones (AX) but I do not know how to make a code out of it.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Tenko Kuugen on 2011-10-05 14:02:07
just use wallmarket?
see the tool section
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-05 15:41:21
just use wallmarket?
see the tool section

There's an interesting feature. Convert changes to Gameshark codes... That could get pretty long. I don't know how GS codes work anyway.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nejay on 2011-10-05 17:32:38
Thanks, the wallmarket program is cool.  I figured out the gameshark code to change the damage formulas using info from this site and some other gameshark codes.  I wanted the gameshark code because I like playing on the old PS sometimes. I know the Lion Editor (which is a game editor for Final Fantasy Tactics similar to Wallmarket) has a feature that shows the gameshark code when something is edited but it seems like the coding for FF7 has more to it then FFT.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Bosola on 2011-10-05 19:58:36
If you want to mod the PSX version, just insert your updated KERNEL.BIN into an ISO with a tool like CDMage.


As for the Gameshark, I don't *actually* know *how* it works. Perhaps there's a common hook to all PSX executables (eg a common set of opcodes for frame drawing), and the device just arbitrarily adds some asm that manually handles the addresses to commandeer?
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: sl1982 on 2011-10-05 21:25:30
As far as i know the gameshark works like a hex editor for memory. It can basically override any value in memory and force it to what the user desires.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-05 22:29:34
The Game Genie used to intercept requests for specific ROM addresses and return whatever value the code specifies. I think the GS has that capability, but it's primarily used to modify RAM. I don't know how to "intercept" requests like that. Best thing to try is find out where the KERNEL.BIN data gets loaded into memory and modify those addresses. It'd probably be different for each version though and possibly from firmware to firmware.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Bosola on 2011-10-06 19:51:02
As far as i know the gameshark works like a hex editor for memory. It can basically override any value in memory and force it to what the user desires.

Yes, but how does it *work*? How does it do that?

Do Gameshark / Action Replay CDs launch some sort of wrapper for all executables launched afterwards? Do GS devices, by sitting in the serial port, get to arbitrarily poke bytes at regular intervals? Or do they insert memory-handling ASM as some kind of hook defined by the address in the 'master' code?
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-06 20:45:35
Yes, but how does it *work*? How does it do that?

Do Gameshark / Action Replay CDs launch some sort of wrapper for all executables launched afterwards? Do GS devices, by sitting in the serial port, get to arbitrarily poke bytes at regular intervals? Or do they insert memory-handling ASM as some kind of hook defined by the address in the 'master' code?

It'd have to be a wrapper. My understanding is this.
You have a GS CD that allows you to program the Game Shark with the codes you want. This is how it knows what addresses to replace at what times. At some point after selecting the codes you want, you will be prompted to change discs without resetting or powering off. Once you have the new disc in, the game starts.
That's the key. If the GS itself could be polled by the system and make appropriate changes you wouldn't have to boot with the CD. You could just slap the GS on and go. What seems to happen is the GS CD is an API wrapper. Providing normal functionality of the PSX while incrementally telling the GS to do its thing.
What are master codes for? Not sure. My guess would be that a particular address has to be set to something first before the PSX allows memory modification from an external source. Like a Debug Mode RAM-write hardware interrupt (sounds kind of slow though). This would have to be semi-unique for each game as a sort of anti-cheat measure. It's likely a software handled check though since emulators require master codes too. That might just be the emulator being TOO accurate at emulating, though.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nejay on 2011-10-07 20:35:38
I have a gameshark that plugs into the serial port of the ps1 and if I remember correctly I read a while back that it reads the game code before the system does, modifies the code, and then sends it to the system to be read. I dont know how the gameshark work when it uses a disk and saves the codes to a memory card.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nejay on 2011-10-07 20:59:41
On another note I was wondering if anyone could help me figure out the sequence of the code...

Using http://wiki.qhimm.com/FF7/Kernel/Kernel.bin (http://wiki.qhimm.com/FF7/Kernel/Kernel.bin) and http://wiki.qhimm.com/FF7/Weapon_data (http://wiki.qhimm.com/FF7/Weapon_data) I was able to figure out the gameshark sequence of all the weapon data.

It starts with 300738A0 xxxx with the "Target Flags" of the Buster Sword (the first 8 digits are the address of the attribute and the last 4 digits are the modifiers).  Each weapon has 44 bytes so there are 44 addresses for each weapon.  So the Mythril Sabre begins on  300738CC xxxx for its "Target Flags". There are 128 weapons, with the Masamune as the last one.  The last address for the Masamune is 30074E9F xxxx.

This is where the problem comes in.  The next section should be armor.  It says that there is a 6 byte header for each section so I skip six addresses after the Masamune and start trying to code the addresses for the armor but no addresses I have tried has worked.  There should be 36 bytes (addresses) for each armor.  There must be more coding after the Masamune or in the header section of the armor.  If anyone knows some of the coding it would be very helpful.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: xLostWingx on 2011-10-08 02:50:46
Sounds like you've got a GSPro.  Thats what I got and what I was using with my old PS until I started doing the same thing with EpsxE and PEC (psx emulation cheater) plugin.  After a month or two I rediscovered quimm and began modding the PSX version and the experience has been more rewarding than Gamesharking ever was.  That being said,

I never tried messing with the damage formulas for weapons with the GS, but I did mess around with elements, statuses, materia slots, attributes and stat bonuses of weapons, armor and accessories.  If you havent already been using Gamehacking.org (previously GSHI) and Anti-GSC.com (http://viper.shadowflareindustries.com/antigsc/?codes=) there may be some helpful information in the code banks or on the forums.  Wish I could help more, but I think that someone here will be able to help you.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-09 00:23:05
This is where the problem comes in.  The next section should be armor.  It says that there is a 6 byte header for each section so I skip six addresses after the Masamune and start trying to code the addresses for the armor but no addresses I have tried has worked.  There should be 36 bytes (addresses) for each armor.  There must be more coding after the Masamune or in the header section of the armor.  If anyone knows some of the coding it would be very helpful.

You're confusing the data with the compressed storage. There's only a six byte header in the KERNEL.BIN file itself, not the data. Don't include those six bytes and see what happens. There's a flat number of armors and accessories so those should be side by side if they're stored the way the PC stores them.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2011-10-23 10:52:45
but this is not possible on the pc, right? no gameshark...
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-24 14:01:21
but this is not possible on the pc, right? no gameshark...

There actually IS (or at least was) a GS for PC. I don't know where to get one now though. You could use Cheat Engine to simulate the effects. Or you could do the obvious thing and use WallMarket.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2011-10-24 14:20:11
WallMarket, even if it is an almighty program that allows game editing up to degrees unthinkable before, can't actually "change" damage formulas. only use pre-existing ones :P not possible, for example, to make a formula like Yuffie's Conformer, but magical rather than physical.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Vgr on 2011-10-24 14:21:39
NFITC1, we resquest your awesome knowledge to make Wall Market and Proud Clod able to implement new damage formulas :)
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2011-10-24 14:30:59
I don't believe that is possible, that probably would require editing the EXE and WallMarket works on BIN files.
even more important that that, however, NFITC1 has a gorgeous, tender and wonderful baby to take care of. he's probably thinking of improving WallMarket with the same willingness to endure surgery without anesthesia!
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2011-10-24 15:40:52
WallMarket, even if it is an almighty program that allows game editing up to degrees unthinkable before, can't actually "change" damage formulas. only use pre-existing ones :P not possible, for example, to make a formula like Yuffie's Conformer, but magical rather than physical.

Because that's not possible. There's not a damage Magical damage formula that will use the multipliers.

NFITC1, we resquest your awesome knowledge to make Wall Market and Proud Clod able to implement new damage formulas :)

http://www.youtube.com/watch?v=gvdf5n-zI14

I don't believe that is possible, that probably would require editing the EXE and WallMarket works on BIN files.
even more important that that, however, NFITC1 has a gorgeous, tender and wonderful baby to take care of. he's probably thinking of improving WallMarket with the same willingness to endure surgery without anesthesia!

Correct on all fronts.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2011-10-24 15:55:43
too bad tho. the physical damage formulas DO need to be toned down somewhat.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2011-11-22 07:28:34
maybe the self-appointed EXEmaster could shed some light on this? I read the exe text documentation but it won't show any actual damage formula.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: TrckyGmr on 2011-12-30 05:26:18
I was thinking this ages ago, on psx I can use gameshark codes for modifying weapons and seen only editing its element attack, status, but I'd been searching damage formula modifier and find none, was this thing found?
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: TrckyGmr on 2011-12-30 05:52:45
I end up editing cloud's weapon to death penalty instead equipping him with ultima weapon


Instead of posting twice when you haven't a major update, or when not much time has passed, just edit your original post instead - Bosola
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nmn132 on 2012-11-14 04:40:23
Does anyone know the address of the damage formulas? I would like to make new formulas out of the less useful ones. Is there a ROM map of FF7 on this site?
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Tenko Kuugen on 2012-11-14 11:20:24
you can't really make new damage formulas
you can only assign one of the existing ones to attacks/weapons/items
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2012-11-14 14:25:22
you can't really make new damage formulas
you can only assign one of the existing ones to attacks/weapons/items

YOU may not be able to......

Making a new damage formula is tricky. There's a lot involved, but there are a few slots of unused base damage functions in the secondary formulae (X2 - X7) to squeeze in a few other damage types. The unused 7X damage base could be used for magical attacks and the 6X could be used for physical attacks. The only problem is actually writing the function. It's not hard if you know x86 asm, but would require knowledge of memory addresses like weapon strengths and armor values and such. I know where most of that is so I could get someone started on working a new damage formula by supplying those address and a suitable sized chunk of unused code (http://forums.qhimm.com/index.php?topic=13618.0).
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Tenko Kuugen on 2012-11-14 14:55:19
YOU may not be able to......

Making a new damage formula is tricky. There's a lot involved, but there are a few slots of unused base damage functions in the secondary formulae (X2 - X7) to squeeze in a few other damage types. The unused 7X damage base could be used for magical attacks and the 6X could be used for physical attacks. The only problem is actually writing the function. It's not hard if you know x86 asm, but would require knowledge of memory addresses like weapon strengths and armor values and such. I know where most of that is so I could get someone started on working a new damage formula by supplying those address and a suitable sized chunk of unused code (http://forums.qhimm.com/index.php?topic=13618.0).

Do I really need to write everytime "It's possible but not propable without some effort from some specific people in the forum" instead of "you can't do it"? It has the same end result, most of the time
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2012-11-14 15:09:25
YOU may not be able to......

Making a new damage formula is tricky. There's a lot involved, but there are a few slots of unused base damage functions in the secondary formulae (X2 - X7) to squeeze in a few other damage types. The unused 7X damage base could be used for magical attacks and the 6X could be used for physical attacks. The only problem is actually writing the function. It's not hard if you know x86 asm, but would require knowledge of memory addresses like weapon strengths and armor values and such. I know where most of that is so I could get someone started on working a new damage formula by supplying those address and a suitable sized chunk of unused code (http://forums.qhimm.com/index.php?topic=13618.0).
that would be awesome. how many of those unused spaces are available?
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2012-11-14 15:35:19
Do I really need to write everytime "It's possible but not propable without some effort from some specific people in the forum" instead of "you can't do it"? It has the same end result, most of the time

"You can't do it" is too definite. It's possible in the context of the question this guy's asking. He's wanting to know how to do it by altering the exe which IS possible.

that would be awesome. how many of those unused spaces are available?

Basically just the ones I mentioned. X2 - X7 of the secondary formulae.
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2012-11-14 15:43:29
that means 5. still good. thanks!
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Tenko Kuugen on 2012-11-14 15:44:44
X2, X3, X4, X5, X6, X7 makes 6
balancing new damage formulas will be an absolute nightmare
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: Dark_Ansem on 2012-11-14 15:57:11
not if they are similar to existing ones.
for example, I am thinking of one same to yuffie's conformer but that inflict magic damage, rather than physical
Title: Re: FFVII: Changing Weapon Damage formulas
Post by: nfitc1 on 2012-11-14 21:34:11
not if they are similar to existing ones.
for example, I am thinking of one same to yuffie's conformer but that inflict magic damage, rather than physical

To do that you'd have to create a new upper nybble consideration function which is more complicated. The game could use a magical version of those multipliers for overall balance, yes? Without further modification, it'd be forced to use damage formula X1, but that could always be re-handled.

Based on the existing formulae, here's what's possible:

Code: [Select]
Damage                  Physical  Magical
Standard                 yes       yes
Special                  yes       yes (albeit unused)
Standard w/Multipliers   kinda     no
Special w/Multipliers    no        no

The multipliers would only multiply damage done by the special formulae which could make them less predictable. Only multipliers 0, 1, and 2 would have any effect, but then the results like MHP - HP wouldn't be as exact anymore. We could probably do without that whole category.

Standard w/Multipliers defaults to standard formula X1. It can be forcibly changed to use one of the others, but it's still universal to the multipliers category.