Community Project: Animations

Discuss Halo 2 modding, progress on figuring things out, mapfiles...you know the drill. Cheating discussion not allowed.
Post Reply
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Community Project: Animations

Post by grimdoomer »

I've been doing some research on animations and I've found quite a lot. Now I need you to help me help you :wink: Here is a compression table, all the info I found, and a research app to help you out. I need people to help me with this, there is only so much I can do by myself. It doesn't matter if you don't know anything about animations, models, or raw. If you can use a hexeditor thats all you need.

Compression Table:

Code: Select all

    CODEC #0 _no_compression_codec AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00 
    CODEC #1 _uncompressed_static_data_codec AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00 
    CODEC #2 _uncompressed_animated_data_codec AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00 
    CODEC #3 _8byte_quantized_rotation_only_codec AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00 
    CODEC #4 byte_keyframe_lightly_quantized AVERAGE KEY RATIOS Rot:0.22, Trs:0.26, Scl:1.00 
    CODEC #5 word_keyframe_lightly_quantized AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00 
    CODEC #6 reverse_byte_keyframe_lightly_quantized AVERAGE KEY RATIOS Rot:0.27, Trs:0.64, Scl:0.12 
    CODEC #7 reverse_word_keyframe_lightly_quantized AVERAGE KEY RATIOS Rot:0.07, Trs:0.14, Scl:1.00 
    CODEC #8 _blend_screen_codec AVERAGE KEY RATIOS Rot:1.00, Trs:1.00, Scl:1.00
Raw Data Layout:

Code: Select all

//Header
AnimationCodec - Byte
RotatedBonesCount - Byte
MovedBonesCount - Byte
ScaledBonesCount - Byte
Unknown - Int32?
AnimationPlaybackRate - float
DataSize - Int32
DataSize - Int32
RotatedBonesBlockSize - Int32
MovedBonesBlockSize - Int32
ScaledBonesBlockSize - Int32

//Data
//Compression #0

//Compression #1

//Compression #2

//Compression #3

//Compression #4

//Compression #5

//Compression #6

//Compression #7

//Compression #8
public struct RotatedBone
{
  public float i, j, k, w; //Rotation I believe
  public float i, j, k, w;
  public float i, j, k, w; //It's based on 3 Quaterions
}
What we Need:
We need to figure out what bones are being rotated and when. Looking at Compression 8, I can't seem to find an Index, maybe one of the Quaterions is the coords of a bone, but that seems like a waste of space. We also need to figure out how the compression works. I've looked up quantized compression, and it is a form of lossy compression, so we might need to look for a compression matrix :hmm2:

App
Image
Download

It shows info on the animations Raw Blocks, and Calls. It also can extract a raw block, note you will still need to goto the animations call's offset which is with in the block. Do this by extracting the Raw Block, then going to the call's offset. Archive includes source and build. Now get researching!!!
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Re: Community Project: Animations

Post by xzodia »

I'd like to help but I'm not sure what is meant to be done...
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Re: Community Project: Animations

Post by grimdoomer »

xzodia wrote:I'd like to help but I'm not sure what is meant to be done...
Animations are basically a list of: bones, what time they are being roated, scaled, or moved, and by how much. Halo 2 uses 8 compression codecs, ranging from no compression, to lightly quantized compression. Codec 8 for example, has no compression, so the values are 100% true. What we need to figure out, is how to decompress/compress the compressed animations, and what bones are being rotated, scaled, or moved and when. Once we find those two key components out, the rest is simple trial and error.
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Re: Community Project: Animations

Post by grimdoomer »

Anyone?
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
Hawaiian Modder




Pi Connoisseur

Posts: 2154
Joined: Sat Nov 26, 2005 7:17 pm
Location: In a cave smokin up with tupac and big foot.

Re: Community Project: Animations

Post by Hawaiian Modder »

I'd love to help and get the modding community going but this is kinda out of my league. If I knew what I was doing or looking for I could probably help, but without help on the subject I cannot help.
Image
Thanks lej for the sig.
Dr.Cox wrote:I like Cox.
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Re: Community Project: Animations

Post by OwnZ joO »

Grim, I think you would do well to write a tutorial on researching and mapping out tags and whatnot. A lot of people don't understand the process of it, and think that it always requires hex editing, which scares them off. I would write it, but you seem to do a lot more research than me(none)
User avatar
InvaderVeex





Posts: 483
Joined: Tue Jul 25, 2006 2:57 pm
Location: LandO'Palooza!
Contact:

Re: Community Project: Animations

Post by InvaderVeex »

There's a couple people who've extracted animations from the game, imported them into 3ds max, and made new animations and put those into the game. Just so you know. If you want to figure it out faster I suggest talking to Choking Victom.
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Re: Community Project: Animations

Post by grimdoomer »

InvaderVeex wrote:There's a couple people who've extracted animations from the game, imported them into 3ds max, and made new animations and put those into the game. Just so you know. If you want to figure it out faster I suggest talking to Choking Victim.
There keeping it private, there not gunna release info. Why do you think I started this topic.

Split at thread starter's request. Please refrain from posting needless crap.
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
JacksonCougAr




Recreator

Posts: 2333
Joined: Fri Jan 12, 2007 1:56 pm
Location: Canada
Contact:

Re: Community Project: Animations

Post by JacksonCougAr »

Got some basic stuff for anyone who wants to research this. I just started looking at rotations and figured out that the order of the quaternion's are k, j, i, w.

The quaternion's are commonly compressed using simple quantizing. So for the example of the Short compression for rotations; each component of the Quaternion is compressed to a short: you can decompress it by taking the value of the short component and dividing it by the signed short max value, which returns the decompressed float.

float DecompressedValue = (float)(CompressedShortValue / Short.MaximumValue);

Also certain raws may have multiple headers, which have data describing the offset and size of certain blocks of data in the raw itself, the actual keyframes of the animation, etc.

Been messing around some more: from what I could tell after looking at a couple examples of raw is divided into sub-raws... which contain resources for rotation, translations and scale. The raw will have a group of one data type and then have an index for a bone to follow that. Header doesn't seem too helpful in finding the starts of these blocks though ;p

Image

Image

Image
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Re: Community Project: Animations

Post by grimdoomer »

Wow, you obvisouly did not take into consideration that info for the Header I posted.
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
JacksonCougAr




Recreator

Posts: 2333
Joined: Fri Jan 12, 2007 1:56 pm
Location: Canada
Contact:

Re: Community Project: Animations

Post by JacksonCougAr »

Nope; I generally ignore others research until I have confirmed it for myself.
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Re: Community Project: Animations

Post by grimdoomer »

JacksonCougAr wrote:Nope; I generally ignore others research until I have confirmed it for myself.
Ok well not only did you miss lots of data, and get some things wrong, you also don't pay attention to the number of animations in each raw block do you? That teleporter animation is only 32 bytes long.

Well here is some info that will help out a lot.

Each animation has a generic Header of 16 bytes. Followed by a subheader for additional data.

Code: Select all

CodecNumber - Byte
RotatedBonesCount - Byte
MovedBonesCount - Byte
ScaledBonesCount - Byte
Unknown - Int32
AnimationPlaybackRate - Int32
DataStart - Int32
Reversed Byte Keyframe Lightly Quantized:

Code: Select all

Header:
DataStart - Int32
KeyframeDataStart - Int32
UnknownDataStart - Int32 //Maybe Movement Data
UnknownDataStart - Int32 //Maybe Scaled Data
RotationDataStart - Int32
BoneDataStart - Int32
BoneDataStart - Int32
Zero - Int32
KeyframeCount - Int32

KeyFrame Data:
FrameNumber - Byte

There will be one rotation/movement/scale for each frame. If no action occures that frame is skipped.

Rotation Data:
k - Int16
j - Int16
i - Int16
W - Int16

You must decompress them, but presreve the orginal data:
float val1 = br.ReadInt16();
val1 = val1 / short.MaxValue;
Will post more when I get home.
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
JacksonCougAr




Recreator

Posts: 2333
Joined: Fri Jan 12, 2007 1:56 pm
Location: Canada
Contact:

Re: Community Project: Animations

Post by JacksonCougAr »

I didn't feel at the time to expand on my hasty explanations but I had questions marks next to ambiguous/unsure things: like sometimes the offsets and sizes are always the same so I did not know which was which.
Post Reply