Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Metal Gear Solid 5 (MGSV) animations

Featured Replies

  • Replies 83
  • Views 34
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

id-daemon, posted Tue Sep 27, 2016 7:51 pm (17691)


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

mgsv_anim_tools.rar

  • Author
  • Localization

id-daemon, posted Wed Sep 28, 2016 7:05 pm (17701)


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
  • Author
  • Localization

Kabuki, posted Sun Oct 02, 2016 8:30 am (17786)


@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?
  • Author
  • Localization

id-daemon, posted Sun Oct 02, 2016 2:22 pm (17795)


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.
  • Author
  • Localization

Kabuki, posted Sun Oct 02, 2016 5:24 pm (17799)


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.
  • Author
  • Localization

id-daemon, posted Wed Oct 05, 2016 6:49 pm (17857)


Kabuki wrote:
you dont mean there is another exporter besides Cra0's model studio?


Yes, its in develop state. Its not published yet.
  • Author
  • Localization

JohnHudeski, posted Mon Oct 24, 2016 4:16 am (18298)


How did you manage to decompress the actual mtar file?
What kind of compression does it use?
  • Author
  • Localization

id-daemon, posted Mon Oct 24, 2016 5:43 pm (18314)


MTAR file itself is not compressed. Its just all animations put together in one big file. With a list in the beginning.
  • Author
  • Localization

Large_Leader, posted Thu Oct 27, 2016 6:16 am (18394)


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?
  • Author
  • Localization

id-daemon, posted Thu Oct 27, 2016 3:30 pm (18405)


fpk unpack tool must unpack TppSoldierGzMotion.fpk and this will give you MTAR file.
  • Author
  • Localization

Large_Leader, posted Thu Oct 27, 2016 7:19 pm (18407)


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?
  • Author
  • Localization

id-daemon, posted Thu Oct 27, 2016 7:38 pm (18409)


Maybe your fpk file is encrypted? I have no idea. I can only say it works for me.
  • Author
  • Localization

Large_Leader, posted Thu Oct 27, 2016 8:00 pm (18410)


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!
  • Author
  • Localization

JohnHudeski, posted Thu Nov 03, 2016 6:39 am (18522)


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;
  • Author
  • Localization

JohnHudeski, posted Thu Nov 03, 2016 10:10 pm (18540)


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
  • Author
  • Localization

id-daemon, posted Fri Nov 04, 2016 8:13 am (18550)


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.
  • Author
  • Localization

JohnHudeski, posted Fri Nov 04, 2016 6:38 pm (18561)


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?
  • Author
  • Localization

id-daemon, posted Sat Nov 05, 2016 6:48 am (18566)


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.
  • Author
  • Localization

JohnHudeski, posted Sun Nov 06, 2016 7:04 am (18599)


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
  • Author
  • Localization

id-daemon, posted Sun Nov 06, 2016 7:14 am (18600)


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.
  • Author
  • Localization

lovo, posted Sun Nov 13, 2016 1:23 am (18783)


id-daemon, any news your research?
  • Author
  • Localization

id-daemon, posted Sun Nov 13, 2016 6:22 am (18786)


The research was suspended about a month ago. I'm working on other projects.

I have no reports if anyone ever tried the published tool.
  • Author
  • Localization

JohnHudeski, posted Tue Nov 15, 2016 12:38 pm (18837)


id-daemon wrote:
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.



I did do one with half floats but 14-bit is new to me 17-bit is even stranger
What type of bits does MGSV use?
I think I can re-purpose my half-float reader for this.
  • Author
  • Localization

id-daemon, posted Tue Nov 15, 2016 7:12 pm (18841)


JohnHudeski wrote:
What type of bits does MGSV use?
I think I can re-purpose my half-float reader for this.


As I said, they use VARIABLE bits. I mean it. For one bone it can be 14-bit, for next bone it will be 17-bit. Number of bits used for each bone track is recorded in bone description structure inside of each anim.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.