SpecialK - Dumping and Injecting Textures

SpecialK - Dumping and Injecting Textures

Intro

I recently dumped FFXII's map textures from the game for something I'm working on. I received a request for instructions on how I did this, as well as how to inject custom textures into the game. It's actually quite easy using Kaldaien's SpecialK mod, so I've written this simple guide for anybody who is interested.

Please note that I'm assuming you're familiar with texture basics and .dds format. If you are not familiar with .dds editing, mipmaps, compression, etc, you can find tons of tutorials on Google.

Many of the textures will not work with the GIMP .dds plugin. I don't use Photoshop so I don't know if it's the same deal there. Even the thumbnails don't work right. You can convert these textures with Noesis and a .phyre python script available for it. I don't know if you have to convert them back for SpecialK to re-inject. Please let me know what you find!

Get SpecialK

First things first you need to download and install SpecialK. There's already a fantastic guide here on Steam that covers everything.

https://steamcommunity.com/sharedfiles/filedetails/?id=933337066

I recommend local injection over global, but that's just my personal preference. Instructions are included on the guide I linked and all it takes is a game restart to set up.

Create And Edit Profile


SpecialK - Dumping and Injecting Textures image 9
SpecialK - Dumping and Injecting Textures image 10
SpecialK - Dumping and Injecting Textures image 11

Once SpecialK is installed and set up to your liking, navigate to the following folder:

C:\Users\userid\Documents\My Mods\SpecialK\Profiles\FINAL FANTASY XII THE ZODIAC AGE

Remember to change 'userid' to your user account name. In this folder you'll need to edit SpecialK.ini. If you switched to local injection then you'll have to edit dxgi.ini as well. If you're using global injection (default) you probably don't have the latter file in this folder.

Anyway, open the file in your text editor of choice. First, search for the following line:

DumpOnFirstLoad=false

Change it to read

DumpOnFirstLoad=true

This will tell SpecialK to start dumping textures as they're loaded.

Next, search for the following line:

inject=true

Double check that it's set to true. It should be by default but it doesn't hurt to double check.

Lastly, search for the following line:

AllowUnsafeRefCounting=false

We have to change this to true. SpecialK has a warning that changing this setting could cause memory leaks, so be sure to change it back to false if you are not perusing the textures in-game (which we will be doing momentarily). So set it to true and enjoy your memory leaks for now.

Get Textures


SpecialK - Dumping and Injecting Textures image 27
SpecialK - Dumping and Injecting Textures image 28
SpecialK - Dumping and Injecting Textures image 29
SpecialK - Dumping and Injecting Textures image 30

It's time to start dumping textures! Load up FFXII and SpecialK will start dumping textures as they're loaded into memory, but only the first time they're loaded for the current game session. If you delete or move the textures while the game is open SpecialK won't re-dump those textures for you until you restart the game. This could be good or bad depending on what you're trying to do.

First, locate your texture dump folder. Open the SpecialK GUI (ctrl + shift + backspace), click File, then Browse Texture Assets, then Dumped Textures. It will open the folder for you. Take note of its location. For me it's:

C:\Users\userid\Documents\My Mods\SpecialK\SK_Res\dump\textures\FFXII_TZA.exe

Load up a save and hunt down the textures you're interested in. For the purposes of this guide we're going to hide everything on the world map but the background texture.

So first things first, open the world map. Eugh! Too busy! For funsies let's get rid of all the icons, text, and ant trails. Keep in mind that editing these textures may result in undesired changes to other game objects that share any of these textures. Reportedly there are a lot of objects that do exactly that in this game.

Open the SpecialK GUI and scroll to the Direct3D 11 Settings dropdown. Click on the red Render Mod Tools button.

If you forgot to change the ini settings earlier you will almost certainly get a warning about the game not properly tracking texture memory, and a ton of textures will fail to appear in this GUI.

Assuming everything's going smoothly so far, you probably have a lot of blinking textures on your screen now. In my case, it's the map text. The left panel is the Live Shader View, and the right panel is the Live Texture View.

In the Live Texture View there's a scrolling menu right under the 'Refresh Textures' button. The random gibberish are your texture names. These are the same names textures are dumped as. As you can see in the following screenshot the top texture in the list is 7e307928. It's selected, and all the location names on the map are blinking as a result (which I can't really screenshot well).

It just so happens in my texture dump folder I have a texture called Uncompressed_7E307928.dds, and it just so happens to contain text symbols.

Open this texture up in GIMP or Photoshop and edit as you see fit. I just erased everything so it's nothing but a blank transparent slate and re-exported it. Again, I should note that editing this texture will probably also result in changes elsewhere in the game. You may lose UI text.

Inject Textures

SK_Res\dump\textures\FFXII_TZA.exeSK_Res\inject\textures
SpecialK - Dumping and Injecting Textures image 45
SpecialK - Dumping and Injecting Textures image 46

After editing this texture to nothing but a blank alpha and re-exporting it it's time to find your texture inject folder. You do this the same way you found the dump folder. File -> Browse Texture Assets -> Injectable Textures. If this does not open the folder for you, you probably have to create it first.

So as I said earlier my dump folder is here:

C:\Users\userid\Documents\My Mods\SpecialK\

I had to create an inject folder path:

C:\Users\userid\Documents\My Mods\SpecialK\

You also have to rename the file. Just delete the 'Uncompressed_' prefix.

Restart the game. Sure enough, I've lost UI text. Awesome!

Repeat the process again for the following world map textures:

0ce1a309 - 'Region' text

11f31157 - Selection indicators

9bb19d73 - Location icons

cbdc14a6 - Blur around the screen edge

cc67f7ca - Ant trails

Remember to rename them appropriately and place them in the folder.

Restart the game and you should see a nice clean map with no icons, text, or blur effects.

Success! The only things left are the black bars. That's managed by a Pixel Shader (Live Shader View menu, green dropdown). The specific shader is 38e035d2. You can set it to "never draw" to get rid of it. Closing the Render Tools window will cause it to re-appear, though.

There seems to be a lot of trial and error when altering textures for this game. Have fun!

Examples


SpecialK - Dumping and Injecting Textures image 65

Rabanastre Southgate is happy to see you!

And here's an unblemished map of Ivalice! It's too large to upload to Steam!

https://i.imgur.com/fIrWxUh.jpg

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=1491783680					

More FINAL FANTASY XII THE ZODIAC AGE guilds