Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: halkun on 2007-04-15 19:19:53

Title: PC Battle Animations?
Post by: halkun on 2007-04-15 19:19:53
Does anyone know where the battle animations are located in the PC version? I know the field files use the .A files. Has the battle animations been deciphered yet?

Title: Re: PC Battle Animations?
Post by: ice_cold513 on 2007-04-15 22:41:49
Well, Cloud's is RTDA (in the battle.lgp)

A-lot of the animation's start with DA

Title: Re: PC Battle Animations?
Post by: squeeble on 2007-04-15 23:20:01
Also I'm not sure on this but it might be the second file in a characters hierarchy , so clouds rtba or any file ending in ba. Because a few times I've accidentally swapped these files with a .p file and it's totally spazzed out the character, like i accidentally did this with cid and you would select attack or any other command, and he would just stand there and eventually spazz out and do a whole bunch of commands and some that didn't belong to him then he would inexplicably die and the game would crash :lol:.
Title: Re: PC Battle Animations?
Post by: ice_cold513 on 2007-04-16 08:39:37
humm, i know that the BA file's holds stuff like. The way they move in limit's,magic's and item's and
maybe the attack's too.

The DA file's are the skeleton's that make the model's look the way they do, not some blob of model part's.

EDIT I did some digging for you

Here is are two topic's
http://forums.qhimm.com/index.php?topic=837.0
http://forums.qhimm.com/index.php?topic=1208.msg19066#msg19066
Title: Re: PC Battle Animations?
Post by: Izban on 2007-04-17 07:22:25
da is the animations and aa is the skeleton only reason i know this is if you slap another **aa which only has 18 bones on cloud he still holds his stance just the .p files may be more or less overlapping and halkun i hope to god you can crack the animation format cause that'll make life a lot easier for mini modders like me  ab i have no idea what does
Title: Re: PC Battle Animations?
Post by: squeeble on 2007-04-17 08:14:23
Yeah I'm with Steve Jr if i could manipulate the bones on those models even just being able to move them would be a great help. Let's hope you succeed.
Title: Re: PC Battle Animations?
Post by: Izban on 2007-04-17 11:30:51
you can manipulate the bones you just need a hex editor

Halkun if i was you i would try and get in contact with ficedula because ifalna can read some battle animations.

You should also look at this thread
http://forums.qhimm.com/index.php?topic=3576.0
Title: Re: PC Battle Animations?
Post by: Borde on 2007-04-17 23:44:00
WHAT?! When did Ficedula decode this thing?
Last time I checked only the first frame could be decoded (and that's as far as Kimera can go for now). Guess it's time to ask him some questions :-P
EDIT: Looks like it was on 24th July 2005... guess I should search harder next time.
Title: Re: PC Battle Animations?
Post by: Izban on 2007-04-18 04:29:56
I've made some slight alterations to some animations but the weapons don't follow the arms, which leads me to believe that the weapons have there own animations somewhere.
Title: Re: PC Battle Animations?
Post by: Cyberman on 2007-04-18 15:25:55
Weapons are seperate from the model. (In the PS1 version they are packaged with the model but they are a seperate model).
As far as I know Qhimm and Spiro decoded both formats 2 years ago. It was very interesting reading also on how it worked.
That's the PS1 data, which I think the PC version uses the same format to be honest.  It uses a programmable word width and delta compression.

Cyb
Title: Re: PC Battle Animations?
Post by: Reunion on 2007-04-18 23:06:48
Well I'm not really sure, but it does not seem that the document that L. Spiro wrote is on the Wiki. Someone should really put it up there before it's taken off his memoryhacking site, and so it's easier to find. I guess it's not a problem since it's still on his site.

Here is the original thread: Battle Animation Format (http://forums.qhimm.com/index.php?topic=4318.0)
and the document:
DOC format (http://www.memoryhacking.com/Docs/Battle%20Animation%20File%20Format.doc)
PDF format (http://www.memoryhacking.com/Docs/Battle%20Animation%20File%20Format.pdf)
Title: Re: PC Battle Animations?
Post by: halkun on 2007-04-19 13:24:33
It's in the Wiki now....

http://wiki.qhimm.com/FF7/Battle/Battle_Animation_%28PC%29

^_^

Looking through it, that's some really intresting stuff.
Title: Re: PC Battle Animations?
Post by: Borde on 2007-04-19 14:45:34
Just what I needed! Thanks for posting those links Reuinon.
Title: Re: PC Battle Animations?
Post by: mirex on 2007-04-20 13:03:02
Hi
I've been trying to use L.Spiro's document to decode the battle animation, but as you can see in Biturn I was not successfull. I tried to follow his document but still I decoded only first frame. Only on some models more than first frame are displayed. Maybe you'll have more luck than I had.

I also tried to contact L.Spiro multiple times regarding this problem, but I got no replies...
Title: Re: PC Battle Animations?
Post by: Borde on 2007-04-20 15:13:09
Mmmm... well, thanks for the advise Mirex. I'll try and see If I have more luck anyway.
Title: Re: PC Battle Animations?
Post by: MrAdults on 2007-05-05 23:34:37
Hi. I'm new here, so as a quick introductory, I am a programmer. I'll leave it at that. :)

Anyway, I've written a tool to view PSX-format models/weapon models/animations, and convert them to my own skeletal model and animation formats. I used some of the information up on the Wiki regarding the mesh and PC version animation formats to get it up and running. I've stuck the module from my tool for the handling of FF7 modules up here:

http://www.telefragged.com/thefatal/other/model_ff7.cpp

Start at the Model_FF7_Open function, that handles a buffer of the raw LZS data and goes from there decompressing and then handling the actual battle model data. That should be enough to push you in the right direction (my coding style is also fairly sane and does not contain random inline assembly).

Regarding the handling of animations for the PSX version, there are some things to note outside of how the PC animation formats are handled:

1. As mentioned on the Wiki (at least I think I saw this somewhere), animations are stored starting at section 2 (with 0 being the primary model/bones, and 1 being unknown).

2. The layout of data at the beginning of each animation section is as follows (couldn't find this info anywhere):

unsigned short frameNum; //number of frames in this animation section
unsigned short animSize; //size in bytes of the anim (I think)
unsigned char key; //as mentioned in the PC animation format document, this is the bit size decoding key

The actual animation data follows, 5 bytes into the section. You then read frames by iterating up to frameNum and reading rotations for every bone for each iteration.

3. Following the main animations, and before reaching the TIM/weapon model sections, there are some unknown sections. The first few of these encountered do not look like any documented structure, and what follows that resembles animation data. However, that animation data has a very small frame:size ratio. I suspect those unknown sections are base bone rotations stored in a different structure, and the following animation sections are then stored as differently encoded deltas to those base rotations. That is just a guess from looking at the data, I haven't tried stepping through PSX FF7 to see what happens with that data or anything.

I think that is everything. Hope it helps. As a side note, here are some pictures of models in my engine and my modified Quake engine:

http://www.telefragged.com/thefatal/images_new/cloudhi.jpg
http://www.telefragged.com/thefatal/images_new/angel.jpg

Edit: Cleaned up a few things (suffering from sleep deprivation/bad sleep schedule)
Title: Re: PC Battle Animations?
Post by: halkun on 2007-05-06 03:16:03
Thanks!

I'll probably toss this into SVN under the utility dir. It's nice to have code snippits to take from.
Title: Re: PC Battle Animations?
Post by: Cyberman on 2007-05-06 17:04:56
Battle models aren't lit correct? You may have to undo some of the "prelighting" adjustments they made to the models and normalize it correctly for a model that is to be put into an illuminated environment otherwise they will always look to dark.  (your hicloud image exhibits this)

Stephen
Title: Re: PC Battle Animations?
Post by: MrAdults on 2007-05-06 17:45:18
The baked in vertex colors are treated as a diffuse texture map. The tool also has an option to duplicate verts and generate texture coordinates and spit out an actual texture map from the vertex colors. You could take it a step further and try to pick out tone differences between areas to preserve general coloring while flattening, and generate a normal map or something based on the perceived shading. Something like that is never going to be foolproof though, you just have to do some manual artist work if you want to go that far. It's the same issue you'd run into trying to light diffuse textures from any old game that had lighting painted on.