Author Topic: (PSX) FF7 - Battle animation index for playable characters?  (Read 11630 times)

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Whilst making custom playable characters, I'm faced with the hassle of battle animations. The animations themselves, in this case at least, are not the problem (I'm harvesting them in entirety from other models). The problem is that if I replace an existing playable character's battle model with a custom model that has unique bones, parts, and animations, the original character's animation index (for lack of a better term) still says, "When Steal is initiated, play animation 4B".

A simple, if crude, workaround for this is to identify every animation for the original model, identify every animation for the custom model, then swap the correct animations, leaving the total number of animations intact since the original model, and using a null value (30 1A 00 00) for everything that won't be used.

This works to an extent, but when the original character performs several animations for a particular action and the custom character will only perform one (or less than the original, in any case), I'm forced to jam several animations together and try to still make it look fluid and natural. Moreover, if I intend to use the same animation for more than one action (and the original character didn't also use only one animation for these exact actions), I must duplicate it entirely within the model, wasting space and cluttering the file needlessly.

I've no clue where this data is stored (KERNEL.BIN?), but does anyone have a clue as to where each action of each playable character is assigned an animation number?

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Whilst making custom playable characters, I'm faced with the hassle of battle animations. The animations themselves, in this case at least, are not the problem (I'm harvesting them in entirety from other models). The problem is that if I replace an existing playable character's battle model with a custom model that has unique bones, parts, and animations, the original character's animation index (for lack of a better term) still says, "When Steal is initiated, play animation 4B".

A simple, if crude, workaround for this is to identify every animation for the original model, identify every animation for the custom model, then swap the correct animations, leaving the total number of animations intact since the original model, and using a null value (30 1A 00 00) for everything that won't be used.

This works to an extent, but when the original character performs several animations for a particular action and the custom character will only perform one (or less than the original, in any case), I'm forced to jam several animations together and try to still make it look fluid and natural. Moreover, if I intend to use the same animation for more than one action (and the original character didn't also use only one animation for these exact actions), I must duplicate it entirely within the model, wasting space and cluttering the file needlessly.

I've no clue where this data is stored (KERNEL.BIN?), but does anyone have a clue as to where each action of each playable character is assigned an animation number?
On the playstation the animation data is included with the model. ALSO the weapon is a bone in the character model.
It should be very similiar in the PC data (perhaps located differently). The index of each animation that the character has is the same and the same number of animations. Break limits I think were handled seperately.
There are several sub files on the playstation first came the bone structure data then the vertices and polygons. The next came the animation data. Although most was very short (the index list is at the begining of the file ).

Anyhow anything past the TIM image was the weapon model bones (which had no textures in them). The animations where between the HRC data bones and model data.
The format was outlined a while ago which I probably have a copy of somewhere (heh).
Looks like the data in the wiki is somewhat incomplete (as in not much has been updated it since I added too it).

anyhow the animations for the PC are outlined here the PS1 is fairly similiar but the packaging is the trick.  Your biggest challenge will be associating the correct animation with the correct file section.

Also compressing the animation data will be a bit interesting. The data I believe is identical between PC and PS1 (raw data).  The PS1 battle model stuff looks to need a bit of clean up in the wiki but it's mostly their.
As I said the hard part is knowing which section is what animation. I believe the movement animations are just cycled and the attack animation is just fired for the weapon if it's a hand weapon, otherwise if it's a distance weapon (Yuffie Barret Vincent) I think their is just an attack animation that's fired.

Anyhow ... I digress what was I babbling about? :D

Cyb

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
You misunderstand...I'm fully acquainted with the model format; I'm the one that wrote the breakdowns on the wiki page you linked to :)

I know where the individual animations are. I want to know where it is delineated as to which action corresponds to which animation. As in the example I made above, when the player tells Playable Character 1 to Steal, Character 1's animation 2B initiates. If the player tells Playable Character 2 to Steal, Character 2's animation 3A initiates.

Proud Clod seems to have the ability to affect the animation index of the various enemies ("If enemy does BrainBlast, do animation 09", etc). But I haven't seen any reference to doing the same with playable characters.

The end result would be the following: if I replace Barret with Zemzelett (which I'm not really going to do, in case you were wondering), I'll need to migrate Zemzelett's animations in place of Barret's (I can't simply swap files, as Model Settings Data is different between playable characters and enemies, and texture data is in the wrong place...not to mention weapon bone data being limited in enemies, etc). When the player tells Barret to throw a potion, the game somehow decides what animation to use for this. This does not appear to be contained in the model file itself. Thus if Zemzelett only has 0x2A animations, and Barret's "item use" animation is animation 0x3C, I can't simply replace Barret's animations en mass - I'll need to not only keep the total number of animations the same, but I'll also have to match up which animations I'd like to be performed for which actions, by fully mapping all animations and their actions. However, if I could modify the animation index itself (what animation each action calls), I could re-map the entire index to only utilize the 0x2A animations, and point each action to the corresponding animation with ease.

Point in fact, however, I'm not really familiar with the fine details of what Akari called Model Settings Data in his reversing work for QGears (and what I've continued to call that same name for consistency). If somewhere therein lies the animation index, please do point it out. Simply swapping the Model Settings data, even if animations are also swapped, results in a crash.

vayneruel

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 17
    • View Profile
Do you replace Zemzelett fot Barret? Replace the lzs file? If you replace the lzs file, this file contains all animation of the model, in your case Barret. I replaced the Cloud model and discovered ID animations thanks to Proud Clod:
17= Magic animation (only work with magic materia)
14= Attack animation
15= Slash anmation
16= double slash (don´t work very well)
18=double slash (don´t work well)
1B= Deathblow animation
1C= Flash anmation
1D= Magic animation (this work with all attacks)
1E= E. skill animation
1F= Summon animation
Also i use the original Sephiroth model like in this video (https://www.youtube.com/watch?v=XejdKyYo4Qg) but the Masamune model not appears, why? Is possible repair this?  thanks

Aali

  • No life
  • *
  • Posts: 1197
  • Karma: 116
    • View Profile
Pretty sure this data is in the **AB script files on the PC version, not sure exactly what that corresponds to in the PSX version. Either way the format is not really known, I know Akari did some work on it and so did I but not enough to be able to edit it or even decode it really.

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
The animation indexes to use are hard-coded in the exe. Give it command 13 and it will do animation 2D (or something like that). I made a table a long time ago and posted it here (I think), but I'm not searching through nearly 2000 messages to find it right now.

You'd have to change this for each command, but that'd screw up all the other characters as well.

EDIT:
OK, not quite. Aali's got the closest answer to this. I do have a list of commands with scripts to play, but the animations are in chunks that the game will determine which to play for how long before doing the next one.

Ex.
The Item command initiates animation script 21h. This does at least three things: 1. Hop forward (animation 3) 2. Throw the item upward (animation 9) 3. Hop back to starting position (animation 4).

Here's how Cloud's animation script 21h looks like:

Quote
E8 FC 03 ED D8 06 15 00 09 EA EB F4 0A F3 04 FA E5 EE

Those are the animations he takes  at certain times. The 03 is the hop forward, the 09 is the throw item, the 04 is the hop back.
« Last Edit: 2013-04-17 15:05:34 by NFITC1 »

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
The animation indexes to use are hard-coded in the exe. Give it command 13 and it will do animation 2D (or something like that). I made a table a long time ago and posted it here (I think), but I'm not searching through nearly 2000 messages to find it right now.

You'd have to change this for each command, but that'd screw up all the other characters as well.

EDIT:
OK, not quite. Aali's got the closest answer to this. I do have a list of commands with scripts to play, but the animations are in chunks that the game will determine which to play for how long before doing the next one.

Ex.
The Item command initiates animation script 21h. This does at least three things: 1. Hop forward (animation 3) 2. Throw the item upward (animation 9) 3. Hop back to starting position (animation 4).

Here's how Cloud's animation script 21h looks like:

Those are the animations he takes  at certain times. The 03 is the hop forward, the 09 is the throw item, the 04 is the hop back.

Awesome; that's exactly what I was looking for. As I half-guessed above, that data is within what Akari called Model Settings Data, within the LZS model file itself. I'll do some testing later. Thanks :)
« Last Edit: 2013-04-17 17:07:24 by Lazy Bastard »

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
I did change that highlighted 03 to a 09 and Cloud did the throw animation twice. After the first throw he teleported forward from where he was to the position on the battle field where he WOULD have ended up if he had hopped forward. The actual action happened after the second throw. I've got his whole file parsed into scripts, pointers, and where the data ends up. I just don't know what much of it does.

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
I did change that highlighted 03 to a 09 and Cloud did the throw animation twice. After the first throw he teleported forward from where he was to the position on the battle field where he WOULD have ended up if he had hopped forward. The actual action happened after the second throw. I've got his whole file parsed into scripts, pointers, and where the data ends up. I just don't know what much of it does.

Cool; sounds like a hack-job waiting to be done (and I'm just the one to break everything systematically and identify what does what) :)  To save me some time, any chance you could share that data?

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Also, two things:

1. Nitpicking, but the script you referenced is specifically "Using an item on yourself/your teammates"; using an item on an enemy, even if it's a Potion, is slightly different in that the item is thrown forward rather than up, hence it will have its own separate script.

2. Glancing at adjacent data, I think the preceding two bytes of zeroes (at least, in the LZS for PSX...though I doubt it's different on PC) are part of the script, hence what you posted above should be:

Code: [Select]
00 00 E8 FC 03 ED D8 06 15 00 09 EA EB F4 0A F3 04 FA E5 EE

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #10 on: 2013-04-17 17:23:20 »
I was just preparing that, actually. This is Cloud's rtab file and the addresses that everything goes to:

Code: [Select]
0000 (0xBE1178)
0080 (Death Anim)
0190 (0xBE118A)
0a00 (0xBE1180)
0a00 (0xBE1182)
0000 (0xBE1184)
0000 (0xBF23E6)
fce0 (0xBF23E8)
fc7c (0xBF23EA)
02 (0xBE11A3)
00 (0xBE11A4)
00 (0xBE11A5)
00 (0xBE11A6)
00 (0xBE11A7)
00 (0xBE11A8)
0d (0xBE11A9)
08 (0xBE11AA)
03 (0xBE11AB)
00 (0xBE11AC)
03 (0xBE11AD)
17 (0xBE11AE)
12 (0xBE11AF)
00 (0xBE11B0)
00 (0xBE11B1)
00 (0xBE11B2)
0000 (align?)

Related to Camera Scripts? File size; Not stored elsewhere
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00

0180 (0xBF23C4)
0132 (0xBF23C6)
0180 (0xBF23C8)
0000 (0xBF23CA)

0399 (0xBF23CE)
fda8 (0xBF23D0)
f9ff (0xBF23D2)
0000 (0xBF23D4)
fddc (0xBF23D6)
0000 (0xBF23D8)

fd01 (0xBF23DA)
ff58 (0xBF23DC)
f9ab (0xBF23DE)
0000 (0xBF23E0)
fe30 (0xBF23E2)
0000 (0xBF23E4)

012c (0xBF23F0)
0000 (align?)

DWord pointers (Max 74)
00: 190
01: 194
02: 19c
03: 1a0
04: 1b0
05: 1c0
06: 1c4
07: 1cc
08: 1d0
09: 1d4
0A: 1e4
0B: 1e8
0C: 1ec
0D: 1f0
0E: 1f4
0F: 200
10: 1fc
11: 210
12: 204
13: 198
14: 26c
15: 284
16: 318
17: 32c
18: 358
19: 36c
1A: 378
1B: 384
1C: 338
1D: 210
1E: 220
1F: 230
20: 244
21: 258
22: 290
23: 290
24: 26c
25: 284
26: 2ec
27: 2fc
28: 2c8
29: 2c8
2A: 2b0
2B: 2b0
2C: 30c
2D: 30c
2E: 190
2F: 190
30: 190
31: 190
32: 190
33: 190
34: 190
35: 190
36: 190
37: 190
38: 190
39: 190
3A: 190
3B: 190
3C: 394
3D: 3b8
3E: 3d8
3F: 3e8
40: 40c
41: 418
42: 428
43: 424
44: 3e4
45: 394
46: 190
47: 190
48: 190
49: 190

Scripts
*190: 00 fe c0 00
*194: 01 fe c0 00
*198: 10 fe c0 00
*19C: e5 06 f1 00
*1A0: b3 f9 03 ed e3 ee b2 f9 03 b1 03 b1 e3 ee 00 00
*1B0: b3 f9 04 e4 e3 ee b2 f9 04 b0 04 b0 e3 ee 00 00
*1C0: 0f f2 e5 ee
*1C4: 10 11 f2 e5 ee 00 00 00
*1CC: 12 f2 e5 ee
*1D0: 05 e5 ee 00
*1D4: ab 90 01 00 00 08 f4 0f f3 fa e5 a6 ee 00 00 00
*1E4: 13 e5 ee 00
*1E8: 18 19 e5 ee
*1EC: b4 02 f1 00
*1F0: 95 07 fe c0
*1F4: c4 90 01 06 07 fe c0 00
*1FC: 04 fa e5 ee
*200: e7 00 f1 00
*204: e5 c4 90 01 06 12 e7 00 f1 00 00 00
*210: e8 fc 03 ed e6 ea 0c 0d ec 0e 04 fa e5 ee 00 00
*220: e8 fc 03 ed a4 ea 0c 0d ec 0e 04 fa e5 ee 00 00
*230: e8 fc 03 ed a5 ea 0c 0d ec f4 0f f3 0e 04 fa e5 ee 00 00 00
*244: e8 fc 03 ed d8 06 15 00 09 ea eb f4 0a f3 04 fa e5 ee 00 00
*258: e8 fc 03 ed d8 06 15 00 0a ea eb f4 0a f3 04 fa e5 ee 00 00
*26C: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 01 1e 1c fa f0 1d e5 ee
*284: fc 03 ed f7 10 1f 04 fa e5 ee 00 00
*290: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 01 d8 01 d6 02 16 f4 06 f3 26 fa f0 1d e5 ee 00
*2B0: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 10 21 28 fa f0 1d e5 ee
*2C8: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 10 20 27 fa f0 1d e5 ee
?2E0: fc 03 ed f7 01 20 04 fa e5 ee 00 00
*2EC: fc 03 ed f7 01 14 f4 3c f3 04 fa e5 ee 00 00 00
*2FC: fc 03 ed f7 01 14 f4 5a f3 04 fa e5 ee 00 00 00
*30C: fc 03 ed f7 13 15 04 fa e5 ee 00 00
*318: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 01 1e 9e 00
*32C: f7 01 22 23 fa f0 1d e5 ee 00 00 00
*338: fc f0 d8 00 1a 00 1a cc 04 cb ff e8 03 fe fe 00 08 08 f0 1b 1e f7 03 f4 06 f3 1c fa f0 1d e5 ee
*358: fc f0 d8 00 1a 00 1a d1 b0 04 00 00 04 f0 1b f7 01 1e 9e 00
*36C: e5 bd b0 04 00 00 f0 f7 03 22 9e 00
*378: e5 bd b0 04 00 00 f0 f7 03 24 9e 00
*384: e5 bd b0 04 00 00 f0 f7 03 29 1c fa f0 1d e5 ee
*394: e8 fc 00 e0 ea f4 19 f3 ec f0 d8 00 1a 00 2c d1 b0 04 00 00 04 f0 2d d8 06 30 00 2e fa f0 2f e5 ee 00 00 00
*3B8: e8 fc 00 e0 ea f4 19 f3 ec f0 d8 00 1a 00 2c d1 b0 04 00 00 04 f0 2d 2e fa f0 2f e5 ee 00 00 00
*3D8: e8 fc 00 e0 ea f4 19 f3 ec 2c 9e 00
*3E4: ec 2d e5 ee
*3E8: e8 fc 00 e0 ea f4 19 f3 ec f0 2c d8 00 1a 00 fb 40 06 00 00 f0 2d d8 19 30 00 a8 26 08 2e fa f0 e5 ee 00 00
*40C: e8 fc 00 e0 ea f4 19 f3 ec 2c e5 ee
*418: e8 fc 00 e0 ea f4 19 f3 ec 2c e5 ee
*424: ec e5 ee 00
*428: e8 fc 00 e0 ea f4 19 f3 ec 2c 2d 2d 2e fa e5 ee

I'm not sure what all those addresses do, but they're parts of per-character arrays (two groups of them, actually).
2E0 looks like an unlinked script.

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #11 on: 2013-04-17 17:25:16 »
Also, two things:

1. Nitpicking, but the script you referenced is specifically "Using an item on yourself/your teammates"; using an item on an enemy, even if it's a Potion, is slightly different in that the item is thrown forward rather than up, hence it will have its own separate script.

That's possible.

2. Glancing at adjacent data, I think the preceding two bytes of zeroes (at least, in the LZS for PSX...though I doubt it's different on PC) are part of the script, hence what you posted above should be:

Code: [Select]
00 00 E8 FC 03 ED D8 06 15 00 09 EA EB F4 0A F3 04 FA E5 EE

That is not. The script pointer points to the E8 as the beginning of the script. The extra 00s are alignment bytes from the previous script.

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #12 on: 2013-04-17 17:30:09 »
Ack, I just saw that in your data above. It's really:

Code: [Select]
E8 FC 03 ED D8 06 15 00 09 EA EB F4 0A F3 04 FA E5 EE 00 00

Though that doesn't matter from a reverse-engineering standpoint (it doesn't do anything), it's critical from a reconstruction standpoint (if it's excluded, the result won't work).

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #13 on: 2013-04-17 17:57:58 »
It's interesting to note that the section you refer to as:

Code: [Select]
Related to Camera Scripts? File size; Not stored elsewhere
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00
38 04 00 00

...effectively points to the first byte after this Model Settings Data (the first byte of the first actual animation data). This is the animation for doing "nothing" (standing/bouncing around while awaiting the next turn or attack from an enemy).

Edit: This may be of no importance, since as you mention, this is also the "file" size of this data, irrespective of what's "next" in the model data.

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #14 on: 2013-04-17 18:15:48 »
it's critical from a reconstruction standpoint (if it's excluded, the result won't work).

Depends on how you pack it. Just deleting those bytes would throw off the other pointers and break the other animations. I suspect the EE code just means "Return to idle animation".

I haven't found where they're handled yet, but this is more info than we've had before.

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #15 on: 2013-04-17 19:45:24 »
2E0 looks like an unlinked script.

Is it possible that it's simply part of 2C8? Or, have you worked out more of the format than you've specified above?

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #16 on: 2013-04-17 20:01:12 »
It's an assumption on my part. Since 2C8 looks nearly identical to 2B0 then I assumed that 2C8 was a complete script. 2E0 is not linked to, but 2EC is. Logically, a script starts at 2C8 and the next one starts at 2EC. Since 2C8 has an EE command (my assumed "end of script") then 2E0 would be the beginning of a new script which is just not referenced.

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #17 on: 2013-04-17 20:27:08 »
Ah.

Still, 1A0 has more than one EE command:

b3 f9 03 ed e3 ee b2 f9 03 b1 03 b1 e3 ee 00 00

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #18 on: 2013-04-17 20:53:36 »
I noticed that too, but that's likely an argument to another previous command. ED, for instance, may take 2 or more byte-sized arguments. The problem is it's currently unclear because I haven't found the handler to these scripts yet. I'm working on the assumption that they're like the camera scripts, but I should probably stop that.

I've been staring at 1st Ray's animation (because it has only one attack) and its 3rd animation looks like this:

Code: [Select]
e8 00 fc 02 c9 03 ca 04 ec 05 e5 ee
I can tell from the animations in kimera that it plays all these animations back to back.

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #19 on: 2013-04-17 21:15:13 »
Interesting.

I've broken down the ENEMY338 (Goblin)'s Model Settings Data as an example:

Model Settings Section [at offset 0x00005A2C]:


Unknown:

Code: [Select]
00 00 00 00 5E 01 78 05 78 05 C4 FF C8 00 D0 FD
54 FC 02 00 00 00 00 00 1D 18 02 00 05 13 0E 00
00 00 00 00 94 01 00 00 98 01 00 00 9C 01 00 00
A0 01 00 00 A4 01 00 00 A8 01 00 00 AC 01 00 00
B0 01 00 00 19 01 19 01 19 01 00 00 C0 0B B9 FD
8E 05 00 00 90 FF 00 00 63 FD 39 FE 9D 08 00 00
70 FF 00 00 2C 01 00 00


Relative offsets (from the beginning of Model Settings Data) to animation scripts:

Code: [Select]
E8 00 00 00
EC 00 00 00
F0 00 00 00
F4 00 00 00
08 01 00 00
1C 01 00 00
2C 01 00 00
30 01 00 00
34 01 00 00
38 01 00 00
3C 01 00 00
44 01 00 00
50 01 00 00
5C 01 00 00
64 01 00 00
6C 01 00 00
74 01 00 00
7C 01 00 00
84 01 00 00
8C 01 00 00
40 01 00 00
4C 01 00 00
58 01 00 00
60 01 00 00
68 01 00 00
70 01 00 00
78 01 00 00
80 01 00 00
88 01 00 00
90 01 00 00
48 01 00 00
54 01 00 00


Animation scripts:

Code: [Select]
-A9 C9 00 C1
-01 F6 E5 EE
-0E E5 EE 00
-FC F0 02 D1 4C 04 00 00 08 F0 F7 08 03 04 FA F0 05 E5 EE 00
-E8 FC EA F0 06 D1 F4 01 00 00 08 F0 07 EC 08 FA F0 09 E5 EE
-E8 B6 00 AA FC EA 0A C9 0B CA 0C EC 0D E5 EE 0A
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00
-00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

Note: The last referenced offset above is 0190, but the size of that script, whether four bytes, two bytes, eight bytes, or larger, isn’t apparent. Whatever’s left over after that script, if anything, is likely filler (as is that script itself, and those “empty” ones preceding it).

It's interesting that the remaining data after 0x11C-0x12B is just padding utilizing zeroes, rather than "null" animation scripts via a null command or something similar. Also, 0x11C ends with EE 0A, and unless there's another "end script" command we haven't stumbled upon yet, this doesn't seem to be a valid script followed by a dummied script or something.


Edit: Looking back at my "Unknown" section:

Code: [Select]
00 00 00 00 5E 01 78 05 78 05 C4 FF C8 00 D0 FD
54 FC 02 00 00 00 00 00 1D 18 02 00 05 13 0E 00
00 00 00 00 94 01 00 00 98 01 00 00 9C 01 00 00
A0 01 00 00 A4 01 00 00 A8 01 00 00 AC 01 00 00
B0 01 00 00 19 01 19 01 19 01 00 00 C0 0B B9 FD
8E 05 00 00 90 FF 00 00 63 FD 39 FE 9D 08 00 00
70 FF 00 00 2C 01 00 00

...it becomes apparent that my "missing" references to four-byte zeroed-out animation scripts after 0x190 are sitting right in the middle of that section:

Quote
00 00 00 00 5E 01 78 05 78 05 C4 FF C8 00 D0 FD
54 FC 02 00 00 00 00 00 1D 18 02 00 05 13 0E 00
00 00 00 00 94 01 00 00 98 01 00 00 9C 01 00 00
A0 01 00 00 A4 01 00 00 A8 01 00 00 AC 01 00 00
B0 01 00 00
19 01 19 01 19 01 00 00 C0 0B B9 FD
8E 05 00 00 90 FF 00 00 63 FD 39 FE 9D 08 00 00
70 FF 00 00 2C 01 00 00

0x1B0 references the last four bytes of the Model Settings Data section of the LZS. As for the bold offsets above, I've no clue what the data before and after them references.
« Last Edit: 2013-04-17 21:22:34 by Lazy Bastard »

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #20 on: 2013-04-17 21:30:12 »
These are file location pointers that, after loaded in memory, get transformed into memory location pointers. I'm not sure what their function is, exactly. They might have some special function in some rare cases like Midgar Zolom.

I have now found where these scripts are handled. I don't know the formatting of any of it, but the opcodes range from 8E - FE and their functions are defined at 0x4248C2 and are called from 0x41FDDB. More coming later...

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #21 on: 2013-04-17 22:10:24 »
You misunderstand...I'm fully acquainted with the model format; I'm the one that wrote the breakdowns on the wiki page you linked to :)
Ahh I see said the blind man! :D
I know where the individual animations are. I want to know where it is delineated as to which action corresponds to which animation. As in the example I made above, when the player tells Playable Character 1 to Steal, Character 1's animation 2B initiates. If the player tells Playable Character 2 to Steal, Character 2's animation 3A initiates.
that I did understand the fact is literally ALL of those indices are animations (so their are quite a few) and zeroth ones I suspect are not available or special I remember that discussion with Micky eons back.
Proud Clod seems to have the ability to affect the animation index of the various enemies ("If enemy does BrainBlast, do animation 09", etc). But I haven't seen any reference to doing the same with playable characters.

The end result would be the following: if I replace Barret with Zemzelett (which I'm not really going to do, in case you were wondering), I'll need to migrate Zemzelett's animations in place of Barret's (I can't simply swap files, as Model Settings Data is different between playable characters and enemies, and texture data is in the wrong place...not to mention weapon bone data being limited in enemies, etc). When the player tells Barret to throw a potion, the game somehow decides what animation to use for this. This does not appear to be contained in the model file itself. Thus if Zemzelett only has 0x2A animations, and Barret's "item use" animation is animation 0x3C, I can't simply replace Barret's animations en mass - I'll need to not only keep the total number of animations the same, but I'll also have to match up which animations I'd like to be performed for which actions, by fully mapping all animations and their actions. However, if I could modify the animation index itself (what animation each action calls), I could re-map the entire index to only utilize the 0x2A animations, and point each action to the corresponding animation with ease.

Point in fact, however, I'm not really familiar with the fine details of what Akari called Model Settings Data in his reversing work for QGears (and what I've continued to call that same name for consistency). If somewhere therein lies the animation index, please do point it out. Simply swapping the Model Settings data, even if animations are also swapped, results in a crash.
If you wanted to 'swap' things like that you would likely need to expand the indexes and number of animations in the file. For reference I would recomend going from cloud to aireth tifa or cid. As these all have similiar animation.  It should include the victory animation also. You likely can find that when the battle ends normally. Prod Clod I remember being helpful as it abused each character (heh). Erstwhile I'm sure you can figure it out faster than I can. Apart from playing each animation after decoding the data in Q-gears on the character in battle I'm not sure what else you could do.  That is once nice thing, about Q-gears as it can let you do just what I suggested as you have complete control via LUA scripting to do just that.

Granted it's an incredibly boring way to do it ... but that's just me. I believe the battle results are also scripted as part of the battles.  You may wish to examine that for your plans. Although it might be more or less work with a tool you are potentially unfamiliar with. If so hopefully you have a better route.

Cyb

Lazy Bastard

  • Insane poster
  • *
  • Posts: 298
  • Karma: 13
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #22 on: 2013-04-18 00:40:34 »
[...] the opcodes range from 8E - FE and their functions are defined at 0x4248C2 and are called from 0x41FDDB. More coming later...

Are these offsets in the PC version executable? Or the PSX ELF (SxxS file)? Or something else?


If you wanted to 'swap' things like that you would likely need to expand the indexes and number of animations in the file. For reference I would recomend going from cloud to aireth tifa or cid. As these all have similiar animation.  It should include the victory animation also. You likely can find that when the battle ends normally. Prod Clod I remember being helpful as it abused each character (heh). Erstwhile I'm sure you can figure it out faster than I can. Apart from playing each animation after decoding the data in Q-gears on the character in battle I'm not sure what else you could do.  That is once nice thing, about Q-gears as it can let you do just what I suggested as you have complete control via LUA scripting to do just that.

Granted it's an incredibly boring way to do it ... but that's just me. I believe the battle results are also scripted as part of the battles.  You may wish to examine that for your plans. Although it might be more or less work with a tool you are potentially unfamiliar with. If so hopefully you have a better route.

Cyb

Actually, I've already made functional custom models; I'm just handling a few annoying animation transitions. For example, as NFITC1 mentioned above, some actions call a series of animations, in sequence (jump forward, throw an item, jump back, for example). If I want to replace these three actions with a relevant animation for the new custom character, and I only want to use a single animation rather than three, I'll need to change the index NFITC1 pointed me to earlier in this thread. Otherwise, I'll have to try to fill two of the three animations with animations that flow smoothly with the animation I really want to use, which is quite difficult, if not impossible in most cases. The character still functions, but looks glitchy during certain animation sequences.

NFITC1

  • No life
  • *
  • Posts: 2931
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #23 on: 2013-04-18 01:55:04 »
The exe. I don't do the PSX stuff.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: (PSX) FF7 - Battle animation index for playable characters?
« Reply #24 on: 2013-04-18 22:16:18 »
Actually, I've already made functional custom models; I'm just handling a few annoying animation transitions. For example, as NFITC1 mentioned above, some actions call a series of animations, in sequence (jump forward, throw an item, jump back, for example). If I want to replace these three actions with a relevant animation for the new custom character, and I only want to use a single animation rather than three, I'll need to change the index NFITC1 pointed me to earlier in this thread. Otherwise, I'll have to try to fill two of the three animations with animations that flow smoothly with the animation I really want to use, which is quite difficult, if not impossible in most cases. The character still functions, but looks glitchy during certain animation sequences.
My memory is a bit hazy but don't the battle scripts fire of a series of animations for each script? IE 'walk' a step and move for example. I was thinking that it takes several activations of an animation for example for it to run to anywhere then throw something. I am trying to remember battle scenese with unique sequences in them (palmer fight prod clod the mysterious ninja fight etc.)

I remember someone complaining about how they fired a sequence of animations for attacking as being annoying or something. Anyhow, the animations are I believe dependant on the battle scene scripting correct? The battle engine has it's own script engine, I'm not sure it matters too much unless you plan on duping the battle scenes from FF7 itself.  I digress a bit I guess.

I suppose you might wish to work on the combat system first? Hmmm I remember Akari discussing the scripting a few years back.

The attack limit is what 9999? or something (heh).

Cyb