Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

about texture file in game

+2
dewi316
runerback
6 posters

Page 1 of 2 1, 2  Next

Go down

about texture file in game Empty about texture file in game

Post by runerback Sat 03 Oct 2015, 17:20

First, it's my poor English... So I'll try to make it clear.

I began to unpack game files after I got the quickbms scripts from here, I spent time on fmod designer before,  so I unpack the fsb files and try to modify sounds in game, unfortunately I can't found the fsb file which contains all of weapon and explosion sounds. My friend MDDYM told me all of these sounds could be found in PCM.fsb, but quickbms can not touch it, so I have to stop this work.

I use Procmon.exe to check real path of game files, then put them back to the right path and check if there are some errors occurred. The result is disappointing because there are a lot of files with wrong data. When I put stf files back to their location and entered game, these stf files have ruined the whole world by "colorful snows". I also speculated the function of some kind of files: "stf" is the texture file, "fui" is swf file, "vb" "ib" "met" is the mesh data of model files which merged into a "pk" file in OFRR, "hkx" is some files which are created by Havok Engine. I don't know how to use Ollydbg, so I don't know where to start to modify these files.

One day I saw a thread discussing the texture file in game post by templargfx,  then I knew the dds data starts at 2048, so I opened a stf file by WinHex and delete 2048 bytes, but suddenly I found I don't have any dds header files. This stopped me for days. After that I looked over the DDS Header Structure in MSDN, then I remembered some dds files used by Mission Editor which are located in "\Mission Editor\Database\Icons\Props\". By checking them in WinHex I thought maybe their dwFourCC field is DXT5, but the file which I opended don't have the dwMipMapCount field, so I opened another file  "obdbbody04.dds" and got the dds header data whith mipmap info. As I said before, almost all of stf files unpacked by quickbms are not correct, so I can't go further again.

Some days later, my friend MDDYM, again, told me he know a man who got another unpacking tool, so I got the way to contact him and ask for that tool day by day, but I got the same result, he just don't want to give it to me... I said could you give me some stf files in game, then I got a lot of them. Though some of these files have incorrect data, but it's enough. I also got a tool named "TextureFinder" from forum.xentax.com.

Boring words stoped here. If you see this, just read further to get the truth.

Use TextureFinder to open a stf file which is the texture of mh-60s seahawk, set the "SHIFT" to 2048 and the "WIDTH" to 1024, "QUAD FORMATS" to DXT5, then the image of dds appeared, but I can't modify it. So I need another tool called "DXTBmp". I also need a converter of dds and stf file, it's not complex so I made one with C#, and I'll post some codes at the end of this thread.

I use a byte array to store dds header template, which dwFourCC field is set to "DXT5", then I load a stf file into memory and store it in array, after this, I cut and save the stf header data which size is 2048 bytes to a file, the last of stf bytes is all dds data. I changed the dwWidth field to a number which come fome UI, and get the dwHeight field value by mipmap rule( 1024+512+256+128+...+1), then update the dds header data and merge with dds data which stored in stf data array, so I got a dds file.

Opened the dds file successfully by DXTBmp, I add some words to the texture located in the bottom of the seahawk and save. Then I use my tool to cut the dds header which size is 128 bytes, and put the stf header saved before back to right position, so I got a new stf file. It seems that all of stf files have the same header, but I don't want watch it one by one, so I save it to the disk with the “.stf_header" extention.

I opened Mission Editor and put a mh-60s on map and entered the game, the surface of helicopter is split into stripes by white color, this really make me depressed. Then time goes to 2:00 and I still haven't found the key. I found I've spent a whole 16 hours on this so I  go to sleep. (I fear to die! Shocked )

Today, I wake up at 10:00. I think I should change my mind, maybe it's not DXT5, so I opened TextureFinder and load the dds file which I create with my tool then select DXT1, the image changed to stripes, just like the scene I saw in game when I using the new stf. Immediately, I know a thing: it's DXT1, not DXT5.  So I changed the dwFourCC field to DXT1 and output the dds file, but when I opend it in TextureFinder, I found I should change the width to 2048, but after I did that, the dds file size became to double times. But I still modified the image of dds and put the stf file back. In game, the texture is correct so it's really DXT1, but it's just have effect on the top level of mipmap image, so I quit the game and back to the DXTBmp, and I found there are some black area in the bottom of dds, until then, things became clear. What I should do is just set the height size to half, that's the reason of stripes of the texture, because the image are pulled to double times height. So I changed the computation rule of dds height in my tool.

I'm not good at how to modify the texture, so I just post tools here. I'm not lazy, really bounce .

Here are some codes which I use them in my tool.

dds header template:
Code:
       private byte[] dds_header_template = new byte[dds_header_size]
        {
            68, 68, 83, 32, //DDS
            //---------- dds BEGIN ------------//
            124, 0, 0, 0, //dwSize
            7, 16, //mipmapped texture
            2, 0, //mipmapped texture
            0, 0, 0, 0, //dwHeight [13][12]
            0, 0, 0, 0, //dwWidth [17][16]
            0, 0, 0, 0, //dwPitchOrLinearSize
            0, 0, 0, 0, //dwDepth
            7, 0, 0, 0, //dwMipMapCount [28]
            0, 0, 0, 0, //dwReserved1[11]
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //Zero
            //--------- ddspf BEGIN ----------//
            32, 0, 0, 0, //dwSize
            4, 0, 0, 0, //dwFlags
            68, 88, 84, 49, //dwFourCC
            0, 0, 0, 0, //dwRGBBitCount
            0, 0, 0, 0, //dwRBitMask
            0, 0, 0, 0, //dwGBitMask
            0, 0, 0, 0, //dwBBitMask
            0, 0, 0, 0, //dwABitMask
            //------------ ddspf END ------------//
            8, 16, 64, 0, //dwCaps
            0, 0, 0, 0, //dwCaps2
            0, 0, 0, 0, //dwCaps3
            0, 0, 0, 0, //dwCaps4
            0, 0, 0, 0 //dwReserved2
            //--------- dds END ---------------//
        };

header size:
Code:
       private const int stf_header_size = 2048;
        private const int dds_header_size = 128;

get width and height of dds:
Code:
               this.dds_header_data = new byte[dds_header_size];
                this.dds_header_template.CopyTo(dds_header_data, 0);
                int width = this.stf_width;
                int w_low = width & 0xFF;
                int w_high = width >> 8;
                dds_header_data[16] = (byte)w_low;
                dds_header_data[17] = (byte)w_high;

                int[] mipinfo = GetMipInfo(width);

                int height = mipinfo[0];
                int h_low = height & 0xFF;
                int h_high = height >> 8;
                dds_header_data[12] = (byte)h_low;
                dds_header_data[13] = (byte)h_high;

                dds_header_data[28] = (byte)mipinfo[1];

GetMipInfo:
Code:
       /// <summary>
        /// GetMipMapInfo
        /// </summary>
        /// <returns>0 - Height  1 - MipCount</returns>
        private int[] GetMipInfo(int width)
        {
            int w = width / 2;
            int h = w;
            int counter = 0;
            while (w % 2 == 0)
            {
                w /= 2;
                h += w;
                counter++;
            }
            return new int[2] { h + 1, counter + 1 };
        }


Tools Link:

OFDR DDS Converter     (need .Net 4.0)

TextureFinder

DXTBmp



I'll put all original stf files to zip and upload them to google drive later. And I hope to see a little different OFDR world. Thanks. Very Happy

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 03:12

Here are some screenshot:

Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers
Chicago commercial photographers

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 04:46

Follow some steps below:

1

2

3

4

5

6

Open the dds file in DXTBmp.

7

8

9

10

11

12

13

14



That's all.

But... I thought somebody will be interested in this...



runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 07:57

uh... Maybe there are some mistakes in my tool...

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 08:52

hello, is someone here.....?



I uploaded stf file to OneDrive, but I don't know whether it is broken or not.





Last edited by runerback on Tue 06 Oct 2015, 04:53; edited 1 time in total

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 09:11

I'm really not good at this, it's terrible...




runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 09:46

OK, this one is better...








runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 13:46

When I create dds files of guns textures, I found the height must be set to double half (four) less than before, so I updated my tool as figure below:




runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by dewi316 Sun 04 Oct 2015, 17:20

So basically you could re-skin everything in game? All the vehicles could have new camouflage. Could you camouflage the stone bunkers as well? Also the Spec ops could have a full camo face as well as a new camo sniper rifle. Would love to mess in the editor with this but my pc skills are very amateur. Good luck with this looks really good.
dewi316
dewi316
Veteran

Location : swansea
Points : 179
Reputation : 22
Join date : 2012-12-19

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Sun 04 Oct 2015, 17:33

dewi316 wrote:So basically you could re-skin everything in game? All the vehicles could have new camouflage. Could you camouflage the stone bunkers as well? Also the Spec ops could have a full camo face as well as a new camo sniper rifle. Would love to mess in the editor with this but my pc skills are very amateur. Good luck with this looks really good.
In fact, I came here for some help, I only can convert stf file to dds and then convert it back, but I'm not good at modifing images, so I think someone here may do that better.

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by tjdagger Mon 05 Oct 2015, 03:21

Holy Crap! That's awesome runerback!

I would love to have a play with this. But my head space is currently occupied with another project in a different editor. I do hope someone here jumps on this. Would reinstall the game just to see what they can do.

A question? Are we at a stage where we can add extra entities even if they are only re-skinned copies of existing models , or can we only re-skin existing models, which would effect the game on a global level?

Nice work.

tjdagger
Admin

Location : Silverdale, Queensland, Australia
Points : 107
Reputation : 7
Join date : 2012-12-17
Age : 48

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Mon 05 Oct 2015, 07:23

tjdagger wrote: Are we at a stage where we can add extra entities even if they are only re-skinned copies of existing models , or can we only re-skin existing models, which would effect the game on a global level?

It seems that the model data are stored in *.vb files, but there are also a "ib" file and a "met" file together, in "OFP Red Reiver" these three files are conbined to a "pk" file. I have no idea about how to modify these files when checking them in WinHex.

Many stf files are broken, and some files are missing, so maybe it's difficult to re-skin the whole OFDR world.

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Tue 06 Oct 2015, 04:49

I should found this one in 2010, but I started playing this game in 2013, so maybe it's too late...
by the way, I updated my tool to open some stf files which name ends with "nrm".I also have checked the download link of stf files which I uploaded to OneDrive, it's correct. But... I forgot the password of the 7z pack! Sorry about this, I'm re-uploading...

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Tue 06 Oct 2015, 05:53

Download Here: All Original STF Files
Password: ofdrstffiles

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by TheGeneral Wed 07 Oct 2015, 19:26

All I can say to this is........ OMFG! Well done runerback Kudos to you my friend for your persistence in trying to do this work. I'm a bit like Dewi when it comes to doing this stuff for DR. I can make an island for Arma but that is about it. I will nudge a few people to get on to this and see if they can help you out.

Well done again!
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by Zeewolf Wed 07 Oct 2015, 20:44

Well done indeed. I can see you've put a lot of work into this, in the OP you said you had figured out where game files should be placed in folders.

Ideally it would be good to get this kind of stuff documented, because as I understand it, it is not necessary to repack files into the _000 volumes, positioning a file in the correct data_win\ path should be able to override these? But to do so with any file we could do with some method of creating a complete folder structure for the entire contents of the win_000 files. Is it practical to use the same method to produce a file listing or things other than the stf files?

Also regarding the extraction, you are somewhat cryptic about how you got the stf files out of the win_000 files intact. Can you provide some more detail? If you are able to get more files then it would be very nice to get hold of some more XML files, as I believe these may be the key to controlling the associations between many of the files, e.g. The asset_maps XML files and asset_list.txt sound very interesting. Some of them maybe binarised XMLs but this shouldn't pose an issue if they use the same format as the mission editor's export utility.

Zeewolf

Points : 42
Reputation : 13
Join date : 2013-10-02

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Thu 08 Oct 2015, 05:04

Zeewolf wrote:Also regarding the extraction, you are somewhat cryptic about how you got the stf files out of the win_000 files intact.
Most of files unpacked by that tool are intact but not all. That tool belongs to a man I know, but he never give it to me, he said he cannot share that tool to everyone, for some reason technically. So I'm sorry I can't tell you more. I only can get unpacked files from him, then use "Process Monitor" to get the right path, put the file back and enter the game to check whether the file is "real" intact. By now I still can't find the path of some files because there are no record in "filemon" paths list. If you need some files, give me a list or something else and I'll try to put them into a "rar" pack then post the download link here.

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Thu 08 Oct 2015, 05:11

Mdog wrote:
Thanks a lot. In fact I don't really need "help", I mean... I just want to do something to make this game better. I should study English more hardly I think...

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by TheGeneral Thu 08 Oct 2015, 19:20

try to explain to the guy you know that there is a small group of people trying to open up a game that has been around for nearly a decade and that many of the original players to it left because there was the inability to get into the files to mod it. People have tried for years and failed. If we could get into them, we could make the game soooo much better. People have poured hours, blood sweat and tears to try and open up this game, but to no success until this little door opened with your work. There are committed people that are willing to do things  for it. Just beg plead and maybe offer your body to him or sometihng, but we need to find a tool to help us crack this game open.
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Fri 09 Oct 2015, 06:30

Mdog wrote:try to explain to the guy you know... ...
It's a tool just like quickbms, and cannot get the complete intact files. In these "stf" files I got, there are still many mistake. So not saying "When I get that tool, then I can get everything". And I have got all files which unpacked by that tool, but there are still a few files missing, to other files, some are lightly damaged and some are badlly damaged. Next I'll upload them all to OneDrive and post download link here. I mean he don't give me the tool but he have given me all files. So the question is not the tool but how to modify the file. As I know the model data is stored in "*.vb" files, but even if get them it's still difficult to convert them to a known file format. Don't cling to that tool, it's not perfect... I hope you know what I mean. Thanks.

And I want to know the download link I have post effective?

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Fri 09 Oct 2015, 12:11

I have a friend, I met him just because of this game OFDR, that's 4 years before. He has gave up this game for a long time, but when I told him I found the way to modify texture files in game, he was very excited and downloaded the game again, but things just gone to a worse result, he asked me to modify the textures of M1A2 MBT, but I don't know how to do that. Then he quarreled with me and deleted me from his contact list. A few days later, I suddenly understand why, maybe he was just exciting too much. So please just don't like that, calm down!

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by TheGeneral Fri 09 Oct 2015, 14:00

runerback are you have a crisis moment or something. Maybe you need a break? 

I'm not sure what your point is. AFAIK nobody here has been ridiculing your work.
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by runerback Fri 09 Oct 2015, 16:06

Mdog wrote:runerback are you have a crisis moment or something. Maybe you need a break? 

I'm not sure what your point is. AFAIK nobody here has been ridiculing your work.
Well, forget it, I just don't know how to describe it with right sentence... If you are not sure what I am talking about, it's just because when I translate my sentence to English, the meaning of them changed.

People who want to mod this game have spent a very lot of time on it, then 5 years passed, many of them left, some of them have to do many other things for living. But it's not possible to take them all back just because I found the way to modify texture files in game, the model files and flash files in game are still unknown, so I don't want to disappoint them again. And I am not waiting for whole days, I have to work too. Don't take it to heart, I don't mean anything.


runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by dewi316 Fri 09 Oct 2015, 17:17

So my question is what's in the files you have unpacked, and what everyone wants to know is can we mod these files, how did you place pictures on the bunker walls, also paint the soldiers faces, and from what I understand Runerback wants to know if his download link for these files works! I'm really hopeless with a pc and would not know how, or what to do with the downloaded files, if some one could explain or knows what to do or has opened these files from Runerback it would be good to hear from you.
dewi316
dewi316
Veteran

Location : swansea
Points : 179
Reputation : 22
Join date : 2012-12-19

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by Zeewolf Fri 09 Oct 2015, 18:42

See this is why I'm more interested in XML files than models or textures, they are a standard format, it's pretty obvious whether they have been extracted intact or not and it's trivial to edit them.

This business of retexturing vehicles and soldiers, what exactly is that bringing to the game play? Not a lot in my opinion. XMLs have a more direct affect on gameplay so should be of more interest. For example there are a whole load of XML files missing from Templar's "Complete XML package" such as the many "assetlist.xml" files.

I'm specifically interested in how the UI images of weapons (that appear in the ammo crate context menus and player weapon selection) get associated with a given model/entity, since the entity database doesn't seem to influence this. Learning how this works would allow arbitrary numbers of custom weapons to be added to an entity database rather than relying on replacing existing entities.

Zeewolf

Points : 42
Reputation : 13
Join date : 2013-10-02

Back to top Go down

about texture file in game Empty Re: about texture file in game

Post by Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum