Qhimm.com Forums

Final Fantasy Forums => Scripting and Reverse Engineering => Topic started by: myst6re on 2010-12-07 22:12:52

Title: ff8 monsters : .dat files analysis
Post by: myst6re on 2010-12-07 22:12:52
Hello!
I currently working on the dat files of Final Fantasy VIII. So I put everything on the wiki I found on theses files:
http://wiki.qhimm.com/FF8/FileFormat_DAT (thanks to JWP and Mirex)
But... the model animation section is hard to understand, and without it, my 3d models are... incomplete:

(http://s2.noelshack.com/uploads/images/4159958362560_ff8modelscapture2.png)

Anyone know how to interpret this section? help...
Title: Re: ff8 monsters : .dat files analysis
Post by: obesebear on 2010-12-08 01:25:13
I know Mr Adults (aka Rich Whitehouse) over at richwhitehouse.com has cracked the FF8 model format.  Might be good to see if he can give you some pointers.
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2010-12-08 17:34:24
I can't help for the model section, but if you need some informations about the AI section, you can ask me.
Title: Re: ff8 monsters : .dat files analysis
Post by: ultima espio on 2010-12-08 17:42:28
MrAdults blew it open months ago :P

His new model viewer can view them, with animations too. Just ask him :P
Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2010-12-08 18:06:25
Okay, thank you for your replies, I watched Mr. Adults' tools, and "mesh2rdm" supports battle models. I also saw that "Noesis" (http://oasis.xentax.com/index.php?content=downloads) read them very well.
I'm going to ask how MrAdults did it.

I can't help for the model section, but if you need some informations about the AI section, you can ask me.

I'm interested, I will think when the time comes because I want to completely fill the page on the wiki.
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2010-12-08 19:25:22
Just to avoid confusion : I just look at the wiki, the part I meant is section 8 ('Battle scripts'), not section 5.

Some informations here looks a bit weird. It says section4 : unknown, section5: Ai scripts?; section10=sounds and section 11=textures, but if you take the common galbadian soldier for example, headers 4 & 5 are the same, and so are headers 10 & 11.

I wonder about sounds. If you replace the whole pampa .dat file with Ifrit's, on pampa island you'll met some Ifrits that will still use pampa sounds... 
Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2010-12-08 21:15:41
Thank you for the clarification, I wasn't sure for these sections.


Edit: section 7 completed!

Edit 2:
Some informations here looks a bit weird. It says section4 : unknown, section5: Ai scripts?; section10=sounds and section 11=textures, but if you take the common galbadian soldier for example, headers 4 & 5 are the same, and so are headers 10 & 11.

Although section 4 starts at the same position as section 5, there are still 11 sections. It simply means that section 4 is empty.
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2010-12-08 21:36:38
Nice work!

Just one thing I'd add - for abilities :
Quote
May be 0x02 (= magic) or 0x08 (= monster ability).

...or 0x04  (=item). 

Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2010-12-08 21:46:04
Damn, I had not seen this case. Raijin I suppose? I'll check that there is no other cases. thanks!
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2010-12-08 21:56:58
Yes, Raijin it is   :D

(or my edited galbadians, which are using several items as well)
 
Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2011-02-14 23:24:29
I don't know if Mr. Adults answer me someday...
Title: Re: ff8 monsters : .dat files analysis
Post by: Chev on 2011-03-21 20:17:47
I hope it's not necro bumping that one up since it's still on the first page. I started implementing the specs written on the wiki and the vertices seem to come out fine, but I get some weird values for the triangles and quads (like index 32000 or so for one of the vertices), so I still need to find the flaw in my geometry reader, but after that I'm gonna try my hand at the animation data.

EDIT: in fact yeah, that's really weird, the values always seem to be off by 0x8000 in the first index of each face/triangle.
Title: Re: ff8 monsters : .dat files analysis
Post by: sl1982 on 2011-03-21 23:06:59
I hope it's not necro bumping that one up since it's still on the first page. I started implementing the specs written on the wiki and the vertices seem to come out fine, but I get some weird values for the triangles and quads (like index 32000 or so for one of the vertices), so I still need to find the flaw in my geometry reader, but after that I'm gonna try my hand at the animation data.

EDIT: in fact yeah, that's really weird, the values always seem to be off by 0x8000 in the first index of each face/triangle.

We are taking a soft stance to necro'ing these days. If it seems that there is useful information in your post it will be allowed.
Title: Re: ff8 monsters : .dat files analysis
Post by: Chev on 2011-03-21 23:27:49
OK then. Well, I finally decided to just substract 0x8000 from each triangle/quad's first index and they all seem to make a lot more sense now, so I'll take a shot at assembling a mesh tomorrow. It's sorta really weird how much space seems to be wasted in .dat models though, with the huge empty stretches in bones or those seemingly useless bits. Ah well, what's important is that it works.
Title: Re: ff8 monsters : .dat files analysis
Post by: Dark_Ansem on 2011-03-22 09:48:03
what about animations, chew?
Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2011-03-22 10:36:09
OK then. Well, I finally decided to just substract 0x8000 from each triangle/quad's first index and they all seem to make a lot more sense now, so I'll take a shot at assembling a mesh tomorrow.

I had forgot to talk about this substraction. You can do "poly3.vertex_indexes[0] &= 0x7FFF;". I have edited the wiki page.
Title: Re: ff8 monsters : .dat files analysis
Post by: Chev on 2011-03-22 21:53:40
OK! I was wondering if maybe that bit being set was a psx-specific thing and they'd gotten rid of that on PC or something, but I guess it's not the case.

Dark_Ansem> well, one thing at a time, I'll have a much better shot at seeing if I'm on the right track with anims once I get the mesh displayed. I'm still going over the mesh assembling code I originally made for the FF9 viewer, I've had an exhausting day so it's not progressing very fast. While I'd love to start on anims tomorrow the weekend's probably a more realistic target. Plus I can't yet be sure it'll amount to anything, since So far all of my work has mostly been following existing specs. But fingers crossed.

All I can say for now is the anim section starts just like the texture section, ie there's a uint32 anim count, then anim_count uint32 offsets from the beginning of the block to each anim, but that's already on the wiki.

EDIT: I used the already existing (though not quite getting everything right) model viewer from kvaks to spot a few potentially interesting files, namely c0m080, one of NORG's orbs (two bones, one anim that's not moving at all) and c0m125, one of Ultimecia/Griever's spirals (first two anims are respectively rotating clockwise around the vertical axis and counterclockwise), which hopefully ought to simplify figuring out the format quite a bit. Well, we'll see.
Title: Re: ff8 monsters : .dat files analysis
Post by: myst6re on 2011-03-24 15:18:23
EDIT: I used the already existing (though not quite getting everything right) model viewer from kvaks to spot a few potentially interesting files, namely c0m080, one of NORG's orbs (two bones, one anim that's not moving at all) and c0m125, one of Ultimecia/Griever's spirals (first two anims are respectively rotating clockwise around the vertical axis and counterclockwise), which hopefully ought to simplify figuring out the format quite a bit. Well, we'll see.

Yes I have the same approach.
Title: Re: ff8 monsters : .dat files analysis
Post by: Chev on 2011-03-24 21:27:50
Ok, so let's take the spiral rotations as an example, both 20 frames animations of rotations on a single axis. In the clockwise one there's a 36 bit pattern that goes (in little endian, and the start may not actually be at that bit so the whole thing could be shifted)

Code: [Select]
0    0    C    7    6    E    1    0    0
0000 0000 0011 1110 0110 0111 1000 0000 0000

and in the counterclockwise one there's, with the same offsets,
Code: [Select]
0    0    C    B    9    1    0    0    0
0000 0000 0011 1101 1001 1000 0000 0000 0000

Now, if you just take bits 14 to 25 (leftmost bit being 1), 12 bits in total, you have
Code: [Select]
110 0110 0111 1 in little endian
111100110011  in big endian
which is 3891, aka -205, about -18 degrees with 12 bit angles

Code: [Select]
101 1001 1000 0 in little endian
000011001101  in big endian
         
which is 205, about 18 degrees

20 frames animation, 18 degrees by frame, so full revolution per anim cycle, delta stored. We're on the right track! Since the animation really only rotates on a single axis the three preceding bits, 0x7, must be some kind of flag. And, well, 0x7 followed by a 12 bit angle, that really looks like FF7's compressed rotations thingie (http://wiki.qhimm.com/FF7/Battle/Battle_Animation_%28PC%29#GetEncryptedRotationBits). So I'm gonna choose, as a work hypothesis, that it indeed works kinda like that and see where it gets me.

I'm rather unhappy with the 21 remaining zeros though, with a FF7-like system if I understand correctly I should be getting a lot less of them.
Title: Re: ff8 monsters : .dat files analysis
Post by: Vehek on 2011-05-29 02:41:36
I think that section 4 is texture-animation data (for example, eye-blinks).

The section begins with a list of 16-bit offsets into the section for the different animations. Unfortunately, there doesn't seem to be a count of how many different texture animations the model has. Many models have 0000 as their first offset. I assume that this is for models that don't always have a texture-animation running.

This is what I have so far for an individual texture-animation. It's all guesswork and I haven't checked it ingame yet.
Code: [Select]
struct texAnim
{
uint8 textureNum;
uint8 originalUCoord; //All UV coords here are for the upper left corner
uint8 originalVCoord;
uint8 regionUSize;
uint8 regionVSize;
uint8 copiedRegionCount; //1 less than the actual number
uint8 unknown1;
uint8 unknown2;
//Insert remaining UV coords here
};
I always have to double the "U" part of the UV coords and region-size to get a reasonable U coord/size. Maybe it has something to do with how the TIM format works?
Title: Re: ff8 monsters : .dat files analysis
Post by: Chev on 2011-05-30 22:14:30
Quote
Unfortunately, there doesn't seem to be a count of how many different texture animations the model has
While there is no count, that kind of list usually marks its end with a zero offset, so you could check for those if you haven't already.

For the coordinate transformation, I don't know. The closest thing I can think of is that in FF9 you have to shift the UV for the weapon textures because in-engine they're not loaded at the beginning of a texture page, but that would only account for translating the coordinates, not scaling them.
Title: Re: ff8 monsters : .dat files analysis
Post by: LandonRayW on 2011-06-03 00:25:21
Does anyone have any information on section 8?
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2011-06-03 07:54:09
if you need some informations about the AI section, you can ask me.
the part I meant is section 8 ('Battle scripts')

>:(

What do you wish to know exactly? I cannot answer everything, especially 'cause I am not home this week, but I have been playing a lot with this part and decrypted a lot of enemies strategy code. 
Title: Re: ff8 monsters : .dat files analysis
Post by: LandonRayW on 2011-06-03 17:24:15
I apologize.  The question was mostly posed to you, but I thought it best to phrase it in a more general sense.  No offense intended.  Actually, your the only person I know of who is knowledgeable about FF8's battle scripts (others have likely done work on it too, I'm just unaware of it).  I'm new to working on FF8's AI, most of my AI work has been on FF6, which is far more simplistic.  As of now, the only thing I can do reliable is change targeting.  That said, any information on section 8 would be useful, but mostly I'm looking for some basics.
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2011-06-07 17:37:46
I'm finally back home, sorry for keeping you waiting!

Okay, I'll tell you some things about FFVIII ai scripts, I hope myst6re doesn't mind the huge post in this topic. You might have figured out already part (or all?) of what is written below, but I find it more apropriate to start with the basics. I have no idea how monsters ai is coded in other FF game, FFVIII is the only one I've been toying with.

First, structure. Part 8 can be divided as follow :
- offsets
- ai script
- text

I'd be detailling the offsets. Let's take the classical galbadian for example : (note -  '__' stands for '00')

03 __ __ __   
10 __ __ __   : point to ai offsets
d8 __ __ __   : point to text offsets
e4 __ __ __   : point to text lines
 
14 __ __ __   : point to loading code (executed when the enemy appears)
58 __ __ __   : point to code executed at enemy's turn
bc __ __ __   : point to counterattack code
c0 __ __ __   : point to death code
c4 __ __ __   : not sure about that one.

values are given starting from the beginning of part 8 for the first four, and from one line after for the other (I suppose that's what the second offset is for.)



Now, syntaxis.
Let's take an extract from Edea1 :
02 04 c8 03 15 __ 07__ 04 c8 0c 06 23 06 __ 04 c9 0b 01 02 03 23 06 __

here we have three parts. The first one is actually a test : 02 04 c8 03 15
All tests begin with 02 ; I'll detail them later. If the result from this test is true, it will follow with the amount of bytes that is given afterwards : 07 00, that's 7 bytes. So now we have : [test] __ 07 00 [code if true] 04 c9 0b 01 02 03 23 06 __

That 'code if true' ends with 23 06 00. You can translate that by : skip 6 bytes. So in this case, we have a simple "if(condition is true) {04 c8 0c 06} else {04 c9 0b 01 02 03}"!

Last thing to tell : when the code will enconter a 00 it will stop. Best example is that piece of code, which you'll encounter with a lot of enemies, that tell them to skip their turn :
02 02 03 __ __ __ 04 __ [__ 23 __ __]
(02 02 03 is a probabilty of 1/3)



Now. Let's detail a little more what we can encounter - keep in mind that I'm far for having decrytped everything.


Tests

for most of them (I'm not sure about how the probability thing exactly works)
first byte  : 02
third byte : target.
fourth byte  :
   00 :  =
   01 : <
   02 : >
   03 : !=
   04 : <or= 
   05 : >or=
fith byte : number

second byte - tells what to check
00 : monster own HP   (ex : 02 00 c8 01 03 __ would be if his HP are below 30%)
01 : other monster HP (ex: 02 01 57 01 05 __ would be if a galbadian is below 50%)
03 : battle scene         (ex : 02 03 c8 03 04 : if we are not in fight 04)
04 : self, status (ex below : 02 04 c8 03 15, if she haven't got status 15 (safe))
05 : ennemies, status  (ex : 02 05 c8 00 17, if one of us acursed seeds have got status 17 (reflect))
06 : number of alive members in our party (ex : 02 06 c8 00 01, only one remains)
09 : is a certain character is present & alive (ex : 02 09 c8 00 03 : if Quistis is here)
0e : monster difficulty level (ex : 02 0e c8 05 01 : if difficulty level higher or equal to ‘1’ (medium)
   00 = retarded n00b, 01 = medium, 02 = hard.
11 : check if we have stolen a GF (ex : 02 11 c8 03 cc : monster lost his GF.)

talking of status, here is my current list :
        01 :   poison
        03 :   blind
        04 :   mute
        05 :   berserk
        06 :   zombi
        10 :   sleep
        11 :   haste
        15 :   safe
        16 :   shell
        17 :   reflect 
        18 :   aura
        1d :   float
        1e :   confuse
        21 :   double
        22 :   triple


Variables - just a few examples

ex : dc, dd, de, df, 60, 61 ...
0e dc 00 : set dc = 0
13 60 01 : add 1 to 60.
02 dc c8 00 00 : if(dc=0)

 
Text :
texts can be launched by some attacks, but it can be called directly from the ai code as well.
01 02 : say text line n°3.
1a 01 : say text line n°2, but after attack.
There are others, I won't detail all of them.


... I will continue later
Title: Re: ff8 monsters : .dat files analysis
Post by: Bosola on 2011-06-07 21:40:26
Excellent work, random_npc.

As for the AI scripts you're unsure about, c4 could be a battle end, pre-turn or 'special script'. FF7's AI engine let scripts call one of eight 'custom event' AI functions; it's entirely possible something similar is done here. Practically speaking, there's quite a few interesting hacks and effects you can implement with a pre-turn script, so again, that's another contender.

Keep posting!
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2011-06-08 12:52:33
Thanks Bosola !

About the one that I am unsure, I mostly haven't try putting stuff in here, and all monster files I've been working on had it empty.

Well, what should be added...


Stats
you can increase/decrease your monster stats.
Best example for that is Jelleye, that monster who change its characteristics. If you analyse its ai script, you'll see a lot of those :
25 [some value]   28 00 [some value]   28 02 [some value]   28 01 [some value]   28 03 [some value]

don't bother with 25 [some value], this will just add the specified line of text to the scan. 25 01 add the second line of text to the scan, and so on.

Normal Defense Morph    : 28 00 0a   28 02 0a   28 01 0a   28 03 0a
Complete Defense Morph : 28 00 0a   28 02 0a   28 01 28   28 03 28
Magic Defense Morph      : 28 00 05   28 02 14   28 01 03   28 03 64
Physical Defense Morph   : 28 00 14   28 02 05   28 01 64   28 03 03 

stats : 00=strength, 02=magic, 01=physical defense, 03=magic defense. There is also 04=speed, 05=evasion.
value : 0a = 10 in decimal, that means the monster normal stat. 28 would be 40, so four time the normal stat, and 64 10 times the normal stat. 03 or 05 will decrease its stat.


Items
You can award items to the player at the end of the combat in the ai script as well. For example, in Elvoret original code, 38 b2 will give you the march weapon magazine. 


Auto-status
You can give some auto-status to your enemies. For example, the two Iguion have a permanent reflect on them as long as you haven't stolen Carbunkl from them. It's a bit buggy, and it cannot be remove with dispel spell. The command to remove this auto-reflect is 27 17 00. 27 17 01 would set it up. 


Removing/Adding monsters.
We have an example in Wedge or Biggs code :
1d 00    1d 01    1f 02 = remove monster n°1, remove monster n°2, launch monster n°3 (Elvoret).
There can be up to 8 monsters in one battle, but there can be only 4 present at the same time.
(In the time compression sorcerers fight, there are actually 6 monsters, that are resurrected with different characteristics to fight you again)

An enemy can be launched or not, visible or not, targetable or not - I won't detail it today.
 

Target & Attack
04 ... is the simple way to target something.
   00->07 : Squall -> Edea (it should work up to Laguna, Kiros and Ward as well but I haven't check those)
       00 : Squall 
       01 : Zell
       02 : Irvine
       03 : Quistis
       04 : Linoa
       05 : Selphie
       06 : Seifer
       07 : Edea
        c8 :  self
        c9 :  random enemy
        cc :  all enemies
        cd :  all allies
        cf :  random ally
there are other values I'm not totally sure about.
Usually the target code is followed with a move command, in the Edea1 example I had given previously you had 04 c8 0c 06, 0c 06 being move n°7 (the move are listed in the section before, myst6re wrote about those). In this case move n°7 was the safe spell, so the code was simply : if(self hasn't got safe status) cast safe on self.
The target can be set way before the actual move command, and in some cases it seems the programmer forgot he had already set a target, because he wrotes the target code again - you might have notice it : some monsters first turn to one of your character, but then attack another one... that's why.

There are more complex target code. For example, still in Edea1's code :
02 05 c8 00 17 __ 17__ [26 __ c8 00 17    02 02 04 03 __ __ 05__ [0c 07 23 02 __] 0c 00 23 c8__]
move 07 is dispel magic and move 00 is her (weak) physical attack, so you can translate it in pseudo-C++  by :

if(an enemy has got reflect status) { target the enemy with reflect status;
   if(some probability) cast dispel; else astral punch; }

The whole target code is 26 00 c8 00 17. 

You can also target a specific monster : 26 00 57 00 09 targets a wounded galbadian. (the most wounded?)
Raijin or the red galbadian use this code to cure them. Totally useless in the original game, considering galbadian soldiers had so few HP you'd kill them in one hit. 02 01 57 01 05 __ 0c__[26 __ 57__ 09...
   

I've explained an attack code just before, but there are some other things you could add : let's take the final part of the first example I had taken from Edea1 : 04 c9 0b 01 02 03 23 06 __
so that's "target a random enemy; 0b=chose one of those three moves: move 2,3 or 4; skip 6 bytes".   
       
You can use some moves not listed in the moves section. However, it will only be some graphical or sound stuff, no damage will be calculated and no status applied. For example, in my edited Elvoret I've used 04 cd 1e 5f to sort-of summon Siren, or in Biggs or Wedge code, 04 cd 1e 6e  is the Wind attack that make them fly away.


Well, I don't know what else I could tell for now. Any questions?... Or would someone want to add anything?
Title: Re: ff8 monsters : .dat files analysis
Post by: LandonRayW on 2011-06-09 01:04:39
Thanks!  Amazing!  Wonderful work!  That covered pretty much everything I was looking for and then some.  I need to take a few days and test all this information to make sure that I understand it correctly, but I'll probably have a few questions.  For now, though, I have two questions.  One, do you have any idea what the status byte for "death" is (probably not all that necessary with FF8's targeting system, but it was essential for FF6)?  Two, have you found the target byte for "last enemy that attacked" (mainly for use with controlled counterattacks)?

Thanks again for all the information!

Edit:  The target byte for "last enemy that attacked" is CB (I'm fairly certain, but I haven't tested it extensively).
Title: Re: ff8 monsters : .dat files analysis
Post by: Vgr on 2011-06-09 01:27:33
Wow, you did a pretty good job and all, but... myst6re is a French GUY :evil:

More seriously, I believe that now that FF7 is mostly decoded, we will go into FF8 ^^
Title: Re: ff8 monsters : .dat files analysis
Post by: random_npc on 2011-06-09 23:08:34
Oops, indeed I forgot to elaborate on counterattacks. You might want to analyse Ifrit's ai, it checks a lot of interesting things here : if attack was a GF, if attack was shiva, if attack was a spell, if it dealt no damage at all, if Squall was the attacker... The death status, I'm not sure about it - reading my notes I suspect 00, or maybe 02. The target byte for "last enemy who attacked", that should be cb indeed, somehow I forgot to mention this one.  :D 
Anyway, glad I could be of help. I hope you'll release some ai re-written monsters available to test! For my part, I have several changes I'd like to make to my Elvoret, and I still haven't managed to remove that anoying bug from my galbadians.


 

 
Title: Re: ff8 monsters : .dat files analysis
Post by: Colly on 2011-06-10 08:32:56
Wow. Thanks for analysis, now I can change something more in the next hardcore mod :)
Title: Re: ff8 monsters : .dat files analysis
Post by: LandonRayW on 2011-06-21 21:42:09
People probably already know this, but I haven’t seen a list anywhere, so I thought I’d throw it out there.  In section 7 for altering monster abilities you need to know three things:  the byte for the type of ability, the byte for the type of animation, and the byte or bytes for the specific ability.

Ability Type: Magic, Byte 02
Animation Type: Byte 0B
Spell Bytes:
00 – Empty
01 – Fire
02 – Fira
03 – Firaga
04 – Blizzard
05 – Blizzara
06 – Blizzaga
07 – Thunder
08 – Thundara
09 – Thundaga
0A – Water
0B – Aero
0C – Bio
0D – Demi
0E – Holy
0F – Flare
10 – Meteor
11 – Quake
12 – Tornado
13 – Ultima
14 – Apocalypse
15 – Cure
16 – Cura
17 – Curaga
18 – Life
19 – Full-Life
1A – Regan
1B – Esuna
1C –Dispel
1D – Protect
1E – Shell
1F – Reflect
20 – Aura
21 – Double
22 – Triple
23 – Haste
24 – Slow
25 – Stop
26 – Blind
27 – Confuse
28 – Sleep
29 – Silence
2A – Break
2B – Death
2C – Drain
2D – Pain
2E – Berserk
2F – Float
30 – Zombie
31 – Meltdown
32 – Scan
33 – Full-Cure
34 – Wall
35 – Rapture
36 – Percent
37 – Catastrophe
38 – The End

Ability Type: Item, Byte 04
Animation Type: Byte 0B
Item Bytes:
00 – Empty
01 – Potion
02 – Potion+
03 – Hi-Potion
04 – Hi-Potion+
05 – X-Potion
06 – Mega-Potion
07 – Phoenix Down
08 – Mega-Phoenix
09 – Elixir
0A – Megalixir
0B – Antidote
0C – Soft
0D – Eyedrops
0E – Echo Screen
0F – Holy Water
10 – Remedy
11 – Remedy+
12 – Hero-Trial
13 – Hero
14 – Holy War-Trial
15 – Holy War
16 – Shell Stone
17 – Protect Stone
18 – Aura Stone
19 – Death Stone
1A – Holy Stone
1B – Flare Stone
1C – Meteor Stone
1D – Ultima Stone
1E – Gysahl Greens
1F – Phoenix Pinion
20 – Friendship

I’m still working on a list of monster abilities as well as what animations work with them (as sometimes there are multiple).

Sorry for the long post, but hopefully someone finds it useful.
Title: Re: ff8 monsters : .dat files analysis
Post by: JWP on 2019-03-03 00:47:50
Is there any more information anywhere on the DAT animation data?

What I've figured out so far is as follows:
The first byte is the number of frames as shown on the wiki.
The main function that reads the dat animation data looks to be at 0x00508F90.
There's a fixed array at 0xB8B9F0 of 4 bytes to help with uncompressing bits.
byte[] uncompress_helper = { 0x03, 0x06, 0x09, 0x10 }
There are 2 types of reads that are done on the animation data, bit reads and compressed bit reads.

there's a structure in memory used to parse the data that looks like:
struct animatonReadHelper {
    BYTE* current_animation_byte;
    int current_bit_position;
}

for bit reads, the following takes place:
int temp = *(current_position + 2) << 12 | *(current_position + 1) << 8 | *current_position //essentially reads 3 bytes in little-endian format
short value = (temp >> current_bit_position) & ~(0xFFFFFFFF << bitsToRead)
value = (value << (16 - bitsToRead)) >> bitsToRead //This looks odd but it's done as an arithmetic right shift to sign extend the bits

current_animation_byte += (bitsToRead + current_bit_position) / 8 // increases pointer by number of bytes read
current_bit_position = (bitsToRead + current_bit_position) % 8 // sets the position in the next byte to read from

For reading compressed bits, the following happens:
2 bits are read and this is used as an index with the fixed array above i.e.
0 -> 0x03
1 -> 0x06
2 -> 0x09
3 -> 0x10

Then this amount of bits are read and sign extended as above.
The function for compressed bit reads is at 0x00509320
The function for standard bit reads is at 0x005092A0
All offsets are for the English Steam version
Title: Re: ff8 monsters : .dat files analysis
Post by: Vehek on 2019-03-03 01:54:30
Is your analysis so far any different than this one from last year?
ff8 battle file animation format (http://forums.qhimm.com/index.php?topic=18249)
Title: Re: ff8 monsters : .dat files analysis
Post by: JWP on 2019-03-03 02:06:21
What I said seems to match up to the position data stuff, I haven't looked deep enough into it yet to comment about the other stuff.