March 28, 2024, 07:13:35 PM

Username
Password

Pages: 1 ... 3 4 [5] 6 7 8   Go Down
Print
Author Topic: Portrait meshes  (Read 138192 times)
0 Members and 1 Guest are viewing this topic.
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #60 on: November 15, 2017, 01:28:11 AM »

the heads.db file is partially described in the wiki
I don't know if it helps with reversing key/seq files
but here is the rest of it... (guess work as always)
Code:
struct HEAD //  sizeof 39 bytes (0x27)
{
0x00    unsigned char ID[2]; // Presumably controls which texture is used. e.g. MB=Morgab Bernhardt
0x02    unsigned char Flags; // see table 1
0x03    unsigned char KeySeq; // animation to use?
0x04    ?? always zero

0x05    unsigned char MouthWidth;  // These may not be unsigned. Not Tested.
0x06    unsigned char MouthHeight;
0x07    unsigned char MouthX;      // This is where to draw the moving parts on the main graphic
0x08    unsigned char MouthY;      // (replacing what is there already) for facial animation

0x09    unsigned char EyesWidth;  // These may not be unsigned. Not Tested.
0x0A    unsigned char EyesHeight;
0x0B    unsigned char EyesX;      // This is where to draw the moving parts on the main graphic
0x0C    unsigned char EyesY;      // (replacing what is there already) for facial animation
//
0x0D    char body_mesh_id // meshes/%d.m3d file
0x0E    signed char head_body_x; // seperate from center...padding?  does not include the neck.
0x0F    signed char head_body_y; // ...
0x10    signed char head_body_z;
//
0x11    char head_mesh_id // meshes/%d.m3d file
0x12    signed char HeadX;
0x13    signed char HeadY;
0x14    signed char HeadZ;

0x15    char head movement multiplier
0x16    char KeyID // for cut-scenes?

0x17   char NeckID;
0x18   signed char NeckX;
0x19   signed char NeckY;
0x1A   signed char NeckZ;

0x1B    char WeaponID; // 0x27 = bow, 0x33 = sword, etc.
0x1C signed char WeaponX;
0x1D signed char WeaponY;
0x1E signed char WeaponZ;  

0x1F    char BackpackID;
0x20    signed char BackpackX;
0x21    signed char BackpackY;
0x22    signed char BackpackZ;

0x23    char HelmentID
0x24    signed char HelmentX;
0x25    signed char HelmentY;
0x26    signed char HelmentZ;
};
« Last Edit: November 15, 2017, 03:26:39 PM by aqrit » Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #61 on: November 15, 2017, 02:05:09 PM »

Really good work, I'll run some tests today myself using this

to better understand seq files,

thankyou  Smiley
Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #62 on: November 15, 2017, 02:31:46 PM »

Do you know if morphing animation is used Olly?

actually changing vertices I mean,

in any of the heads
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #63 on: November 15, 2017, 02:56:49 PM »

I don't sorry
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #64 on: November 15, 2017, 03:01:11 PM »

Alright, thanks.
Logged
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #65 on: November 15, 2017, 03:23:41 PM »

correction:

byte offset 0x16 of the "HEAD" struct seems to control which KEY file is used during the "talkie" first cut-scene...

Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #66 on: November 15, 2017, 04:09:53 PM »

good Smiley I'm trying this out now
Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #67 on: November 15, 2017, 04:25:34 PM »

haha, Morgan Burnheart's flying about  Grin
Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #68 on: November 19, 2017, 07:52:47 PM »

To anyone who's interested, I have found out a bit more about .key files,
with help from aqrit's db code

.KEY files appear(Pretty sure) to contain a list of keyframes, which are just a rotation for the
head and a rotation for the body.
each keyframe is a struct that is 12 bytes,

the first byte of a .key file is the number of keyframes in the file(e.g. 64 frames in 0.KEY)

//the second bytes for each rotation has more effect,
//e.g. something like 0-275 degrees while the first
//has a lesser 0-85, not sure exactly


For example:
Code:
struct BODYHEAD{
    //12 bytes
    //Body rotation
    0x00    signed char body_rotation_x1; // a rotation value around x axis
    0x01    signed char body_rotation_x2; // a greater rotation value around x axis
    0x02    signed char body_rotation_y1; // a rotation value around y axis
    0x03    signed char body_rotation_y2; // a greater rotation value around y axis
    0x04    signed char body_rotation_z1; // a rotation value around z axis
    0x05    signed char body_rotation_z2; // a greater rotation value around z axis
    //Head rotation
    0x06    signed char head_rotation_x1; // a rotation value around x axis
    0x07    signed char head_rotation_x2; // a greater rotation value around x axis
    0x08    signed char head_rotation_y1; // a rotation value around y axis
    0x09    signed char head_rotation_y2; // a greater rotation value around y axis
    0x0A    signed char head_rotation_z1; // a rotation value around z axis
    0x0B    signed char head_rotation_z2; // a greater rotation value around z axis
}

.SEQ files then choose the order of these keyframes to create different animations for
each of the characters, I'm working on figuring them out

doug
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #69 on: November 19, 2017, 09:19:18 PM »

very good!

Smiley
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #70 on: November 30, 2017, 02:54:03 AM »

I've worked out SEQ files  Smiley, here's a quick look at
what they do:

0.seq is used by all characters(in talkie scenes) and 126.seq,
and 0.key

126.seq is for mouth movement, these are the only three files needed for most cutscenes, could
be all. in-game characters use other files(like orcs on level 2)

SEQ files contain lists of keyframes,
a keyframe is a state a character(like Burnheartd) can be in.

The second byte in a SEQ file is the number of keyframes in the first
animation set, 0F in 0.SEQ
Code:
0F==15 frames,
each frame is 4 bytes so: 15*4 bytes in the first animation set:

40 0F 05 01 00 00 03 04 14 07 03 00 24 17 05 00 00 00 05 00 00 00 05 01 00 00 03 04 14 09 03 04 14 07 03 04 28 04 05 00 00 00 05 00 00 00 05 01 00 00 03 04 0F 00 02 00 00 00 08 00 00 00 0F 0A 02 00 00

Each animation set is defined by a number(length in frames) such as
0F or 0B, and there are something like
28 sets in 0.SEQ, this number occurs after each previous set

types are:
"zero five" entries:
05 01 00 00 - eyes texture open(01 for open)
05 00 00 00 - eyes closed(00 for closed)

"zero three" entries:
these are for head and body rotation
03 04 14 07 - tell character to rotate to key 7 in 0.key
03 04 XX 02 - rotate to key 2 in 0.key
03 04 XX 07 - XX is an acceleration value, greater values cause rotation to be slower

the second byte is almost always 04, or 00, I haven't worked out what it does.
If the third byte XX is 0(0 acceleration), no rotation will occur for that key frame.

"zero A" entries:
0A 02 00 00 - causes mouth to start talking, audio+animation, using 126.SEQ

"zero 6" entries:
these are for mouth
*they only occur in 126.SEQ file like I said, that file is for mouth
06 11 00 00 - oow mouth
06 06 01 00 00 - mouth state
06 02 00 00 - mouth state
06 10 00 00 - mouth state

"zero 8" entries:
These are found at the end of each animation set:
08 00 00 00
they seem to cause that particular set to loop if that set was started.

"zero 2" entries:
02 00 00 00
These are also found at the end of an animation set like 08, I haven't worked out what they do.

That's most of the different keyframe types.

Each animation set is defined by a number of frames in
that set, e.g. 0F for the first, 07 for the second, 0B 3rd if you
look at "0.SEQ":
Code:
40 0F 05 01 00 00 03 04 14 07 03 04 14 04 05 00 00 00 05 00 00 00 05 01 00 00 03 04 14 09 03 04 14 07 03 04 28 04 05 00 00 00 05 00 00 00 05 01 00 00 03 04 0F 00 02 00 00 00 08 00 00 00 07 0A 02 00 00 03 04 0A 05 03 00 0F 04 03 04 0A 01 03 04 0A 02 02 00 00 00 08 00 00 00 0B 0A 02 00 00 03 04 14 03 03 04 0F 04 05 00 00 00 05 01 00 00 03 04 14 05 03 04 14 06 03 04 0A 01 03 04 0A 04 02 00 00 00 08 00 00 00

 Smiley
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #71 on: November 30, 2017, 02:03:19 PM »

Excellent!
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #72 on: December 20, 2017, 10:31:34 PM »

I'm doing an implementation of these heads in Unreal Engine, using 3ds max  Smiley
Logged
devast3d
Developer
*
Offline Offline

Posts: 31


View Profile
« Reply #73 on: December 24, 2017, 11:18:13 AM »

Wow, that's great news! Keep us updated  Cheesy
Logged
dougie
Night Goblin Archer
*
Offline Offline

Posts: 27


View Profile
« Reply #74 on: February 25, 2018, 09:20:44 PM »

I'm going to start looking into modifying texture memory for the mouth movements
Logged
Pages: 1 ... 3 4 [5] 6 7 8   Go Up
Print
Jump to: