Page 108 of 109

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

Posted: Wed Aug 02, 2017 7:45 am
by atvaark
FtexTool doesn't support that file. It's using a format only <1% of all texures have (non chunked, non compressed, no metadata in the ftexs files)

Here's the fixed dds:
https://my.mixtape.moe/iecrlo.zip

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

Posted: Thu Aug 03, 2017 1:35 am
by CreaseInTime
You're a lifesaver, atvaark. Thanks!

Quick edit, is there any possibility you could get the other textures associated with it, linked here? They give the same error.

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

Posted: Thu Aug 03, 2017 9:12 pm
by atvaark
CreaseInTime wrote:You're a lifesaver, atvaark. Thanks!

Quick edit, is there any possibility you could get the other textures associated with it, linked here? They give the same error.
They can also be unpacked by my patched tool.
https://my.mixtape.moe/ntfndx.zip

I won't be releasing the patch because I can't test if it breaks converting other textures and this bug only appears with <1% of all textures I guess.

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

Posted: Sat Aug 12, 2017 10:50 pm
by unknown123
I would like to leave a note here about lua and C functions.

You can inspect any C function like this:

Code: Select all

local a = debug.getinfo(Fox.GetDebugLevel)
for key,value in pairs(a) do --pseudocode
    print(key..value)
end
It will print out info like this:

Code: Select all

nups : 0
what : C
func : function: 0x1b15100
lastlinedefined : -1
source : =[C]
currentline : -1
namewhat :
linedefined : -1
short_src : [C]
However that function address is NOT the actual address of C function. I built an executable with embedded lua, where C function write is called via lua. Here are the addresses of functions in C and in Lua:

Code: Select all

func : function: 0x1b15100
write: 0x401716
l_write: 0x401742
write is the function itlself, l_write is a wrapper for lua. Both addresses are static and never change, while address from lua always changes. Most likely this is an address in Lua machine.
Code attached to the post, was built on linux machine. You will need liblua5.1, lua5.1-dev and g++.

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

Posted: Sun Aug 27, 2017 3:13 pm
by unknown123
I have tried to load a DLL and failed.

Steps I took:

First, disable DEP to be able to load our dll. If you cannot disable DEP, you will run into errors like I did (and still do).
You will need to disable software and hardware DEP. Software DEP is disabled like this:

Code: Select all

bcdedit.exe /set {current} nx AlwaysOff
Hardware DEP is disabled by turning it off in BIOS, look for 'execution bit' or something like that. Some BIOSes (like mine) don't have that option, so you are probably out of luck - DEP will prevent dll from loading, mgsvtpp.exe will crash with BEX64/StackHash error. Reboot after turning them off.

Second, you need to get a 64 bit compilator - game uses 64-bit version of lua and doesn't like 32 bit dlls (this is just a guess, not 100% confirmed). I used gcc from http://winbuilds.org/. Download the installer, install everything, veryfy that it is working by typing 'gcc' in console. If it is not working - check your PATH or invoke it directly from the installation directory.

Third, write your dll. This is the hardest part, so I chose to get the source from the internet.
test.tar
Fourth, compile it.

Code: Select all

gcc -O2 -c -o test.o test.cpp
gcc -O -static -o test.dll test.o 
Note: we are compiling it as a static library.
You can also try to build a shared library. To do so, get Lua 5.1.5 windows x64 build - https://sourceforge.net/projects/luabin ... p/download . Put lua5.1.dll along with test.cpp, compile:

Code: Select all

gcc -O2 -c -o test.o test.c
gcc -O -shared -o test.dll test.o -L . -llua5.1
Now we have a compiled DLL and ready to load it in the game. Put it along with mgsvtpp.exe to avoid path issues. If you have built shared library, copy lua5.1.dll there as well. You can put require code into init.lua or load it on button press - whatever you like.

Code: Select all

require('test')
test.add1(2)
or

Code: Select all

var add1 = package.loadlib('test','add1')
add1(2)
And here are the problems:

If you have shared library, game loads your dll AND lua5.1.dll, which results in soft hang - game is running, but the screen is frozen, inputs are not working. I see 2 possible problems with is:
  • Internal lua engine conflicts with lua5.1.dll;
  • dll is missing something.
No idea how to solve any of them.

If you have a static library, game tries to load your dll, but DEP is preventing it to load, crashing with BEX64/StackHash errors. I was unable to disable hardware part of DEP - my BIOS is missing settings. I have also tried disabling antivirus, turning on compability settings, running as admin - same error. This bug needs to be reproduced on another machine, maybe the problem is in my pc. There is also a possibility that I don't fully understand the mechanism of loading shared/static libraries and static lib is worthless.

I have also tried to load the dll using Fox module methods by calling them one by one with 'test' as parameter. Unfortunately it didn't work and I haven't seen any low-level C modules in the game that had functions with ability to load stuff (aside from Script.LoadLibrary, which loads luas only).

Edit: I have also tried to build a proxy dll as described here: http://lua-users.org/wiki/LuaProxyDll. All 4 methods failed (or maybe it's just me). Hope that will help anyone trying to do the same.

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

Posted: Mon Sep 11, 2017 11:03 pm
by NeverAgain
I have a question. Is it possible to locate the E3 2013 foliage textures and models stored on Phantom pain?

Image

I am curios if they could be used to replace the existing foliage and trees use in Afghanistan's map. if they don't exist within Phantom Pain then maybe they could be re-created? it might be worth a shot.

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

Posted: Thu Sep 14, 2017 1:12 pm
by FirasZinou
atvaark wrote:
CreaseInTime wrote:You're a lifesaver, atvaark. Thanks!

Quick edit, is there any possibility you could get the other textures associated with it, linked here? They give the same error.
They can also be unpacked by my patched tool.
https://my.mixtape.moe/ntfndx.zip

I won't be releasing the patch because I can't test if it breaks converting other textures and this bug only appears with <1% of all textures I guess.
Hi mate i'm from PES editing community and i'm asking you for help about ftex files similair to what you patched .
when convert .ftex to .dds with your tool it comes with black dds so i think your patched tool is the solution for this problem ..

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

Posted: Thu Sep 14, 2017 5:07 pm
by unknown123
FirasZinou wrote: Hi mate i'm from PES editing community and i'm asking you for help about ftex files similair to what you patched .
when convert .ftex to .dds with your tool it comes with black dds so i think your patched tool is the solution for this problem ..
I think you should make an issue here - https://github.com/Atvaark/FtexTool/issues

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

Posted: Mon Oct 02, 2017 7:50 pm
by Thomas Anderson
Hi, im new to this forum but i was send here by Atvaark.

I was in the idea of making an asthetic mod for the mgo part of the game more precise for the weapons, since we all know is not very active with zero support from the developers and probably gonna get shut down next year with the coming of MG Survive, so i said "why the hell not?". The question is: if anyone has any idea where the colour for the weapons of mgo are located? i which lua file? or where? any help would be welcome.

I did find the colours for the gear that was very easy Assets>Mgo>Config>Gear, and there i could find the hashes that the game uses for the colours, for example com_c72 is golden and com_c18 is silver, i could even put camo pattern on gear that didn't had such colour available, so im guessing it can be done for the weapons i just gotta find where they are located.

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

Posted: Tue Oct 03, 2017 10:42 am
by unknown123
Thomas Anderson wrote:Hi, im new to this forum but i was send here by Atvaark.

I was in the idea of making an asthetic mod for the mgo part of the game more precise for the weapons, since we all know is not very active with zero support from the developers and probably gonna get shut down next year with the coming of MG Survive, so i said "why the hell not?". The question is: if anyone has any idea where the colour for the weapons of mgo are located? i which lua file? or where? any help would be welcome.

I did find the colours for the gear that was very easy Assets>Mgo>Config>Gear, and there i could find the hashes that the game uses for the colours, for example com_c72 is golden and com_c18 is silver, i could even put camo pattern on gear that didn't had such colour available, so im guessing it can be done for the weapons i just gotta find where they are located.
Try updated dictionaty - https://github.com/TinManTex/mgsv-looku ... t?raw=true or https://github.com/TinManTex/mgsv-looku ... t?raw=true

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

Posted: Thu Nov 09, 2017 10:02 am
by BobDoleOwndU
Forgot to post this here.

Fmdl Studio v2

Unity based fmdl importer and FBX exporter (and planned to be fmdl exporter).

Can currently:
-Read fmdl data and build the model in Unity.
-Apply diffuse textures to the model if the textures are in a folder with the model's name located in the Fmdl Studio v2 folder.
-Export rigged and (diffuse) textured models from Unity to the FBX format. (The FBX by default will look for textures in a folder with the fmdl's name at the same location the fbx is located.)

To do list:
-Implement a better system for handling textures. Edit: Done!
-Apply textures other than diffuse to the model. Edit: Partially done. Normal maps are supported as well now.
-Apply more than the first UV set to models with multiple UV sets. Edit: Done!
-Do something with the numerical material parameters.
-Write Unity data back to the fmdl format.

https://github.com/BobDoleOwndU/FMDL-Studio-v2

Requires Unity 2017.2+.

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

Posted: Fri Nov 10, 2017 4:04 am
by lionheartuk
BobDoleOwndU wrote:Forgot to post this here.

Fmdl Studio v2

Unity based fmdl importer and FBX exporter (and planned to be fmdl exporter).

Can currently:
-Read fmdl data and build the model in Unity.
-Apply diffuse textures to the model if the textures are in a folder with the model's name located in the Fmdl Studio v2 folder.
-Export rigged and (diffuse) textured models from Unity to the FBX format. (The FBX by default will look for textures in a folder with the fmdl's name at the same location the fbx is located.)

To do list:
-Implement a better system for handling textures.
-Apply textures other than diffuse to the model.
-Apply more than the first UV set to models with multiple UV sets.
-Do something with the numerical material parameters.
-Write Unity data back to the fmdl format.

https://github.com/BobDoleOwndU/FMDL-Studio-v2

Requires Unity 2017.2+.
That sounds awesome!
Will it be supporting terrain in the near future?

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

Posted: Sat Nov 11, 2017 12:56 am
by BobDoleOwndU
lionheartuk wrote:That sounds awesome!
Will it be supporting terrain in the near future?
Another project, FoxKit, is working on getting terrain/map importing working. It utilizes Fmdl Studio v2 for its model stuff.

You can follow FoxKit here: https://github.com/youarebritish/FoxKit.

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

Posted: Thu Dec 07, 2017 4:33 am
by youarebritish
To add to that, terrain has a completely different format from the other models, so it's outside the scope of Fmdl Studio. Terrain support's still a while off but it's definitely feasible.

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

Posted: Mon Dec 11, 2017 8:06 am
by youarebritish
I've gotten most of the .obr format figured out. Here's a template:

Code: Select all

//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
//      File: obr.bt
//   Authors: youarebritish
//   Version: 0.1
//------------------------------------------------
struct Header
{
    ushort u1;                      // Always 3?
    ushort u2;                      // Always 32?
    uint fileSize;
    uint ObjectBrush <hidden=true>; // Hash for "ObjectBrush"
    uint ObjectBrushOffset;         // Points to the text "ObjectBrush"

    FSkip(6*4);

    uint u3;                        // Always 1?
    uint numBlocksHOffset;
    uint offset1;                   // Near the bottom if there are objects

    FSkip(4*4);

    uint u4;

    FSkip(8);
    FSkip(16);
    
    struct HeaderMetadata
    {
        ushort u1;
        ushort u2;
        uint variableNameHash <hidden=true>;
        uint u3;                    // Always 76?
        uint value;
    };

    HeaderMetadata blockSizeWmetadata;
    HeaderMetadata blockSizeHmetadata;
    HeaderMetadata numBlocksWmetadata;
    HeaderMetadata numBlocksHmetadata;
    HeaderMetadata numObjectsmetadata;
} header;

FSkip (80);

struct Object
{
    float yTranslation;
    float v2;
    float v3;
    ushort v4a;
    ushort v4b; // Some kind of offset?
    ushort v5a;
    ushort v5b; // Some kind of offset?
    uint id;
} objects[header.numObjectsmetadata.value];
Object Brush (obr) files are used in Cyprus and Mother Base to place grass, bushes, and other misc semi-procedural debris. There's a corresponding _objBrush.fox2 which sets up data such as what fmdl to place. I believe v2 and v3 are components of a location, rotation, or scale but am not sure just yet. I also believe v5a is some kind of index, but I'm not sure into what yet.