Author Topic: FFVII Boss Death Flash  (Read 8597 times)

vega900

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
FFVII Boss Death Flash
« on: 2012-07-29 11:42:09 »
This may already have been asked, so apologies for posting again if that is the case. (I can't go looking on here, as I am using my phone). 

Anyway, I have changed the formation slightly for the No.1 Reactor to have Eagle Gun as the first boss instead of Guard Scorpion. I want Eagle Gun to die like a boss instead of a normal enemy.

Can this be done?

Thank you in advance.

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #1 on: 2012-07-29 12:58:09 »
Last I heard this still isn't known.

It's certainly something unique to the enemy you want to be the "boss". Boss deaths will cause minion deaths to do the boss death animation, but minions won't do that on their own. Then there are some bosses like Schizo that are technically BOTH the boss and the death animation won't happen until after they both die.

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #2 on: 2012-07-29 15:25:41 »
Midgardsormr also dies in this way.

NxK

  • Crazy poster
  • *
  • Posts: 113
  • Karma: 6
  • In AI I Trust
    • View Profile
    • YT
Re: FFVII Boss Death Flash
« Reply #3 on: 2012-07-30 17:19:58 »
It seems to me that the relevant information governing which kind of death animation will be used is stored within the enemy model data. In that case, what you are trying to change will not be a trivial task at all.

By the way, aren't Stilva and Materia Keeper just recolors of each other? Still, Stilva uses the usual enemy death animation while Materia Keeper uses the boss death flash.
Interestingly, character models, when made to appear as enemies in battle, will employ the boss death animation.

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #4 on: 2012-07-30 17:37:36 »
It would be insane for them to use model data to decide bosses, that is not how things are done.  As for colour, they are stored as separate models with their new colours (I... think).

Furthermore, it definitely isn't AI.  I can delete all AI for midgardsormr and the death flash is still long.

edit. If the info really is in the model area, that's ridiculous! 
« Last Edit: 2012-07-30 17:53:53 by DLPB »

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: FFVII Boss Death Flash
« Reply #5 on: 2012-07-30 17:55:49 »
Could that info be stored in the **AB file?

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #6 on: 2012-07-30 17:59:31 »
Could that info be stored in the **AB file?

Give me specific files for Midgardsormr and Godot :)  I will look at them both and see if I can find similarities.

yeah looks to me likesome of  these files in battle.lgp are odds on favourite now.  They aren't model data, they are something else.
« Last Edit: 2012-07-30 18:19:32 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #7 on: 2012-07-30 18:20:51 »
It would be insane for them to use model data to decide bosses, that is not how things are done.  As for colour, they are stored as separate models with their new colours (I... think).

Stilva and MK ARE separate models.

The death animation is actually part of the model. Changing the model of the Midgar Zolom to a common enemy doesn't make the common enemy do the boss fade out.
Giving some random enemy the MZ model still has the boss death anim.

*Just because it would be insane, doesn't mean it doesn't work like that. ;)

MZ - DD**
Godo - HA**

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #8 on: 2012-07-30 18:26:16 »
Yes but that isn't the model data.  It is specific to the model but it isn't as if it is analysing the 3d model and saying "yup you are the one"

It is data in battle.lgp. 

Thanks for those 2! I also need a normal enemy...  like devil rider
« Last Edit: 2012-07-30 18:27:55 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #9 on: 2012-07-30 18:32:42 »
Just add a few to those models and you'll likely get a common enemy (DE** / HD**).

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #10 on: 2012-07-30 18:36:47 »
Well the **ab files are definitely being stored in memory at battle time and used... so I'd say strong likelihood that they hold the needed data.  A lot of data here though....

edit:

When I get back I have a better idea... I'll find out what part of the game uses the flash in memory and trace back to the table.
« Last Edit: 2012-07-30 18:49:20 by DLPB »

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #11 on: 2012-07-30 23:55:06 »
The type of death is inside the **ab files as obesebear said.  Replacing midgardsormr's ddab with aaab yields a "no death animation" and battle ends with MZ still on screen (same as with pyramid).  Replacing with Hammer Blasters cbab yeilds the Hammer Blasters "explode" death animation.

The thing now is for me to look at different enemies and see if I can make sense of the data.  For now, I can't see ANY difference in battle aside from the death animation when using different files.  It could be that the files are simply the death animation in entirety... the data for the whole animation.

edit.  I think I have it sussed ;)

edit2:  okay so the first 4 bytes (2 values at 2 bytes) of the **ab files are the actual identifier for which death will occur.  I am still testing now to see what the 2 values do but bytes 2/3 certainly change the animation.  00 00 is normal death.
« Last Edit: 2012-07-31 01:32:49 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #12 on: 2012-07-31 01:39:03 »
So AB may be exclusively death anim info? That's interesting that it's apparently not exclusive to the model it's assigned to. Just replacing with no modification makes it work fine? You should try Safer Sephiroth's. :D

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #13 on: 2012-07-31 01:40:23 »
Yeah replace with any seems to work fine.  I will try Sepher's in a sec.

Also, it is byte 3 of **ab that defines the death type.  00 being default death.  I will document them here in a few moments.  I am still checking to make sure...  I can't see why byte 1 is always 00 or 01.
« Last Edit: 2012-07-31 01:45:15 by DLPB »

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #14 on: 2012-07-31 03:54:10 »
OK so this is what I get. 

First 2 bytes are an identifier for the enemy.  The file is more than just death code.. it has a part to play in a few aspects of an enemy.  If you replace MZ with Sephiroth (very last boss) ab file, the MZ will attack repeatedly and completely ignore AI.  The ab files seem to also include camera angles during death animation (at least I think so!).  If you want to change the enemy's death animation you only need change 1 byte for its ab file.

The 3rd byte is the death type value.
The values used in **ab files are 00,01,02,03,10,11,12,80,90

Only the above values are used for normal deaths, the other values listed below
(like 07) are used because of actions in battle, like using morph on an enemy).
If you want to make an enemy do a morph animation even when morph has not
been used, set the battle **ab file value to 07 (for example).

12 is the highest value for use in normal animations. See more detailed explanation
in code break down further down this thread.

Code: [Select]
00: Normal
01: Disintegrate (Think mechanical things)
02: Melt (Think 8-eye or flans)
03: Disintegrate 2
04-06: No death animation, enemy will remain as battle ends.
07: Morph
08: Flash death (Flash animation where enemy floats to sky.  Translated Iainuki)
09: No death animation, enemy will remain as battle ends.
0A: Disintegrate
0B-10: No death animation, enemy will remain as battle ends.
11: Boss death
12: Break apart (Sepher Sephiroth uses this)
80: Unknown, see below
90: Unknown, see below

80 and 90: If you use 80 or 90 on ab files without copying across the models other data, the game will crash.  Yuffie uses 90 in the battle you have with her, whereas normal user characters (like Cloud) use 80.

The enemy MP (and other of this type) is using 80 for an unknown reason (see aqab) .  The use of 80 and 90 and exactly what they do is unknown.  It could be that it is an indicator of a type of skeleton (given these are all humans).

Using 12 on normal enemies will only show a normal boss death. There is more to the death animations than the ab files (possibly other files and information used depending on the death animation value).  Sepher Sephiroth's death animation is most likely hard coded in ff7.exe.

The game itself limits the normal animation values from 01-12 and limits the max value used to 63 before wrapping around.  Therefore 80 becomes 16 and 90 becomes 24.  There is more to this 80 and 90 than meets the eye.  I will try to work this out later in the thread.

Code: [Select]
The values are passed into code at 0042BC7a memory

and so:

Quote
I want Eagle Gun to die like a boss instead of a normal enemy. Can this be done?

Yes, it can.  Use ulgp in tools section to dump files from battle.lgp, then open the file **ab in a hex editor, move to the 3rd byte along and change it to 11 (originally it is 00) .  Save the file again by encode and it will be done.  Word of warning, don't mix ab up with ba.  Only a tit would do that.  ::)

Edit. you have overwritten Guard Scorpion files, so the file would be awab



« Last Edit: 2012-08-01 00:52:05 by DLPB »

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #15 on: 2012-07-31 20:45:21 »
Also just a note, the melt animation for death is broken in PC.  At the end of the animation the full model momentarily comes back full again (I will see if I can fix this).  I first noticed it with Tonberry.

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #16 on: 2012-07-31 21:51:16 »
Using 12 on normal enemies will only show a normal boss death. There is more to the death animations than the ab files (possibly other files and information used depending on the death animation value).  Sepher Sephiroth's death animation is most likely hard coded in ff7.exe.

This may be similar to super nova being tied specifically to the swirling heavens background. Have you tried it on that background?

It's actually looking like a bitmask. I want to check out that address you posted and see what I can find.

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #17 on: 2012-07-31 22:49:50 »
The game uses a pointer from that address to point to another address which then has a value of the jump-to address.  So that is what the death values do.. they are an offset.


Code: [Select]
At 0042bc7a
mov cl,[eax+02] Takes the 3rd byte of the table (death value) places into cl
mov [edx+00BE119F],cl places in new address

This address is then accessed by a few places I can't quite fathom what goes on there
but the important one seems to be at 0042BE62

mov dl,[ecx+00BE119F]. And edx,3F is done  and the death value is then
placed in a new memory address at 0042BE72 (mov [eax+009A87F8],dl)

This memory address is the one used for death animation when the battle ends.
The usual area is 009a8838 for first enemy.

This value is then accessed at 004258AC

mov dl,[ecx+009A87F8]
mov [ebp-08],edx
cmp dword ptr [ebp-08],12
ja 00425A72

A comparison is made with 12 (sephers and largest normal value).
If greater it will jump to end and do nothing.  Which means
values of 80 and 90 are being handled elsewhere(?)


The value is now in [ebp-08]
if not greater than 12, it continues:

xor eax,eax
mov ecx,[ebp-08]
mov al,[ecx+00425A9A]

The value is now providing an offset to a memory address to find a new value
This value is placed in al.

jmp dword ptr [eax*4+00425A76]

al from above is now used as an offset to new memory address which
holds the address to jump to.  In the case of a normal enemy death (ecx 00)
mov al,[ecx+00425A9A] returns a value [b]also[/b] of 00

al is now 00

jmp dword ptr [eax*4+00425A76]

Since al (and therefore eax since xor above) is 00, at 00425A76 you find a table of addresses, and the address
at 00425A76 is used for the jump.  In this case Jump to 004258d1.

This pushes new a value then makes a specific call.  The call function will change
as the jump address changes. In this area of code I think are all the ordinary animations.

You can see further down that the obvious jump-to locations are:

004258D1
0042590C
00425947
00425991
004259CC
00425A04
00425A3C

These are all involved in the actual animation itself based on the death value.

If you want to force death value without having to keep changing the battle files,
change the jump at 004258CA (that's CA) to force the exact area you want to start at from list above, or
probably best, change 004258AC (that's AC) to mov [ebp-08],00000002 where 2 is "melt" and
11 is "boss" etc.


Is there a way to load that sepher background on ordinary battles?
« Last Edit: 2012-08-01 02:48:43 by DLPB »

Zackwell

  • Fast newbie
  • *
  • Posts: 35
  • Karma: 0
  • Venerable Malefactor
    • View Profile
Re: FFVII Boss Death Flash
« Reply #18 on: 2012-07-31 23:07:39 »
Ohhh. D'ya think it'd be possible to have Safer Sephiroth's collapse effect on other enemies by that logic?

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #19 on: 2012-07-31 23:17:19 »
Ohhh. D'ya think it'd be possible to have Safer Sephiroth's collapse effect on other enemies by that logic?

I personally don't think it is possible no... I think it checks the background or else has other checks or hard code. 

Zackwell

  • Fast newbie
  • *
  • Posts: 35
  • Karma: 0
  • Venerable Malefactor
    • View Profile
Re: FFVII Boss Death Flash
« Reply #20 on: 2012-07-31 23:19:27 »
You'd think Square didn't want people to mod this game.  :-o
Ah well, it's a shame. >:C

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #21 on: 2012-07-31 23:28:18 »
Remember to read
http://forums.qhimm.com/index.php?topic=13357.msg186122#msg186122

Also, additional notes.  The Push value like the one at 4258d1 is v. important to what animation will be done.  For example I changed it to push 005BCAAA and now normal death has become the "Float to sky (as in like what happens with Flash ally move)" animation.

new values are being passed to 009a8838 (see above what I mean by this address) when using certain actions like Flash, these replace the battle file death values at the above address. 

Also be sure to look here:  http://forums.qhimm.com/index.php?topic=13357.msg186084#msg186084

I have updated the list to include the full actions of death value 00-12.

Flash (08) won't work when the boss value (11) is set, because the game checks this at 005DB127 (jump if not less than 11).  A boss will die like a boss always unless you remove the jump.

The same check is done for Morph (7) at 005CACEE

edit.

Because the code restricts values of 80 and 90 to wrap around (via And 3F), they become 16 and 24 in the animation code.  This is still seen as inactive though because of the Compare with 12.  It is therefore very likely that the 80 and 90 are dealt with earlier from the address given at 0042BC7D.

edit 2.
Likely the "80" or above is being checked from 0042985E (the value and code are used throughout the battle in a loop). 

Quote
and edx,00000080
test edx,edx
je 00429874

If that is right, "And 80" is making sure only the highest bit is considered.  Therefore 80 and 90 would in fact be doing the exact same thing.  Why ordinary enemies like the MP are using this is still a mystery.

edit 3:  The MP enemy places 00 at 009a8838 (again this changes for each enemy) and so has normal death animation.  This is done by the code starting 00426584.  The high bit flag simply uses a different set of code for setting the death animation and behaviour.   Probably set along this route by the check at 00429858.
« Last Edit: 2012-08-01 03:02:47 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FFVII Boss Death Flash
« Reply #22 on: 2012-08-01 03:39:37 »
Is there a way to load that sepher background on ordinary battles?

PrC can do that. Just change the bg in the formations tab.

DLPB

  • No life
  • *
  • Posts: 9239
  • Karma: 297
  • For I realized that God's a young man, too.
    • View Profile
Re: FFVII Boss Death Flash
« Reply #23 on: 2012-08-01 03:59:29 »
I will look into it...  8)  but I expect more to be going on than just a background.  I am almost ready to deliver my final conclusions in the reverse engineering section.  A few extra things I have found out.

edit.  Also Proud Clod is amazing.
« Last Edit: 2012-08-01 04:02:56 by DLPB »

Bosola

  • Fire hazard!
  • No life
  • *
  • Posts: 1753
  • Karma: 15
    • View Profile
    • My YouTube Channel
Re: FFVII Boss Death Flash
« Reply #24 on: 2012-08-01 13:21:06 »
Could that info be stored in the **AB file?

Yes. There is a flag in the AB file. It's the third byte, just as DLPB said.