ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Oct 21, 2017 6:45 am

All times are UTC




Post new topic  Reply to topic  [ 70 posts ]  Go to page 1 2 3 4 Next
Author Message
PostPosted: Tue Sep 27, 2016 7:51 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
Tools for Metal Gear Solid 5 animations. Support for all human animations from Ground Zeroes and Phantom Pain.

Cutscene support for all characters (including dogs, horses, etc). Instructions in the post below.

DDog MTARs support

Image

They have unique and interesting system. I was able to read all position/rotation data for all frames/bones and unpack rotations to proper quaternions. They were packed another weird way I've never seen before. Another strange thing, they actually baked IK data INTO the animation, that is very unusual, most games apply IK AFTER the animation.

Image

This is an example of (200 extracted animations in one non-stop video). As for strange effects in transitions between animations, ignore them, it happens because they're not supposed to work in one go.

https://youtu.be/oUofIF7u1bQ

Also here's an interesting video recorded during quat research. Changing one component sign made snake (and everyone else) walk in a strange way. I also have a video of finding Paz in this way, its pathetic.

https://youtu.be/7pOoO4rhimY

Research thread: https://facepunch.com/showthread.php?t=1534738


Attachments:
mgsv_anim_tools.rar [39.41 KiB]
Downloaded 172 times


Last edited by id-daemon on Fri Mar 31, 2017 7:32 pm, edited 10 times in total.
Top
   
PostPosted: Wed Sep 28, 2016 7:05 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
Human MTAR tools. Works on all human (Ground Zero & Phantom Pain) skeletal animations now, but soon I plan to make support for all kinds.

Usage: drop animation file on the tool. Or run with 1 command line parameter (animation filename).
Snake model from Ground Zeroes (sna2_main0_def.fmdl) must be in the same dir. The tool needs it for skeleton initial position and bone names. For Phantom Pain also use the same GZ model, because the skeleton is the same, and it has bone names.

For example, if you use it on TppGzPlayer_layers.mtar package, it will extract all 2405 animations in SMD format files. If you use it on one of snake's .GANI animations, it will unpack it.

After unpacking, load the model and apply it.
Then connect arms to palms and legs to feet with IK constraints.

Example: connect IK_LARM -----> SKL_013_LHAND, and use pole vector IK_POLEARM_L
You will also need to do something with twist bones, this is not done automatically yet.

TPP Cutscene tool.
You will need corresponding .sand and .fsm file for the cutscene, also .fmdl files. SAND (scene animation description) files are all over the FPK packages. FSM files are in "demo" folders.

Usage:
mgs5_pp_cutscene [sand] [n] [fmdl]

[sand] - required .sand file name. If you only use this parameter, will list character cast and not extract anything.
[n] - number or character to extract, according to the cast. In theory, you can extract any character, camera, thing, whatever.
[fmdl] - model file that the animation will be put on. In case of model swap, will produce model swapping results, but it will also work.

For your convenience, this is the description of all cutscene files I have: http://pastebin.com/i81gAGNp

DDog MTAR tools. Supports only Diamond Dogs! Normal dogs have a little different skeleton.

Usage is similar to human MTAR, but no IK actions needed. Model file for it is ddg0_main0_def.fmdl


Last edited by id-daemon on Tue Aug 29, 2017 5:06 pm, edited 11 times in total.

Top
   
PostPosted: Sun Oct 02, 2016 8:30 am 

Joined: Sun Oct 02, 2016 8:23 am
Posts: 2
@id-daemon
Hi, i want to try your tool, but i cant get rigged GZSnake model. For some unknown reason Cra0 tool never worked for me, well his FMDL to .smd exporter to be presice (.OBJ export works fine). Is there any chance that you can upload GZ Snake in .smd?


Top
   
PostPosted: Sun Oct 02, 2016 2:22 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
Sure. Also models exported with Cra0 tool were incorrectly weighted, it lead to holes in a model during animations and some distorted parts. I dont recommend using it anymore.

Here's a model in SMD:
http://www38.zippyshare.com/v/Ia9rlzgQ/file.html

This model is made with the new exporter, it will be 106 times bigger than the animation.


Top
   
PostPosted: Sun Oct 02, 2016 5:24 pm 

Joined: Sun Oct 02, 2016 8:23 am
Posts: 2
Well that was quick, thanks a ton! I gave up on Cra0 tool long ago, so i use ninja ripper and some unfinished maxscript that was on facepunch to get models.
You said this model is from the new exporter... you dont mean there is another exporter besides Cra0's model studio? Anyway i will test your tool tommorow and hope everything will be working for me, thanks again.


Top
   
PostPosted: Wed Oct 05, 2016 6:49 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
Kabuki wrote:
you dont mean there is another exporter besides Cra0's model studio?


Yes, its in develop state. Its not published yet.


Top
   
PostPosted: Mon Oct 24, 2016 4:16 am 

Joined: Mon Dec 29, 2014 8:49 pm
Posts: 29
How did you manage to decompress the actual mtar file?
What kind of compression does it use?


Top
   
PostPosted: Mon Oct 24, 2016 5:43 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
MTAR file itself is not compressed. Its just all animations put together in one big file. With a list in the beginning.


Top
   
PostPosted: Thu Oct 27, 2016 6:16 am 

Joined: Thu Oct 27, 2016 6:09 am
Posts: 3
When I first searched this on google, I never thought I'd find this thread. As a less than amateur animator, I'm really interested to see how the game was animated.
I wanted to take a look at the animations, but I wasn't able to locate where the .mtar files are. The most I've been able to find are lua files with a few fpk and fpkd in data_02. I tried using the fpk unpack tool on the TppSoldierGzMotion.fpk and fpkd but the fpk tool doesn't seem to extract anything out of them. Could you give some pointers as to where I could find them?


Top
   
PostPosted: Thu Oct 27, 2016 3:30 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
fpk unpack tool must unpack TppSoldierGzMotion.fpk and this will give you MTAR file.


Top
   
PostPosted: Thu Oct 27, 2016 7:19 pm 

Joined: Thu Oct 27, 2016 6:09 am
Posts: 3
id-daemon wrote:
fpk unpack tool must unpack TppSoldierGzMotion.fpk and this will give you MTAR file.


I apologize, but it doesn't seem to be working. CMD quickly opens and closes, with no text being written and no folder being output. Is it possible that there's different versions of the FPK tool?


Top
   
PostPosted: Thu Oct 27, 2016 7:38 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
Maybe your fpk file is encrypted? I have no idea. I can only say it works for me.


Top
   
PostPosted: Thu Oct 27, 2016 8:00 pm 

Joined: Thu Oct 27, 2016 6:09 am
Posts: 3
id-daemon wrote:
Maybe your fpk file is encrypted? I have no idea. I can only say it works for me.


Mind if I send the fpk file over to you? I'm at my end at this point.
Otherwise, I'll probably re-run the data files through QAR and try again.

Oddly enough, that seemed to have worked. Thanks for the assistance!


Top
   
PostPosted: Thu Nov 03, 2016 6:39 am 

Joined: Mon Dec 29, 2014 8:49 pm
Posts: 29
id-daemon wrote:
MTAR file itself is not compressed. Its just all animations put together in one big file. With a list in the beginning.


The structure makes no sense to me to be honest

Code:
//--------------------------------------
//--- 010 Editor v5.0 Binary Template
//
// File:
// Author:
// Revision:
// Purpose:
//--------------------------------------

typedef struct
{
    uint sig; //9c a8 ff 0b
    uint fileCount; //296 size?
    short us0;  //bones
    short us1; //fps?
    uint padd[5];
}MTAR_HDR;

typedef struct
{
    //a/b = id or name
    int a;
    int b;
    int addr; //important
    int size;

    //seek c+224?
    //local byte data[]
}MTAR_ENTRY;

struct Mtar
{
    MTAR_HDR header;
    MTAR_ENTRY entry[header.fileCount];
    //Printf("%d ",FTell());
    //byte unkn[80];
}mtar;




When we go to the offset in an entry objectand take the size we are left with an even more confusing structure to deal with;

Code:

typedef struct //skip to 224?
{
    uint sig0;
    uint _20;
    uint fileSize; //changes
    int64 zero;
    uint _1;
    byte pad0[8];
   
    uint sig1;
    uint ui1;
    byte pad1[16];
    uint ui2;
    byte pad2[20];

    char motionStr[16];
    int64 sig2;
    int one;
    int _30;
    int unkn__[64];
}MotionHeader;


struct MotionFile//first 32 are fixed
{
    MotionHeader hdr;
    //skip 20 int fps?
}file;


Top
   
PostPosted: Thu Nov 03, 2016 10:10 pm 

Joined: Mon Dec 29, 2014 8:49 pm
Posts: 29
The file format is really all over the place and I cannot believe a company of Konami's experience would make a structureless file format


Top
   
PostPosted: Fri Nov 04, 2016 8:13 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
I don't understand what are you trying to say. The structures you posted are almost correct. This is an animation format, it has complex data to store, and it stores it all as needed. What is wrong about it? Did you ever reversed animations before? They all usually have structures like this.


Top
   
PostPosted: Fri Nov 04, 2016 6:38 pm 

Joined: Mon Dec 29, 2014 8:49 pm
Posts: 29
id-daemon wrote:
I don't understand what are you trying to say. The structures you posted are almost correct. This is an animation format, it has complex data to store, and it stores it all as needed. What is wrong about it? Did you ever reversed animations before? They all usually have structures like this.



Maybe I was just cranky
I have reversed a lot of animations but I have always understood the format 100%
Which means I never do pre-calculated jumps
This is the first time I have doing random jumps/Fseeks and it makes me unsure :)
Could you kindly tell me the areas I might have gotten wrong?


Top
   
PostPosted: Sat Nov 05, 2016 6:48 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
I'm not using 010 editor because I think it can't handle complex formats like this one. Also I don't quite understand what do you mean under "random jumps/Fseeks", but this parts had wrong comments:

Code:
    short us0;  //bonegroups
    short us1; //bones


and this part does not correspond to what i see in the file:

Code:
    char motionStr[16];
    int64 sig2;
    int one;
    int _30;
    int unkn__[64];


So you probably got this template based on the file that corresponds to it, but its not correct and the contents will depend on what you have in "motionStr[16]". For example, cutscene animations have audio segments embedded, which have "SND" string here.


Top
   
PostPosted: Sun Nov 06, 2016 7:04 am 

Joined: Mon Dec 29, 2014 8:49 pm
Posts: 29
id-daemon wrote:
I'm not using 010 editor because I think it can't handle complex formats like this one. Also I don't quite understand what do you mean under "random jumps/Fseeks", but this parts had wrong comments:

Code:
    short us0;  //bonegroups
    short us1; //bones


and this part does not correspond to what i see in the file:

Code:
    char motionStr[16];
    int64 sig2;
    int one;
    int _30;
    int unkn__[64];


So you probably got this template based on the file that corresponds to it, but its not correct and the contents will depend on what you have in "motionStr[16]". For example, cutscene animations have audio segments embedded, which have "SND" string here.


In my version it actually says "motion" and padded with "00"s
also it seems the floats are xor'd or encrypted

There is not a single occurrence of the float 1 in the whole thing. That is a flag


Top
   
PostPosted: Sun Nov 06, 2016 7:14 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 648
JohnHudeski wrote:
also it seems the floats are xor'd or encrypted

There is not a single occurrence of the float 1 in the whole thing. That is a flag


Ah, thats what are you talking about! No, nothing is encrypted here.

It seems you only reversed simple animations before. Because no serious animation engine will use plain floats. They use 8/16 or variable-bit integers. Like for one bone it can be 14-bit x,y,z , for next bone it will be 17-bit x,y,z and so on.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 70 posts ]  Go to page 1 2 3 4 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited