Gildor's Forums

Author Topic: Question about AnimSequence format  (Read 5420 times)
DerPlaya78
Newbie
*
Posts: 10


View Profile
Question about AnimSequence format
« on: December 19, 2009, 01:06 »

hi gildor,

I'm trying to figure out some stuff about the internal format of Unreal3 AnimSequences (for Arkham Asylum).
I can read the CompressedTrackOffsets Property and know what it means (RotationTrack, TranslationTrack, etc.)
I can read the Translation Tracks (no compression, just 3 floats, key time values), but I have problems figuring out the format for rotation tracks.
this is what i think i know so far:

if numKeys == 1 then rotation is FQuatFloat96NoW (float xyz[3], w is sqrt(1 - (x*x + y*y + z*z)))
else there is float min[3], float range[3], short[3] * numkeys, byte keytimes[numkeys]...

the short[3] part is where i need help, i tried to treat them as halfs, or dividing by 65335 and computing w, or treating them as euler angles...

the format used is ACF_Fixed48Max.

I'm just interested in this format because batman uses this for all animations...

I hope you share your secret on this... if not, i can understand...
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Question about AnimSequence format
« Reply #1 on: December 19, 2009, 13:14 »

Yeah ... FQuatFixed48Max is VERY complex quaternion. Programmers have tried to improve quality of data compresion without increasing its size in memory. After some computations I've figured that FQuatFixed48Max is 30-50% (I don't remember exact value) worse than FQuatFixed32NoW Smiley
Code for supporting this format is very slow and large. Even more: programmers have decompressed the same data twice to compare results Cheesy
It's very strange that all Batman's animations are compressed with that ugly algorithm.
Logged
DerPlaya78
Newbie
*
Posts: 10


View Profile
Re: Question about AnimSequence format
« Reply #2 on: December 20, 2009, 03:28 »

...but i need a hint how to decompress it, just a nugde in the right direction. i know that float mins[] are the minimum values for x,y,z and mins + range is the maximum. please just answer these questions:

1. is right that the 3 shorts are expanded to floats (float = short / 65335f)
2. which values do you need to decompress a single keyframe - mins, range, all keys or just the three shorts (delta compression?)

one reason for asking is that i'm exporting/importing all the data i can into udk to play around with it.
things i can already export/import are skeletalmeshes, staticmeshes, sounds, facefxassets, textures, materials, materialinstances, physicsassets(ragdolls)
all that's left are animations.

i exported some animations with umodel but some are not working 100% correctly...
...example BmGame.u AnimSet 'FloorKO_Attack' between time 63.0 - 71.0, the left leg/calf twists in a funny way...
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Question about AnimSequence format
« Reply #3 on: December 20, 2009, 14:36 »

This is a FQuatFixed48Max excerpt from umodel code. I hope this will helps.
Inform me if you'll find a reason for "twists" Smiley

[вложение удалено Администратором]
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Question about AnimSequence format
« Reply #4 on: December 20, 2009, 14:40 »

Should I add special board "unreal coding" (or any other name with similar meaning)?
Logged
DerPlaya78
Newbie
*
Posts: 10


View Profile
Re: Question about AnimSequence format
« Reply #5 on: December 20, 2009, 15:48 »

wow, thank you!

more complicated than i thought... i'll try to figure out, what's the problem with batman's animations.

The skeletons for batman models is a bit different than for example unreal tournament models:
They use 2 different bones in arms and legs, which are attached to the same parent and control translation/rotation and twisting separatly... i noticed this, because the ragdoll models look a bit funny in udk (have to reparent the bones to make it look right)

As for the forum, it's your place  Wink . If this this category becomes flooded with posts you can always move them to a new board...

edit: just tried it and it works..., i will write a psa exporter next and try to find the twisting problem.
« Last Edit: December 20, 2009, 16:16 by DerPlaya78 » Logged
DerPlaya78
Newbie
*
Posts: 10


View Profile
Re: Question about AnimSequence format
« Reply #6 on: December 21, 2009, 01:53 »

my psa exporter is done... the resulting psa files are 99.9% identical to yours (only some very small floating point differences from quat/vector interpolation)

I think the twisting problem is a problem with the animation itself. I found the quats which cause the problem and checked if they are in range mins + ranges
- they are and they are the only values which use such a high range (all other quats are much closer to mins)

must have slipped QA... it's only really visible if you play the animation frame by frame, i haven't noticed ingame.
It could also be, that the animation isn't used ingame (some stuff gets cooked and isn't used at all). Perhaps I'll try to find more problematic animations...

edit: found some more weird twists... it's always one of those twist bones (2 bones, rotation/translation + twist/translation, same parent), perhaps there's some special magic inside the engine. If those bone poses are applied to the vertices, they get transformed twice, perhaps they do something (change the order, clamp some values, etc.).
« Last Edit: December 21, 2009, 02:41 by DerPlaya78 » Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS