Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

Tutorial: Making a custom DLC Textures.tfc

Made by modders for modders. Step-by-step instructions on how to achieve specific modding goals with ME3Explorer. We *strongly* encourage you to post new tutorials on the wiki.

Tutorial: Making a custom DLC Textures.tfc

Postby Kinkojiro » 15 Apr 2015, 03:32

Warning: This is for advanced modders only. It has only been tested on a small number of textures. If done incorrectly it is likely to crash the game and/or Texplorer. Using DLC pccs complicates the process below considerably. Note that textures get reused frequently and this will only affect the pcc in your DLC directory - this means sometimes your texture may appear, sometimes not, unless you put all relevant pccs in your dlc. The user needs to have the DLC setup correctly - see JohnPs tutorial. This is how I do this, there are likely to be much more efficient // better ways to do the same thing - I am not a particular expert on texture modding, Kfreon and others who built these tools understand the process far better.


This method can be used to hold textures for clothing, hair, weapons etc. It is not needed for "flat" GUI textures (for example war asset pictures or codex pictures). Basically if it has mipmaps and wraps around a 3d object then it can be used.

In this example I create a custom tfc in a DLC folder called DLC_CON_MISCMOD (which is my personal mod of small changes) to hold a single texture - a femshep hair texture. Luckily there is only 1 pcc I need to change BIOG_HMF_HIR_PRO.pcc. I have already changed the mesh.

1. Preparation

Create a simple DLC folder for your DLC
- The important point is to know exactly ALL the textures you want replacing and where they occur.
- Your files have to be clean of any previous texture modifications.
- This process is best done as a final step before creating your dlc mod. Test using texmod as when you change textures the changes to the tfc appear to be cumulative. (ie texplorer adds the new texture version but doesn’t delete so your tfc will always contained unused data).
- There must be PCCookedConsoleTOC.bin in the DLC folder.

Create a blank & clean copy of Mass Effect 3
- NO PREVIOUS TEXTURE MODIFICATIONS
- Copy the game to a new folder (this example using "origin games\textemp")
- Delete everything from the biogame\pccookedconsole folder EXCEPT the tfcs (should be 4), the tlks and a half dozen pccs (texplorer needs something in there but avoid putting the files as you are modding). For example:
Image
- Delete all the DLC
- Add back in your custom DLC folder.
- Make sure the Toc.Bin is present in the Biogame folder and the DLC folder.

Setup Texplorer to your new game directory
- Open ME3Explorer - Options\Set Custom Path => find your new exe in Textemp\Binaries\Win32
- NOTE THIS HAS TO BE DONE EVERY TIME YOU RELOAD ME3EXPLORER (for some reason the later versions of Texplorer/ME3Explorer forget what you alternative folder is and will start looking in the main folder).
- Open Texplorer - Change Paths => change this as well

2. Create a new Custtextures0.tfc

Open Texplorer

- Build Database : It should come up with a dialog "TexplorerFIrstTimeSetup" Click BaseGame and your DLC directory
- Because your have deleted all the unnecessary files it should take only a few seconds.
- Find the texture you want replaced. In this case "HMF_HIR_PROShort_Diff"
- Add Bigger Image, then save changes.
- Repeat until all the textures you want changed
- Close Texplorer

If you go back into your Biogame/pccookedconsole folder you will see "Custtextures0.tfc" this is your tfc file.

Copy into the DLC directory and rename it "Textures_DLC_XXX_YYY.tfc" where DLC_XXX_YYY is the name of your DLC folder. (e.g. Textures_DLC_CON_MISCMOD.tfc). Note any other name will not work, the game can find any name of tfc in the basegame but not in the DLC (this means there can only be 1 tfc file in each DLC folder).

3. Re-pointing the PCC

Open the pcc(s) that address the textures using PCCEditor2 ("PCEd2")
Add the name of your new tfc (without the tfc suffix):

On the name table remember the number of the new name (796 in this case)

Find the export object of the texture(s) you replace:

Texplorer has replaced the TextureFileCacheName to a new one "CustTextures0". Change the nameindex to the name you just added. Repeat for every pcc that holds the texture in your dlc - every instance.

Image

4. Changing the GUID

I am not sure how "random" the GUID Texplorer generates is. In order to prevent conflicts I manually adjust the GUID to something unique. Depending on how paranoid you are about conficts it may not be strictly necessary.

Open your tfc in HxD or a similar hex editor. The first 16 digits (the top line) is the GUID.
Image

PccEd2 converts the hex to 4 signed integers. So in this case FC FB AB D6 is -693371396 in dec (i.e. the [0] value in the TFC file GUID).

Get a random hex byte (random.org/bytes/ is a good place). Note it down. Replace the first four hex bytes with the generated code. Do this for each of the four byte groups along the top. Save the file in HXD.

Open ME3Creator and its Hexconverter. In turn enter each of the 4 byte groups in the Hex Little Endian box convert and record the signed Integer

So in this example GUID Changes:
Image

Now for every change of name change the TFCFileGuid to reflect this.
EVERY GUID MUST BE REPLACED ACCURATELY OTHERWISE THE GAME WILL CRASH.

Save changes.


5. Test

Firstly update the TOC.bin in the DLC folder. Rebuild the database in Texplorer (you may have to re-enter the game path). If Texplorer won't build you have done something wrong. You should see your new texture with the correct Texture Cache File.

Image

Finally move your DLC folder back to the proper copy of the game and test in game.

Image

If you want to make further changes (such replacing a different texture or adding another pcc), it is possible without having to go back to the start. Because there is a blank copy of the game with the original "custtextures0.tfc" in the folder you can put in new pcc or edit existing pcc and add further textures. Note you do not have to re-point previously added textures (which are already done in the pcc), just make sure the "Textures_DLC_XXX_YYY.tfc" is also in the folder before you build the database, then replace it with the updated custtextures0, re-name that and any freshly changed objects in the pcc as per step 3.

This can be useful if you are doing large mods and want to add in stages.

Of course if you replace again a texture you already replaced once, then you are just making your tfc larger than necessary.
Last edited by Kinkojiro on 17 Apr 2015, 03:33, edited 4 times in total.

User avatar
Kinkojiro
Modder
 
Posts: 578
Joined: 02 Dec 2013, 04:14
Has thanked: 233 time
Have thanks: 249 time

Re: Tutorial: Making a custom DLC Textures.tfc

Postby Kinkojiro » 15 Apr 2015, 03:33

Changes to the process for DLC mods (using pcc files from Leviathan, Omega, Citadel).

(1) In addition when you create your blank copy of ME3, instead of deleting the entire DLC, you need to unpack the DLC tfc and delete everything except the tfc (so Textures_DLC_CON_EXP001.tfc for Leviathan for example).

(2A) In the situation where you are using a file where your mod only works with the DLC - so Citadel Epilogue Mod for example, that is it. As long as the player has the DLC as well, everything should be fine.

or

(2B) In situations where you are using DLC files that maybe used by somebody without DLC (such as Normandy files in Mapmod) you need to make sure every texture is mapped correctly.

Go into PCCEd2. On the top row next to "Tree View" is a drop down list. Select "Textures2D" and click find. Now it will go through the objects, keep clicking to view them all.

If you find one with the name Textures_DLC_CON_EXP001 for example then this might need to be changed.
The key issue is if this is "flat" 2d texture that is stored in the pcc (in which case no worries), or a 3d texture that gets wrapped around a mesh.

A rule of thumb (no guarantees) if it has a norm, diff and spec version then it is "3d". Lots of textures are reused so if it says "Textures" or "CharTextures" you are fine, these are in the vanilla game.

ONLY if
(A) your dlc will be used by people without the DLC,
(B) the texture is pointing to a DLC.tfc that somebody may not have and
(C) it is "3d" texture
Then you need to extract it (including mipmaps), and put it back into your Custom.tfc (e.g. Textures_DLC_CON_MISCMOD). You will need to repoint the pcc objects as well.
Last edited by Kinkojiro on 17 Apr 2015, 04:40, edited 1 time in total.
User avatar
Kinkojiro
Modder
 
Posts: 578
Joined: 02 Dec 2013, 04:14
Has thanked: 233 time
Have thanks: 249 time

Re: Tutorial: Making a custom DLC Textures.tfc

Postby Deager » 17 Apr 2015, 03:13

Question on step 4. You mention you're not sure how random the GUID is. However, with the name already changed, in my case to Textures_DLC_EXP_CEMF, wouldn't the GUID not matter because even if it did match CustTextures0.tfc, it won't be looking for it there? Or is it some sort of universal search it does, regardless of name?
User avatar
Deager
Modder
 
Posts: 805
Joined: 16 Feb 2013, 01:37
Has thanked: 284 time
Have thanks: 164 time

Re: Tutorial: Making a custom DLC Textures.tfc

Postby Kinkojiro » 17 Apr 2015, 03:21

Deager wrote:Question on step 4. You mention you're not sure how random the GUID is. However, with the name already changed, in my case to Textures_DLC_EXP_CEMF, wouldn't the GUID not matter because even if it did match CustTextures0.tfc, it won't be looking for it there? Or is it some sort of universal search it does, regardless of name?

Basically the game looks for the GUID (at least for a primary source). So when you generate a new CustTextures0.tfc texplorer generates a GUID for you and automatically replaces all the GUID numbers in the source pcc.

So my only issue is I don't know whether the GUID texplorer generates is random or not (maybe Kfreon or somebody can clarify). If it is not then problems may become apparent if DLC mods all start having the same GUID. If you have 2 tfcs with the same GUID the likelihood is something will go wrong, although I have never tested.

So me being paranoid and basically wanting to be 100% certain that this will not be the case, make my own GUID. I am being paranoid - but you are likely to be safe not worrying about the GUID - and only need to change it if KF says it definitely not random. That is why I put it in, being ultra-safe.
User avatar
Kinkojiro
Modder
 
Posts: 578
Joined: 02 Dec 2013, 04:14
Has thanked: 233 time
Have thanks: 249 time

Re: Tutorial: Making a custom DLC Textures.tfc

Postby Deager » 17 Apr 2015, 03:36

Gotcha. I figured that was the case and I agree, if KFreon can confirm that'd be great. If not, maybe I'll do a quick test with just one texture in one file or something and make the numbers match a CustTexture0 and find out what really does happen.

EDIT: Decided to do one test before bed. Now, I could have messed up some GUID numbers while copying and pasting or simply missed one file, but the game did go into a never ending load. So it is possible the GUID must be unique, which isn't completely strange. The difference between the values when I ran my custom texture vs the CustTexture0 file which got created in the root of CookedPCConsole was quite different. If KFreon is using a generator it's a decent one because every byte was different.

I should add, the scanning seemed to go fine with no hitches at all or errors. So, this extra step seems to be great and I think it may work. Still, lots of testing to do. And I'd love an official word from KFreon on exactly how random those GUID values are.
User avatar
Deager
Modder
 
Posts: 805
Joined: 16 Feb 2013, 01:37
Has thanked: 284 time
Have thanks: 164 time

Re: Tutorial: Making a custom DLC Textures.tfc

Postby giftfish » 29 Aug 2016, 15:49

@Kinko -- Organizing the tutorials section here.

Should I archive this tutorial in light of AVPen's simpler method?
User avatar
giftfish
Toolset Developer
 
Posts: 1245
Joined: 08 Jan 2016, 02:35
Has thanked: 129 time
Have thanks: 74 time


Return to Modders' Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

suspicion-preferred