Ace Combat 7: Skies Unknown

Texture Replacement Guide using Unreal Engine 4 Editor

Version 1.0b, last updated Sept. 9, 2019

By @Dantofu


Table of Contents

1. Requirements

2. Preface

3. Starting Unreal Engine 4 Editor

3a. Diffuse Texture

3b. MREC Texture

4. Cooking The Assets

5. Packing The Assets

6. Troubleshooting

i. Load Order

ii. Acquiring Textures

iii. DXT Compression Artifacts

iv. DXT vs BC7 - When It Matters

v. Closing and Credits


Changelog

1.0 - Initial release.

1.0b - Minor update to iv. DXT vs BC7 section with new information.

.


1. Requirements

  1. UE4 Editor 4.18 - 7GB custom build courtesy of @RythusOmega. Source tweet for the build. Epic Games account, launcher or connection is not required for this build.
  2. u4pak Python script - For packing the assets into format that Ace Combat 7 can read. Also includes directory template and .bat file for executing the script. GitHub source.
  3. Python 3 - Required to run u4pak script. Any versions above 3 should work. Python 2 will not work with the script provided.


2. Preface

This guide is an alternative method to getting texture replacement into the game, using features provided by Unreal Engine 4 Editor itself. SuperOstrich uploaded a comprehensive guide to extracting and replacing Ace Combat 7 textures that uses hex editing instead of relying on UE4 Editor.

At the time of guide upload there was no custom build listed in the Requirements section, requiring users to download the UE4 Editor in its entire 20GB package, along with having to create an Epic Games Account and Epic Games Launcher just to access it.

Texture replacement using hex editing or UE4 editor produces similar results, and they both work equally well. There are however, some key differences that should be mentioned:

Pros:

  • Very straightforward. Import, compression, and export of textures into final assets are done entirely in-editor.
  • All Mip Map levels are preserved. The last level of Mip Map is contained in .uexp instead of .ubulk. Hex editing is not able to modify .uexp files.
  • BC7 compression format. BC7 is able to preserve finer details that DXT1/5 sometimes struggle with, at the expense of larger filesize and possible performance cost.

Cons:

  • Large package file size. Even though custom build reduces the overall size from 20GB to 7GB, it still takes up a large amount of space for texture replacement purpose alone.
  • Loads and loads of loading. UE4 Editor needs to load twice (Once to load the program, once to load the project). Even with SSD installed, the loading time leaves much to be desired.
  • Performance. Lower-end computers may struggle to run the editor itself.


3. Starting Unreal Engine 4 Editor

Download the .rar file provided in the link above. Extract the .rar in desired location.

The actual UE4 Editor executable is located in Engine\Binaries\Win64\UE4Editor.exe.

Create a new project (Or use existing one, if so desired) with desired Folder and Name. Starter Content is not necessary and will only bloat up space.

The default window when starting a new UE4 Project. Only the Content Browser (Highlighted) matters for this guide.

There is no specific folder structure required, so feel free to organize imported assets as desired, as finished assets will simply copied from project directory to another location for packing.

However, asset names do matter, as Ace Combat 7 will only look to load textures that it was told to load.

Before continuing, go to Edit > Project Settings. There is an option inside that needs to be changed to actually enable BC7 compression format.

Go to Platforms > Windows tab, and under Targeted RHIs it will have DirectX 11 and DirectX 10 ticked by default. Keeping DirectX 10 ticked will cause the texture editor to default to DXT1/5 compression format even with BC7 selected when saving the asset. Untick DirectX 10 to solve that.

The settings are automatically saved, so close the Project Settings window once done.


3a. Diffuse Texture

Textures can be imported by either click and dragging image file onto the editor window or clicking on the Import button itself. Double click on the icon to open Texture Settings.

Ace Combat 7 uses DXT1 compression format for Diffuse textures. The game also uses SimpleAverage for Mip Gen Settings and Character for Texture Group, but the game seems to load new textures with no issues, regardless of the Level of Detail settings. NPC aircraft uses Vehicle for its Texture Group.

If consistency is not a concern, Diffuse texture can be saved without even touching any of the settings.

Once everything is in order, click on Save at top-left to save the asset.


3b. MREC Texture

Short for Metallic, Roughness, Emissions, and Custom data, MREC handles how lighting interacts with the Diffuse texture. It is responsible for some of the cooler effects seen on some aircrafts, such as MiG-21bis “Pyro”, MiG-29A “Jester”, and ADF-11F “Metallic Red”.

MREC is non-color data, meaning the texture isn’t used as image per-se. Each pixel contains data that game uses to calculate rendering effects. Ace Combat 7 uses Red, Green, Blue, and Alpha Channel color values ranging from 0 (White) to 255 (Black) to determine how light interacts on that particular area. The following table explains further:

Channel

Effect

White (0)

Black (255)

Red

Metallic

Full Reflection

No Reflection

Green

Roughness

Matte

Glossy

Blue

Emission (Formation Lights)

Emit Light

No Emission

Alpha

Custom Data

Formation Light

None

The situation is a little different for MREC. Ace Combat 7 uses either DXT1 or DXT5 compression format for MREC, depending on whether the texture has Alpha Channel or not. Alpha Channel is used for formation lights that is seen during takeoff/landing/refueling scenes.

Some aircraft MREC use Alpha Channel (F-15C, A-10C, Su-35S), and some do not (F-16C, Su-37, MiG-31B). One way to tell at a glance is to check their filesizes, as DXT5 will be 2x larger than DXT1.

Alpha Channel?

Compression Settings

File Size (4k res)

Yes

DXT5

21.3 MB

No

DXT1

10.6 MB

Opening texture with Alpha Channel will initially show a largely transparent image save for a few small areas (The formation lights). Uncheck Alpha on View Settings to view MREC in its entirety.

Uncheck sRGB for MREC textures. Leaving this enabled will cause the aircraft to have a permanent wet-effect.

The rest of the settings can be left alone without issues. Ace Combat 7 uses SimpleAverage for Mip Gen Settings and CharacterSpecular (VehicleSpecular for NPC aircraft) for MREC’s Level of Detail settings.

Once everything is checked out, save and close the window.


4. Cooking The Assets

Asset names MUST match the original filenames used by Ace Combat 7. This needs to be done in-editor prior to cooking to avoid any headaches in the future. This will be explained later.

Make sure that every asset is saved. Unsaved assets will have an asterisk (*) in the lower-left-corner of the preview. Either right click on the asset to save it, or click on Save All button to save every unsaved asset in the project (It will show a window listing every unsaved asset prior to saving).

Once everything is in order, go to File > Cook Content for Windows to cook the project assets into files that will be used in-game.

These windows will show at the bottom-right of the monitor. Once the cooking completes, the final asset files will be saved in the following directory, where [Project Name] is the given project name:

Unreal Projects \ [Project Name] \ Saved \ Cooked \ WindowsNoEditor \ [Project Name] \ Content

Within the folder there will be three files per asset: uasset, ubulk, and uexp:

  • uasset contains the metadata for the asset.
  • ubulk contains the compressed texture starting at full resolution.
  • uexp contains the last Mip Map levels of compressed texture.

There may be additional information contained within those files, but the listed are the relevant bits.

DO NOT rename the cooked files. The amount of problems this can cause is impressively diverse but ultimately not beneficial in any way. It may result in broken textures or outright game crash when attempting to load the new texture. It is best to rename the assets in-editor and re-cook the files if needed.


5. Packing The Assets

The python script in Requirements #2 comes with filetree template already in place, so extract the whole zip package in desired location.

Ace Combat 7 uses the following filetree to load textures, starting at Nimbus:

Nimbus \ Content \ Vehicles \ [Aircraft] \ ## \ [Aircraft]_##_[Type]

[Aircraft] is the aircraft name shortened to either 4 or 6 characters.

## is the skin number. The folder names use array indexing which starts at 00 for Skin #1 (Osea), going up to 05 (Skin #6, Strider) or 06 (Skin #7, DLC).

  • NPC skins will have a letter appended to the skin number.

[Type] is the texture type:

  • Diffuse, shortened to “D” in filename. (ex. f15c_01_D)
  • MREC. (ex. f15c_01_MREC)
  • Normal Map, shortened to “N” in filename. (ex. f15c_01_N)

Ace Combat 7 reuses MREC among multiple skin slot where applicable. Since Skin #1, 4-6 (Osea, Mage, Spare, Strider) use same diffuse texture, it would make sense for them to share the same MREC. Unfortunately, this means replacing that MREC will affect all skins that use it.

There is a way to allow each skin to use its own MREC and Normal map, but that will be covered in a different guide.

Here is the filetree for F-15C:

Once the cooked assets are in place, run the Python script by running the .bat file that came with the zip file, or using the command line. Make sure Python 3 runtime is installed as listed in Requirements #3. Otherwise the script will do nothing. 

A new .pak file will appear once the Python script finishes, with filesize matching the assets (10.6MB Diffuse + 21.3MB MREC). Rename the .pak file as desired.

“_P” filename suffix is required for loading DLC content. DLC content is anything that came out after game release. Replacing assets related to Season Pass content (ADF-11F Raven, ADF-01 Falken, ADFX-01 Morgan, Sol skins, Mobius skins) requires the suffix. Day-one DLC (F-4E Phantom, Pixy/Razgriz/Yellow 13 skins) do not, as they are not post-release content.

For example, any texture replacements for ADF-11F will need “_P” suffix at the .pak file. The suffix will allow game to load both DLC and non-DLC content within the file, but missing the suffix will cause only non-DLC content to load.

Find Ace Combat 7 install directory. The default path is as follows:

Steam \ steamapps \ common \ ACE COMBAT 7 \ Game \ Content \ Paks

The content loading starts in this folder. pakchunk0 to 5 are what the game comes with. Create a new folder named “~mods” and move the new .pak file inside.

Launch the game, and if everything went correctly, F-15C Skin #2 (Erusea) will sport a new Diffuse and shiny MREC texture!

Congratulations, the new texture is now ready for release!


6. Troubleshooting

It is likely that there will be issues when trying to get textures into the game for the first time. Here are some common issues and where to start looking:

Cooking fails.

I believe this occurs if UE4 Editor is located inside Program Files. Either run UE4 Editor as administrator or move the editor package elsewhere.

New textures don’t load at all \ New textures load on wrong Skin slot.

This is almost always as a result of incorrect filetree during repacking. Double check that the filepath matches the one used by the game, and replaces asset already in the game.

Also remember that skin folders start at 00 for #1, due to array indexing starting at 0.

Game crashes when trying to load new textures.

Most likely a mismatch between .uasset, .ubulk, and .uexp. Make sure that all three come from the same UE4 asset, and is not renamed at any point. Mixing and matching the three is inviting trouble.

New texture is blurry/very low quality in-game.

It’s possible that UE4 Texture Settings set Compression Quality to Lowest. Expand the advanced tab and check the compression settings.

The aircraft is super shiny in-game.

Open the MREC and make sure sRGB is unticked. sRGB is enabled by default on import and must be manually unticked and saved.


i. Load Order

As stated previously, Ace Combat 7 loads content starting in Paks folder. However, filenames can be changed to affect the load order.

The tilde “~” prefix on mods folder tells the game to load whatever is in that folder after everything in the current folder is loaded.

The game loads paks in alphabetical order, prioritizing everything in subfolders first before loading .paks in current folder.

If there are multiple .paks that load the same asset, the last .pak to be loaded will be in the game, overwriting the previous iteration.

There can be as many subfolders as desired. I have tested up to 10 subfolders deep without issues.


ii. Acquiring Textures

There are several ways to extract game’s textures for editing. SuperOstrich's Guide uses umodel and hex editing to browse, extract, and convert .ubulk files into .dds textures.

Only assets that have .ubulk file can be exported in usable format. Ace Combat 7 uses external encryption on top of .pak encryption that makes simple exporting unfeasible. Any textures that have no Mip Map levels stores the entire image in .uexp, and will not come with .ubulk files.

This MEGA Link contains every player aircraft model in Ace Combat 7 and its associated textures.

@lotsbiss on Twitter uploaded Texture Tool that can read any .ubulk textures, automatically apply correct DDS format, and export it in desired location. Lotsbiss is behind TLS and EML performance mods.


iii. DXT Compression Artifacts

Opening base game textures and zooming in on certain areas will reveal blocky effects, more pronounced on emblems where lots of colors are involved. This is due to compression used by DXT format, which helps maintain memory and space efficiency at the expense of some quality loss.

DXT1 (Diffuse) and DXT5 (MREC) both feature similar level of quality loss as a result of its compression format. DXT5 has larger filesize than DXT1 due to its Alpha Channel.

This article by Nathan Reed explains in-depth regarding compression formats.

In essence, DXT divides the image into several smaller blocks (Way smaller than the grid shown above), and each block’s limited palette is further simplified into colors that fall within a two-color gradient.

Here is one ideal palette for DXT compression. As long as the block’s palette conforms within that line the compression will not affect quality as much. Any colors that falls outside that line (Such as blue or green) will cause problems.

Top row is original. Middle row is after DXT compression. Bottom row is DXT compression + Contrast for better visibility. All images are zoomed in 500%.

The line with thin strokes cause heavy artifacting as a result of multiple high-contrast colors within the blocks, forcing block compression to go either from blue to white or blue to red. The third column is largely intact due to thicker strokes offering buffer space for compression.

Many Ace Combat emblems have thin outlines that leads to compression artifacting when applied directly on texture. Emblems applied through Customization are not as visible, as they are separate 512x512 textures scaled down and applied rendered above the model.

One way to address this is to modify the design to work with DXT compression in mind. Low-vis, greyscaled design is one good solution as it reduces palettes that the compression has to work with.

Another is to use BC7 compression format.


iv. DXT vs BC7 - When It Matters

BC7 is still a relatively recent compression format that is not as widely supported as DXT1/5. Ace Combat 7 supports and loads BC7 textures without issues, but it is hard to determine what performance or compatibility impact it has. There are key differences worth mentioning:

Pros:

  • Very little loss in quality. BC7 is almost indistinguishable from the original image.

Cons:

  • Alpha is always enabled, forcing it to 21.3MB filesize minimum for 4k textures.
  • Lack of BC7 support for DDS export plugin that works with Ace Combat 7. Currently UE4 Editor and lotsbiss’s texture tool can export textures in BC7 format that the game can load.
  • Some aircraft’s MREC breaks during takeoff/refuel/landing sequences (Where Alpha channel activates) when saving the texture in BC7.

The base game already consumes 50GB disk space, and it makes sense to conserve space and resource use where possible. PC offers more headroom in regards to performance, so it may handle BC7 textures better than consoles can.

Many textures can get away with DXT compression with no noticeable artifacts during gameplay, as demonstrated in the majority of base textures.

My take is that BC7 should still be used as a last resort, when there are no other options to adequately preserve texture details. There are still many PC users with older hardware whose performance may still be adversely affected, and increased filesize can quickly add up with numerous custom textures in place.

Update 9/7/2019 - On second thought, scratch that. This is a free, borderless world and people should be able to use BC7 however they wish.

Just bear in mind that the format may cause the texture to break in Ace Combat 7, as listed in the Cons section.


v. Closing and Credits

Whew, this turned out to be a lot more content than expected, but there were many new information that deserved explanation so the reader has a better understanding of the steps taken throughout the guide.

I’d like to give thanks to @RythusOmega on Twitter for his initial research towards Ace Combat 7 modding, and Xentax forums for discovering the .pak decryption key that enabled texture extraction.

And to the Ace Community community, for their continued support, discourse, and encouragement.

And to Project Aces and Kazutoki Kono, for delivering the finest Ace Combat experience yet.

There is one more area that I would like to cover, which will be a separate guide that I will include once it is completed.