Actions

SCHG

Sonic Heroes/Texture Animation Editing

From Sonic Retro

SCHG: Sonic Heroes
Main Article
Mechanic Editing
DOL Editing
EXE Editing
::::Music Pointers
::::Object Parameter Data
Relocatable Editing (PC)
::::File Offsets
Model Editing
Collision Format
Model Format
Level Editing
Camera Editing
Event Editing
::::ID list
Indirect Editing
Level List
Object Editing
Object Porting
Texture Animation Editing
Visibility Editing
Particle Editing
Particle Editing
Sound Editing
Music List
Sound Editing
::::Voices
SCHG How-Tos
Custom Object Material Effect Tutorial
Level Editing Tutorial


The .txc format is used to define animated textures within stages. Within the .txd, animated textures have the form name.1; name.2; ... name.N where N is the amount of frames.

Structure

   struct {
       u32 frameCount; // total frames of animation
       u8 zero[516]; // god knows why this is here
       char firstFrameTexture[32]; // name of first frame in .txd (e.g. s3tk1.1)
       char animatedName[32]; // name of animated texture as a whole (e.g. s3tk1)
       struct {
           u16 frameOffset; // frame index
           u16 textureID; // texture for this frame
       } frames[...]; // repeated until 0xffffffff
   } animatedTextures[...]; // repeated until 0xffffffff


Each of the structs is repeated until the uint32 value 0xffffffff.

Interpretation

Each frame consists of two values, 'frameOffset' and 'textureID'. Texture ID refers to the number at the end of the texture's name within the .txd.

Frame Offset is the offset of the current frame within the animation. Note that it may seem that the first frame is index 1; but it most certainly isn't, some later stages use frameOffset 0.

Frame Count is the total amount of frames within the animation, and NOT the amount of frame structs below. Not every frame of the animation is stored in the file, missing ones are presumably 'interpolated' by using the previous frame. For example, if frame 1 is s3tk1.1 and frame 4 is s3tk1.2; then frames 2 and 3 are also s3tk1.1.

Some animations may have a final frame with an invalid frameOffset (and textureID). No clue what this means.