Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archive

The Original Forum. Game archives, full of resources. How to open them? Get help here.
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 »

GHzGangster wrote:
unknown123 wrote:...
PS3 stuff
So that's where MGO stats came from! I remember googling for it, but when I stumbled upon that site (mgostat.com, was it?) it was already down, so I had no way to contact creators.

Thank you for providing ticket, BobDoleOwndU was trying to do the same to get me a ticket, but he moved onto other projects.
I am having some troubles though, sent you PM with details. Nevermind - game uses only login_id to log on ps3.

PS: if you are still interested in modding the game, you probably should join mgsv modding discord.
GHzGangster
n00b
Posts: 19
Joined: Fri Aug 15, 2014 6:00 am
Has thanked: 3 times
Been thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by GHzGangster »

unknown123 wrote:So that's where MGO stats came from! I remember googling for it, but when I stumbled upon that site (mgostat.com, was it?) it was already down, so I had no way to contact creators.

Thank you for providing ticket, BobDoleOwndU was trying to do the same to get me a ticket, but he moved onto other projects.
I am having some troubles though, sent you PM with details. Nevermind - game uses only login_id to log on ps3.

PS: if you are still interested in modding the game, you probably should join mgsv modding discord.
Ah, if you did manage to log in, that's good.

Site was mgo.io, but there wasn't really much activity there.

Not really interesting in modding the game honestly. I was really only interesting in some MGO stuff, but I don't even play that anymore. Haven't touched TPP in a long time either. I'd be happy to help you with the server stuff, though I really didn't do a whole lot for the TPP server.

Also, I'm really busy with MGO2 stuff as well.
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 »

GHzGangster wrote: I'd be happy to help you with the server stuff, though I really didn't do a whole lot for the TPP server.
Best thing you can do is to opensource your scripts which pull data for mgo (without any private data ofc). This will give people a way to resurrect your site (which is always nice).
TPP has a lot of data and I don't have time to work on both TPP and MGO; you will save me some time by opensourcing your scripts.

And btw, how did you dump keys from ps3? MITM attack with ssl cert replacement, like I did?
GHzGangster
n00b
Posts: 19
Joined: Fri Aug 15, 2014 6:00 am
Has thanked: 3 times
Been thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by GHzGangster »

unknown123 wrote:Best thing you can do is to opensource your scripts which pull data for mgo (without any private data ofc). This will give people a way to resurrect your site (which is always nice).
TPP has a lot of data and I don't have time to work on both TPP and MGO; you will save me some time by opensourcing your scripts.

And btw, how did you dump keys from ps3? MITM attack with ssl cert replacement, like I did?
I didn't dump keys actually. I changed the SSL verification callback in the game to accept any certificate. Then I just talked to my server, and my server proxied requests to the main server.

I will probably open-source that stuff now, yeah. It's a bit messy, but someone else can figure that out. Just need to figure out what is really needed though.
youarebritish
n00b
Posts: 13
Joined: Thu Oct 29, 2015 9:23 pm
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by youarebritish »

So I got my hands on the terrain shader, and after studying it, I've figured out exactly what parameters it takes. This should making deciphering the htres a lot easier.

The texture maps it consumes:
WorldTexture
SrmTexture
NormalTexture
AlbedoTexture
MaterialIndicesTexture
MaterialSelectMapTexture
TileMapTexture

HeightMapTexture

The bolded ones are the new discoveries. The first few are all normal ftx texture that are assigned in the terrain's fox2. The heightmap we already knew was encoded in the htre, but I don't know anything about where the bolded ones are. My guess is that they're somewhere in the htre. The MaterialIndicesTexture is probably what the htre calls materialIDs. I'm guessing it specifies what terrain materials go where.

The heightmap is read as a float in the shader, so that confirms that the height is encoded in a 32-bit format. Interestingly, MaterialIndices, MaterialSelectMap, MaterialWeightMap, and TileMap are each read in as half4's, so they're probably encoded in a 16-bit format. For MaterialIndicesMap and the heightmap, only the r channel of the texture is read, so each value is probably only stored as one channel (makes sense for the heightmap, no idea what that says about the material IDs, though). Interestingly, though, the others seem to use four channels, so I'd expect to see them encoded as a 16-bit RGBA. That should help a lot in tracking the data down.

Here's a snippet from the shader that shows how the maps are used:

Code: Select all

float4 		materialAndWeight = (float4( materialLists * 1.0h/256.0h ) + float4( floor( materialWeights * 256.0h ) ));

	
	materialAndWeight.xy = materialAndWeight.x > materialAndWeight.y ? materialAndWeight.xy : materialAndWeight.yx ;
	materialAndWeight.zw = materialAndWeight.z > materialAndWeight.w ? materialAndWeight.zw : materialAndWeight.wz ;
	
	materialAndWeight.xz = materialAndWeight.x > materialAndWeight.z ? materialAndWeight.xz : materialAndWeight.zx ;
	materialAndWeight.yw = materialAndWeight.y > materialAndWeight.w ? materialAndWeight.yw : materialAndWeight.wy ;
	
	materialAndWeight.yz = materialAndWeight.y > materialAndWeight.z ? materialAndWeight.yz : materialAndWeight.zy ;

	outMaterialIndex = (half4)frac( materialAndWeight ) * 256.0h ;
	outMaterialWeight = (half4)floor( materialAndWeight ) / 256.0h ;

	half2	materialSelectTableUvParam = half2( 1.0h/16.0h, 0.5h/16.0h );
	half2	materialSelectTableUv = half2( outMaterialIndex.x * materialSelectTableUvParam.x + materialSelectTableUvParam.y, 0 );
	outTopMaterialIndex = (half)TFetch2DH( inMaterialIndicesTexture, SamplerPoint, materialSelectTableUv ).x ;
youarebritish
n00b
Posts: 13
Joined: Thu Oct 29, 2015 9:23 pm
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by youarebritish »

I think I've mostly decoded the lba format. My thinking was that it was probably just a binary form of the TransformEntitys from the fox2's. I used TppLandingZone.lua to find the name of a random locator and get some coordinates to compare against (check OverwriteBuddyVehiclePosForALZ() in that file). sovietBase_aacr001 has the locator name of afgh_antn006_gim_n0000|srt_afgh_antn006, also defined in afgh_sovietBase_asset.fox2. I found that, after the header, the first four values were -2147.00024, 441.305634, -1511.29321, 3.113926e-39, which was very close to -2006.886,425.727,-1127.261, the vehicle drop point for that LZ as defined in TppLandingZone.lua.

Here's an 010 Editor header to parse the lba files. I ran it on a few files and it looked good, but it's my first attempt at making one:

Code: Select all

//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
//      File: *.lba
//   Authors: youarebritish
//   Version: 1.0
//------------------------------------------------
LittleEndian();

struct Lba {
    struct Header {
	    int numLocators;
        int unknown1;
        int unknown2;
        int unknown3;
    } header;
    
    struct Locator
    {
        struct Vector3
        {
            float x;
            float y;
            float z;
            float w;
        } transform_translation;
        struct Quat
        {
            float x;
            float y;
            float z;
            float w;
        } transform_rotation_quat;
        uint locatorName;
        uint unknown4;
    } locator[file.header.numLocators];
} file;
redspike474
n00b
Posts: 12
Joined: Thu Feb 04, 2016 7:24 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by redspike474 »

How did you get the terrain shader? are the other shaders accessible too? I would like to write a max/maya shader that emulates tpp rendering.
BobDoleOwndU
advanced
Posts: 68
Joined: Thu Dec 24, 2015 7:45 am
Has thanked: 10 times
Been thanked: 10 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by BobDoleOwndU »

redspike474 wrote:How did you get the terrain shader? are the other shaders accessible too? I would like to write a max/maya shader that emulates tpp rendering.
You need to xor the .fsop files located in data1\shaders\dx11 by 0x9C. This will give you the source code.
redspike474
n00b
Posts: 12
Joined: Thu Feb 04, 2016 7:24 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by redspike474 »

Could you post them or PM me them ? Im pretty sure when I last looked into it there wasnt full shader source... just bits.
youarebritish
n00b
Posts: 13
Joined: Thu Oct 29, 2015 9:23 pm
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by youarebritish »

Managed to extract (what I think is) a splatmap from an htre. The big block of data after the heightmap is an RGBA texture encoded as ubytes. I'm not sure which terrain input texture this corresponds to, although my guess would be that it's the MaterialWeightMapTexture, as the sum of all values in a given pixel is 255. It has the same weird interleaving appearance as the heightmap. No idea what's causing that.

We still haven't located the following terrain tile textures:
-MaterialIndicesTexture (only R channel is used, so probably a greyscale texture).
-TileMapTexture (RGB)
-MaterialSelectMapTexture (probably RGBA)
You do not have the required permissions to view the files attached to this post.
youarebritish
n00b
Posts: 13
Joined: Thu Oct 29, 2015 9:23 pm
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by youarebritish »

I've got a revised version of the .lba template. This one works on three of the four .lba formats I've found so far. The fourth format is completely different from the others and I haven't been able to make sense of it yet. Luckily, I've only found two examples of this fourth type so far (one being mafr_drum001.lba).

Code: Select all

//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
//      File: *.lba
//   Authors: youarebritish
//   Version: 2.0
//------------------------------------------------
LittleEndian();

//------------------------------------------------
// Struct definitions
//------------------------------------------------
enum <uint> Format { TYPE_0 = 0, TYPE_2 = 2, TYPE_3 = 3, TYPE_UNKNOWN };

struct Vector4
{
    float x;
    float y;
    float z;
    float w;
};
//------------------------------------------------
// File format
//------------------------------------------------
struct LbaFile
{
    struct Header
    {
        uint numLocators;
        Format format;
        double empty <hidden=true>;
    } header;

    if (header.format == TYPE_0)
    {
        struct LocatorType0
        {
            Vector4 translation;
            Vector4 rotation;
        } locators[header.numLocators];
    }

    else if (header.format == TYPE_2)
    {
        struct LocatorType2
        {
            Vector4 translation;
            Vector4 rotation;
        } locators[header.numLocators];
        struct LocatorType2Metadata
        {
            uint locatorName;
            uint dataSet;
        } metadata[header.numLocators];
    }

    else if (header.format == TYPE_3)
    {
        struct LocatorType3
        {
            Vector4 translation;
            Vector4 rotation;
            uint unknown30;
            uint unknown31;
            uint unknown32;
            uint unknown33;
        } locators[header.numLocators];
        struct LocatorType3Metadata
        {
            uint unknown34;
            uint unknown35;
        } metadata[header.numLocators];
    }
} file;
youarebritish
n00b
Posts: 13
Joined: Thu Oct 29, 2015 9:23 pm
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by youarebritish »

I've started on deciphering the .frt route files. I've identified most of the data, but the relationships between them still aren't clear. For instance, I don't know how nodes and edges are mapped to events, or how exactly the route is traversed.

An frt file contains a list of hashed route IDs, a list of vector3 node locations, a list of what I think are edges in the node graph, and a list of route events, which have an event type and parameters.

Here's my current template:

Code: Select all

//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
//      File: frt.bt
//   Authors: youarebritish
//   Version: 0.1
//------------------------------------------------
LittleEndian();
struct Header
{
    char ROUT[4] <hidden = true>;
    short unknown1 <hidden = true>;
    short routeIdCount;
    int unknown2 <hidden = true>;
    int unknown3;
} header;

int routeNodesAddress <hidden = true>;
int routeEdgesAddress <hidden = true>;
int rouseNodeEventsAddress <hidden = true>;

uint routeIds[header.routeIdCount];

struct UnknownStruct
{
    int unknown4a;
    int unknown4b;
    int unknown4c;
    int unknown4d;
} unknown4[header.routeIdCount];

struct RouteNode
{
    float x;
    float y;
    float z;
} routeNodes[(routeEdgesAddress - routeNodesAddress)/sizeof(RouteNode)];

struct RouteEdge
{
    ushort from;
    ushort to;
} routeEdges[(rouseNodeEventsAddress - routeEdgesAddress)/sizeof(RouteEdge)];

struct RouteNodeEvent
{
    uint type;
	uint params[11];
} routeNodeEvents[(FileSize() - rouseNodeEventsAddress)/sizeof(RouteNodeEvent)];
CreaseInTime
n00b
Posts: 10
Joined: Tue Dec 13, 2016 4:59 am
Has thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CreaseInTime »

Hey there, looking to see if anyone can help me out with this FTEX file. It's quite a few KBs large, but when I convert it with FtexTool it ends up 1KB and completely black. Does anyone know why this might happen?

Image
Image
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tosyk »

Can you upload sample?
Thank you for all you do here
my blog | my forum
CreaseInTime
n00b
Posts: 10
Joined: Tue Dec 13, 2016 4:59 am
Has thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CreaseInTime »

Yes, here's a link to all the .FTEXS and .FTEX files for the texture.
Post Reply