View on GitHub

Metal Gear Solid V: The Phantom Pain technical information

Cosmetics

Introduction

Throughout history, men have worn hats as a way of showing how much better they are than other men. “I buy hats,” a behatted man seems to say. “I am better than you.”

In wartime, hats were a useful way of conferring rank, and ensuring that casualties were confined to the lower classes (hence the famous command of “Don't fire till you see the tops of their heads” at the Battle of Bunker Hill by William Prescott, a general renowned for only shooting enemy combatants who were poor). During peacetime, hats have been instrumental for men to let the non-hatted know just who is wearing the hat around here.

People need cosmetics and need them badly. MGSV is not an exception.


A lot of cosmetics were introduced to Metal Gear with MGO3 - wide variety of headgear along with swimsuits and other tactical stuff. Unfortunately KONAMI forgot to add them to singleplayer. It took them about a year to start porting MGO cosmetics back to TPP as FOB event rewards. Judging by amount of cosmetics, it will take them years to port everything (if they are going to port all of it). But models are already in the game - what stops us from modding it from MGO to TPP?


Porting cosmetics

The easiest way would be direct model porting. It is achieved by editing already existing models, usually in hex editor or some 3d software. All model mods on nexusmods are made using those methods. It works, MGO cosmetics are in TPP, but there are issues.

The best example is Multi Quiet Player Mod. Full version takes 1.4 GBs, and even with that you are tied to quiet's face.

Conclusion: replacing/editing models sucks. It works, but why would we replace models like that, when the game can do the same programmatically?

Coder's way

Game is capable of manipulating models/cosmetics in the real time, but how does it do that? I've found 5 ways:

User variables

By changing vars.playerFaceId and vars.playerType(was it playertype?) you can change your face at will (assuming you play as DD soldier). You can see full list of faces in prettified file Soldier2FaceAndBodyData.lua in Infinite Heaven mod. Via changing variables you select one of the predefined face variations - that includes hair, hair colour, skin colour, face paintings, eye color, gender, etc - studying the file will give you a lot of information about that. You can do it using IH - see https://youtu.be/a0PJJVkDQe8.

What prevents us from using that method? The problem is - faces are pre-baked. Let's take a look at bioengineer from mission 5 "Over the Fence". His glasses are a part of his face and are unseparatable.

More than that, we don't have full control on what will be replaced - we are still bound by pre-baked models. That means that for every head/body cosmetic we will have to make a separate model which will consist of regular model + mgo cosmetic. Not good since we need more freedom - like in mgo where you just put hats on yourself without any modifications to your face/outfit.

Conclusion: it sucks, not enough freedom, still need to edit models.

New weapon entries

By putting on your Night Vision Goggles you change your appearance by the press of the button. Sounds perfect - 8 slots of 'items' gives you some variety. But of course it only sounds nice.
Issues:

Conclusion: it sucks, can't see hats.

Chicken hats

After failing a couple of times game suggests to equip a chicken/chick hat which is attached to the head and looks like a hat - just like we need. No, it doesn't work well enough.
Issues:

Also there is no code that can modify behaviour above, just 2 variables that turn chick/chicken mode on and off.

Conclusion: it sucks, not enough freedom, chicken mode on, you are clucking.

FV2 files

Models in the game are hidden in fmdl files. Important thing is, you can have multiplie models in one fmdl file.

It was discovered by cra0kalo and volfin - https://forum.xentax.com/viewtopic.php?p=102492#p102492.


Everything below is my theory on how fv2 files work.


FOVA stands for FOrmVAriations.

There are two instances of game directly using fv2 files to change object's appearance.

First instance can be seen on youtube, search for it yourself; I never bothered with it since it works with GameObjects and there are some differences between GameObject and Player objects. Second one is much more interesting.

By providing right fv2 file snake drastically changes appearance - his bandage is removed, he gets burns and cuts body-wide (mesh and texture manipulations). All of this without any loadings, instanst. Sounds perfect for our cause.

Issues: