Author Topic: help with spell damage  (Read 15998 times)

comet2

  • *
  • Posts: 31
    • View Profile
help with spell damage
« on: 2006-06-25 05:59:57 »
Hello,

I have often browsed this forum and gleaned a lot of useful information through the insightful posts. I decided to take the plunge of showing my ignorance by posting here because I feel that I do not have any other choice.

As you can see from my nickname, I am interested in the comet2 spell.

Comet 2 is a unique spell in FF7 in that it hits 4 times and can be Quadra-Magic-ed.

With a W-magic and Quad-Magic, you can potentially hit your opponent 4*4*2=32 times per turn.

Note that KotR hits 13 times and cannot be Quadra-magic-ed, meaning that at most it can hit 26 times per turn.

This matters the most in boss battles (namely emerald and ruby weapon), where there's only one target for you to hit.

Hence, I have been trying to find a way to crank up the dmg I can get from comet2. I've tried everything from multiple MP turbos, Magic pluses, etc etc, hacking the save to get 255 magic attack, level 99 etc etc.

None worked.

The highest dmg I could get was 3000-4000 per hit, compared to the 9999 per knight in KotR.

On to level 2...

I got a memory editor (TSearch) and tried the following methods.

1. I found the address of the magic attack value and cranked it up to 510 and held it there. Didn't work.
2. I found the 'hero drink' attack modifier level and set it at 100. It wasn't enough.
3. I tried to find the memory addresses of intermediary damage calculations (as found in TFergusson's battle mechanics guide) and held it at 9999. It would DISPLAY 9999, but would not deal 9999 damage to the enemy.

At this point, I was OBSESSED with making this 9999*32 damage work. I ate, drank, slept comet2.

I then read over the GEARS document (that's what it's called, righ-the one in qhimm wiki). I realized that I MIGHT be able to edit the materia values within kernel.bin.

As this was my first time delving into this realm of programming, I had a hard time finding out exactly how to extract/make changes to that file...

...
Window.bin, kernel.bin and scene.bin are kinda the same format, there are some diffrences, but you can get extract data from each one universally.

First All the above .bin files are in gzipped "chunks" (Sadly with no name) This is how you extract data from them

1) Open the file and count how many times 0x1f8b080000000000 shows up. This is the header for the beginning of the gzipped section, and the count will tell you how many sections there are.

2) You can extract the whole sction, including the header, and either run gunzip in it, or use zlib to extract the data.

that's really it.

some posts I found talked about copying/pasting specific sections into notepad? or something and then un-gzipping it. I used a hex editor to try to go to the appropriate sections of kernel, thought I got it, copied the 'materia' part of the file onto notepad...

I then tried to find a program that would un g-zip the section... typed gzip in google, came up with this site: http://www.gzip.org/

When I downloaded the windows version there and attempted to run it, the dos window would just shut down immediately.

Well... I'm stuck...

Can anyone think of a way to do this?

Your help will be appreciated...

To sum it up:
I want to get a character (doesn't have to be cloud) to be able to cast a comet2 spell and deal 9999*32 damage in one turn, and see it in my screen.
Just thinking about the overwhelming display of power... gives me the chills  :-D

-comet2

EmperorSteele

  • *
  • Posts: 933
    • View Profile
Re: help with spell damage
« Reply #1 on: 2006-06-25 07:38:24 »
I know it wouldn't have the same affect, but why not just mime it over and over??

Or, if you wanan be real nuts, just equip w-magic and 7 combos of comet+quadra magic.  It should cast 56 times, which would make 224 hits.  i tried to put this theory to the test, but, mosnters kept dying.  I'll try i on a WEAPON when i have some free time.

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #2 on: 2006-06-25 15:39:27 »
Unfortunately, additional quadra magics only allow one additional casting, I think...

Quote from: TFergusson
  Attaching multiple Quadra Magic to the same Materia will cause the spell to
    hit an extra time per Materia.  For example, having three Quadra Magics
    attached to three Earths would cause Quake to cast 6 times when used.
    This can be done up to a maximum of 8 times if you use five or more
    instances of Quadra Magic.

This is from the party mechanics guide by TFergusson...

Is there ANY way I could do the 9999*32 comet2 spell? :?

I have been obsessed with this for the past week...

learning how to hex edit and use memory hacking just for this...

I am willing to go to any lengths....

-comet2

edit:
some ideas I had included:
1. modifying the power (how many times the base is multiplied when calculating the damage)
2. setting the spell to ignore defense (become piercing) like KotR, Bahamut ZERO etc
3. ???
« Last Edit: 2006-06-25 15:45:51 by comet2 »

zero88

  • *
  • Posts: 257
    • View Profile
Re: help with spell damage
« Reply #3 on: 2006-06-25 15:51:55 »
Yeah, what you want is probably in the kernel.bin...

I'd really love to take a look at this, but I don't have the game and its files at my disposal at the moment...

When I created my spell patch a while back, I edited the kernel2.bin. It contained, as I recall, all the names and descriptions related to like, everything. I'm nearly positive (though not 100%) that what you want is in the kernel.bin. Just keep trying to figure it out :-D! I'm not sure what to tell you about your program difficulty, there... :?

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #4 on: 2006-06-25 15:59:35 »
May I ask if there are any programs other than the gzip link I posted above that can un-gzip it?

and is what I'm doing to extract the section (copy/paste within the hex editor window the sections I need into a notepad) correct?

I've found many, many excellent guides and resources here (for which I am extremely thankful)... but I still have not found a guide that could help me with this... I'm really sorry for asking even more of you, but just how would I go about doing this?

-comet2

EmperorSteele

  • *
  • Posts: 933
    • View Profile
Re: help with spell damage
« Reply #5 on: 2006-06-25 21:31:12 »
Well, it's just that no one's looked into changing spell damage all that much. Hell, terrance's party mechanics doc i think is missing the spell section (or was, last i looked) The closest thing I know of is Dziugo's 9999-cap breaker, which lets characters deal and recieve mroe than 9999 damage... but i don't think that would affect comet 2.

I think your idea #1 would be best, finding and adjusting its base.  Sadly, I wouldn't know how to do this.

[edit] I hate it when i misspell Dziugo's name ;_;
« Last Edit: 2006-06-26 01:14:30 by EmperorSteele »

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #6 on: 2006-06-25 22:35:32 »
when I look at the qhimmwiki kernel.bin data, http://wiki.qhimm.com/FF7/Attack_data

it states that:
Quote
KERNEL.BIN - Section 2: Attack data format

This section contains the data for the different attacks. Each record is 28 bytes long.

Offset    Length    Description
0x0F   Â        1 byte    Strength


and:
Quote
0x13   Â        1 byte    Times attacking


Sigh...

I believe that I could test these offsets if only someone could help me on correctly extracting the requisite section and un-gzipping... as I can then easily (I hope) go to the offsets listed and change the values...

-comet2



editing again:

I just found L Spiro's Memhack software, and reading through his explanation of the various functions available in Memhack, I got the following idea.
Spiro mentions templates/group searches that could be possible... (don't know what strings/pointers could be)
Since qhimmwiki gives an overview of the attack data format as well as the structure/length of each record in kernel.bin... if FF7 loads the data from kernel "As Is" and retains the data, might I be able to locate 28-byte long chunks with:

    value           description             offset
1. 110 or 6E as the mp cost address (0x04)
2. 000F Status-giving/Elemental as the attack attribute (0x0B)
3. FF none as restore type (0x10)
4. 4 as times attacking (0x13)

and then go to ram display (or something like that, respective areas of the ram) and increase the 0x0F "Strength" offset?

Would this be possible?

Through experimentation, I found that FF7 stores these values in ram through "unsigned short" 2byte data types... would I proceed by searching in this manner?
« Last Edit: 2006-06-25 23:20:15 by comet2 »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: help with spell damage
« Reply #7 on: 2006-06-25 23:23:46 »
dzuigo huh? :P

You're familiar with memory editing so I don't see a reason why you would try to edit files, if the same could be done with changing memory. Offset (1.02 US ff7.exe) for second section of Kernel.bin is:
Code: [Select]
0x0DB9690And for Comet2 (ID = 0x2E):
Code: [Select]
0x0DB9B98As you suspected, changing the strength of the spell slightly increased the damage. With pumped up 7 level Cloud and 9999LB patch installed, it did 24k damage per Comet.

dziugo

Emerald Weapon

  • *
  • Posts: 296
    • View Profile
Re: help with spell damage
« Reply #8 on: 2006-06-25 23:37:01 »
dzuigo huh? :P

You might as well give up dziugo. We'll probably never learn.  :wink:

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: help with spell damage
« Reply #9 on: 2006-06-26 13:52:16 »
There is always hope :roll:

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #10 on: 2006-06-26 16:58:37 »
Hello,

After much experimentation, I finally was able to achieve 9999 damage*32 (actually, I also managed to increase the hits per casting to 6, making it 6*4*2=48 hits total).

Such OVERWHELMING display of power... heheheh...

I unfortunately was not able to use dziugo's offsets because the ff7.exe version 1.02 plays upside down. I used the original CD US version installation plus the chocobo patch (I also have the reunion and hi-res in-battle patch installed, but that shouldn't make a difference).

As I had stated in my previous post, I utilized the 'group search' function in memory hacking software by L. Spiro. It worked wonders...

By the way, I found out several parts in the qhimmwiki that were listed as 'unknown'... by comparing the memory offset values for the very last offset in each 'attack type' section, I realized that the very last offset determines if your attack ignores or does not ignore enemy's defense...

So far, I found that 255 means that the spell will take enemy's defense into account, while a 251 will make the spell piercing(that is, ignore the opponents' defense).

So now I have a souped up comet2 spell that:
1. costs 255mp
2. has a power of 95 (compared to power of 80 of KotR)
3. hits 6 times per casting
4. and ignores opp. defense.
5. can be quad-magic-ed!!!

Thank you so much for helping me on this quest. If I get more time, I'm thinking about looking up the values for Hades, and finding a way to get the status-inducing aspect of that spell and incorporate it into the comet2 spell.

THANK YOU!!!!
-comet2

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: help with spell damage
« Reply #11 on: 2006-06-26 18:02:27 »
If you want to update the wiki, send a PM to halkun.

steven

  • *
  • Posts: 144
    • View Profile
Re: help with spell damage
« Reply #12 on: 2006-06-26 22:11:10 »



So now I have a souped up comet2 spell that:
1. costs 255mp
2. has a power of 95 (compared to power of 80 of KotR)
3. hits 6 times per casting
4. and ignores opp. defense.
5. can be quad-magic-ed!!!

Thank you so much for helping me on this quest. If I get more time, I'm thinking about looking up the values for Hades, and finding a way to get the status-inducing aspect of that spell and incorporate it into the comet2 spell.

THANK YOU!!!!
-comet2

cool I would like to see a patch for this so I can do that as well :)

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #13 on: 2006-06-28 03:24:50 »
Status update...

I found that another of the sections currently listed as 'unknown' in qhimmwiki actually hold the % chance values of any statuses the spell/attack might incur.

two other sections hold the values that affect the camera positions as the character casts the spell. (the position for ultima's quite good! Camera closing on the character in 3 different directions, then showing the enemy being blasted : ) )

One section also holds the value for sound effects too. Using some of them caused crashes though.

another section seems to hold the values that affect the targeting of the spell... I haven't yet completely figured exactly how it works, but do know that a value of 0 will allow 'all opponent' vs 'all ally' targeting, a value of 2 'one opponent' or 'one ally' targeting, etc...

by changing the status values, I was even able to find the "instant death" status from cait sith's limit break (the one that ignores status immunities)... but I think putting that on the spell would be too cheap. I do want a chance to use it before I "just win," you know...

current comet2 spell:

1. casting cost 255
2. camera position from 'Ultima'
3. strength level of 65 (KotR 80)-this is still enough to reach 9999 dmg @ level 99, mag 255, full hero drinks, level 5 mp turbo, even with quad magic attached
4. 100% chance of inflicting sleep, poison, confusion, silencee, slow, frog, small, paralyzed, stop each of 6 hits
5. attacks 6 times
6. ignores opp. defense

kinda interesting, all the statuses and combos you can give... funny when there's peerless and petrify at once, heh.
-comet2
« Last Edit: 2006-06-28 03:55:09 by comet2 »

steven

  • *
  • Posts: 144
    • View Profile
Re: help with spell damage
« Reply #14 on: 2006-06-28 16:32:09 »
I thought it was better beforehand


1. costs 255mp
2. has a power of 95 (compared to power of 80 of KotR)
3. hits 6 times per casting
4. and ignores opp. defense.
5. can be quad-magic-ed!!!


and I am still waiting for a patch


comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #15 on: 2006-06-28 17:07:53 »
Right now I'm in the process of figuring out how the different status effects are displayed... I can discover the address values for a single ailment, but I'm having difficulty finding out exactly how the game reads in multiple statuses... It's kinda tough, as I do not have a very effective way of testing whether a status is applied or not other than entering battle and using sense, then healing with a status heal item and checking to see if there's another status that was 'masked' underneath...

Basically, what I'm trying to do is:

i.e.

there are four memory addresses in which the game deals with status effects. 'death,' for example, is governed by a '01' value in the first of the four memory addresses. Poison, if my memory serves me correctly, is governed by a '08' value (don't kill me if this is not right-I'm at work right now)

I've been attempting to find how the game would apply both 'death' and 'poison' in the course of the attacks... they aren't any sums (a simple '09' did not yield anything), nor are they any simple multiplications or subtractions (as testified by Hades, with a crazy memory address, something like FC 17 00 04 or something (this is wrong for sure, but it looked something like that))

May I ask someone here for help? I could just put in FF for the status effects, but then it would apply ALL the effects, including peerless and haste...

Thank you so much for your help.


If it may be of any help... in a few hours, I will have most of the single-status values available, as well as a few double-status values...

I haven't been able to figure out a pattern yet, but I'll post whatever data I have in 2 hours.


-comet2

P.S., steven, this is all memory editing... What I'm doing is figuring out the memory addresses for which my particular version of ff7 (original install (not v1.2) and chocobo patch) saves the data for all the different spells. I'm not altering the actual data itself. Any addresses that I find might be different for your version... However, the 'patterns' of the data will be the same everywhere.  I can tell you how I did it, later on.
« Last Edit: 2006-06-28 18:13:04 by comet2 »

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #16 on: 2006-06-28 22:13:09 »
Just came back after a few discoveries...

so, we know that 4 offsets in each 'attack data' record.

Quote
...
Offset    Length    Description
0x14    4 bytes    Status
...

Additionally,
Quote
0x11 2 bytes Unknown
among these two bytes, the byte in 0x11 displays the % chance for the spell to cause whatever status that is listed in 0x14-0x17. (note on format: a value of 40, which in decimal terms is 64, stands for 100% chance... weird. something like decimal % chance-->hex value, treat the converted hex value as a decimal value and convert it to hex again (?))

As a result, as long as we have a value of 40 (in hex) (60 in dec), we can list whatever values in 0x14-0x17, and have the spell cast the corresponding status 100% of the time each time.

The key here is to find whichever set of values in 0x14-0x17 correspond to which (or which set of) status(es) in the game. I have been having a lot of trouble here.

The easiest way one would have done would be just list one status element per offset for a max of 4 offsets the spell can incur at a time. However, we know from Hades that spells are not limited to applying just four statuses.

The next method I thought about involved perhaps adding/subtracting from 0/255 whichever values the statuses express (i.e. if poison=8 and death=1, spell causing both poison and death would be 8+1=9 or 255-8-1=246). This didn't work after much experimentation.

I couldn't think of any other methods. As a result, I just went about finding the current available status offsets (by looking at various spell data) in-game, and extrapolate from there. Below are my discoveries: (not much-I didn't have enough time)
Quote
none:
FF FF FF FF

poison only:
08 00 00 00

sleep + poison+???:
3C 00 00 00
(3C in hex=60 in dec)

confusion only:
40 00 00 00
(40 in hex=64 in dec)

Silence only:
80 00 00 00
(80 in hex=128 in dec)

poison+confusion+???:
78 00 00 00
(78 in hex=120 in dec)

toad only:
00 08 00 00

stop only:
00 04 00 00

"death" only: (not the insta-death that ignores status immunities i.e. cait sith's limit break)
01 00 00 00

petrify only:
0 40 00 00
(40 in hex=64 in dec)

"Hades" (sleep, poison, confusion, silence, frog, small, paralyzed):
CC 1A 00 02
(CC=204 in dec, 1A=26 in dec)

sleep+poison+confusion+??:
CC 00 00 00
(CC=204 in dec)

confusion+poison+sleep+silence+??:
FE 00 00 00
(FE=254 in dec)

Instant death, plus various (probably all, including haste, peerless, insta-death, as well as poison, fury etc):
FF 00 00 00
or
00 FF 00 00


This is as far as I've gotten these past few hours. I cannot discern any recognizable pattern here. As I'm no computer guy, I've been wondering if anyone else in this forum could make sense out of this data... perhaps find a pattern as to how the game engine might recognize which status to apply?

Thanks...

-comet2

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: help with spell damage
« Reply #17 on: 2006-06-28 22:51:39 »
It's an OR combination of available statuses:
Code: [Select]
10 00 00 00 - Sadness (gears)
01 00 00 00 - Death (status cure <=> Life/Phoenix Down)
02 00 00 00 - Near Death (gears - probably not useful here)
04 00 00 00 - Sleep
08 00 00 00 - Poison
20 00 00 00 - Fury (gears)
40 00 00 00 - Confu
80 00 00 00 - Silence

00 01 00 00 - Haste
00 02 00 00 - Slow
00 04 00 00 - Stop
00 08 00 00 - Frog
00 10 00 00 - Small
00 20 00 00 - Slow-Numb (gears)
00 40 00 00 - Petrify (gears)
00 80 00 00 - Regen

00 00 01 00 - Barrier
00 00 02 00 - MBarrier
00 00 04 00 - Reflect
00 00 08 00 - Shield (gears)
00 00 10 00 - Death-sentence (gears)
00 00 20 00 - Manipulate (gears)
00 00 40 00 - Berserk (gears)
00 00 80 00 - Peerless (gears)

00 00 00 01 - ?
00 00 00 02 - Paralysed (gears)
00 00 00 04 - Darkness (gears)
00 00 00 08 - Dual (gears)
00 00 00 10 - Death Force (gears)
00 00 00 20 - Resist
00 00 00 40 - Lucky Girl (gears)
00 00 00 80 - Imprisoned (gears)
Should be easier now...

dziugo

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #18 on: 2006-06-28 23:03:21 »
Dziugo... thank you so much for your information... however, I do not understand what an 'or' combination is... could you explain a little further?

i.e.
sleep=04 00 00 00
poison=08 00 00 00

an 'or' combination of these would be...?

I tried googling, but not much use...

Thank you...

-Comet2

(no computer science background at all :( )

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: help with spell damage
« Reply #19 on: 2006-06-28 23:11:54 »
<simplification on>
In this case, just add them.
<simplification off>

I'm amazed that you don't know what binary OR is, yet you still managed to use memory editing tools like it was the easiest thing in a world :) Kudos to you and good luck with further dicoveries (did I mention that you can ask halkun for wiki access and update unknown fields?)

dziugo

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #20 on: 2006-06-28 23:25:54 »
Oooh.

I thought that was it :p. I do know what an OR combination is in math... but wasn't sure whether it applied in this instance, and definitely did not know that an OR combination in binary is the sum of the two... damn humanity major.

Thank you dziugo... I'm sure it must've been a lot of work figuring all that out.

-comet2

edit: dzuigo-->dziugo
least I can do to express gratification is to spell your name correctly  :-P

MagiMaster

  • *
  • Posts: 137
    • View Profile
Re: help with spell damage
« Reply #21 on: 2006-06-29 00:44:28 »
(no computer science background at all :( )

Wow.  I don't have any background etiher, but I can't even do what you did...that's amazing for one with no experience...

comet2

  • *
  • Posts: 31
    • View Profile
Re: help with spell damage
« Reply #22 on: 2006-06-29 06:56:07 »
Magimaster-lol, it's really easy, once you get the hang of it...


I'd like to express great thanks to those who helped me-especially dziugo!!! I cannot thank you enough.

Through further use of the knowledge I've gained, I also created the best healing spell possible... (within bounds, that is-no forever peerless, no invincibility etc)

I really liked the spell 'ultima.' However, at the beginning, it was set up as an enemy attack-all spell with no statuses, and the camera panning out to the enemy in the end. I really wanted to be able to have a healing spell using ultima's sounds and graphics.-especially since it has a green glow that, if you squint just a little bit, could be said to be a glow of health, rather than a glow of doom.

To do this, I had to fix the following:
1. MP cost. initially 130... since after all, this will be the 'ultimate' healing/buff spell, I want this to be 255.
2. change the camera angle-set it to focus on the players instead.
3. change attack attributes-before change, when the player selected ultima, the pointer automatically was set as 'all opponents.' I had to somehow fix this so that it would automatically point to all allies (not just for aesthetic reasons... by changing the auto target, I could have my characters use sneak attack on this spell)
4. Make it so that restore 'applies' to the character (make it in and of itself a restorative spell)
5. give it the ability to heal HP... I didn't want it to heal MP as well, since it already uses MP to cast it... something that uses a resource to create more of the same resource? not likely...
6. give it 100% chance to apply whatever buffs I'm going to give
7. set its buffs-haste, regen, barrier, mbarrier, death force, resist, lucky girl
8. finally, set its element as 'restorative.' any other elements caused the spell to deal damage instead.

and it worked!

Final spell list:
comet"3"
1. casting cost 255
2. camera position from 'Ultima' (original one where it closes on the character casting the spell in 3 directions then pans out on the enemy)
3. strength level of 65 (KotR 80)-this is still enough to reach 9999 dmg @ level 99, mag 255, full hero drinks, level 5 mp turbo, even with quad magic attached
4. 100% chance of inflicting death, sleep, poison, confusion, silencee, slow, stop, frog, small, petrify, paralyzed, darkness, DUAL (drain HP like poison) each of 6 hits
5. attacks 6 times
6. ignores opp. defense
7. can be quad magic-ed

Hultima
1. casting cost 255
2. camera position like normal healing spells
3. initial targeting to players-can be sneak attacked
4. fully heal
5. 100% chance of giving haste, regen, barrier, mbarrier, death force, resist, lucky girl
6. and looks cooler than any healing spell

Now, I want to enjoy the fruits of this labor by going through the game (finally). I actually only began playing this summer, and have not yet gone through the whole game yet, heh.

Once I go through the game, I might return and work on a 'guide to memory editing'... since I'd imagine a lot of people would like to do this too...

Or maybe I'm just being too forward. Oh well. Thank you!

-comet2
« Last Edit: 2006-06-29 15:25:57 by comet2 »

EmperorSteele

  • *
  • Posts: 933
    • View Profile
Re: help with spell damage
« Reply #23 on: 2006-06-29 07:08:04 »
.... now THAT is kickass.  Damn, man, you make this stuff look easy.  You some kind of genius or something?

MagiMaster

  • *
  • Posts: 137
    • View Profile
Re: help with spell damage
« Reply #24 on: 2006-06-29 17:26:59 »
Wow!  Hultima sounds awesome!  I should try out some game tweaking sometime!