View Single Post
Old 07-17-2009, 07:08 PM   #84
jott
Rookie
 
Join Date: Jul 2009
Posts: 58
Here are my latest findings:

Code:
typedef struct CostumeHeader {
  unsigned int identifier; // number corresponds to filename
  unsigned int relativePositionToObjectName; 
  
  unsigned int numberOfTextures; // Number of dxt files referred
  unsigned int realtiveOffsetToTextureIndex; // relative to current position
  
  unsigned int numberOfStates; // Like InitLeft or WalkLeft
  unsigned int relativeOffsetToStateIndex; 
  
  unsigned int unk1;  // 0 most of the time, sometimes 1,2,3
  
  unsigned int numberOfSpriteGroups; // 1 most of the time, in the rage of 1-11
  unsigned int relativeOffsetToSpriteGroups;
  
  unsigned int unk2; // 0 most of the time, sometimes 1,2,3,4
  
  unsigned int numberOfPointsOnPath; // some sort of 2D positions
  unsigned int relativeOffsetToPath;
  
  unsigned int num3_1; // 0 most of the time, sometimes 1
  unsigned int num3_2; // always 0

  float version[3]; // always 0.5 1.0 1.0 
  unsigned int reserved[3]; // always 0 0 0
} CostumeHeader;

typedef struct TextureIndex {
  unsigned int identifier;
  unsigned int relativeOffsetToFilename;
} TextureIndex;

typedef struct StateIndex {
  unsigned int relativeOffsetToStateName;
  unsigned int identifier;
  unsigned int numberOfStateData;
  unsigned int relativeOffsetToStateData;
} StateIndex;

typedef struct SpriteGroup {
  unsigned int identifier;
  unsigned int unk1;
  unsigned int numberOfSprites;
  unsigned int relativeOffsetToSprite;
} SpriteGroup;

typedef struct PathPoint {
   char unk1;
   char unk2;
   char unk3;
   char unk4;
   float x;
   float y;
} PathPoint;   

typedef struct Sprite {
   unsigned int textureNumber;
   unsigned int textureposx;
   unsigned int textureposy;
   unsigned int width;
   unsigned int height;
   float screenposx;
   float screenposy;
   unsigned int unk2;
   unsigned int unk3;
   unsigned int unk4;
} Sprite;


typedef struct StateData {
   unsigned int spriteGroup;
   unsigned int sizeOfFrames; // ???
   unsigned int numberOfFrames;
   unsigned int relativeOffsetToFrames;
} StateData;

typedef struct Frame {
   unsigned int spriteIndex;
   unsigned int unk1;
   unsigned int unk2;
} Frame;
I think it is nearly complete now. Some work has to be done for the StateData and Frames but I guess some bruteforcing could bring some more insights. The other "XML" files should have a similar structure.

I guess the main question is on how to proceed...
One way could be to transform the structure to a real XML file so it can be modified with a text editor - the other would probably be some kind of visual editor.... well I don't have *that* much time unfortunately..... any help is needed!
jott is offline   you may: quote & reply,