Guide:Archive2

From STEP Modding Wiki
Weapon.png Under Construction:
This page is incomplete but all info is relevant!

Introduction

Contents


Archive2 is the official tool from Bethesda used to pack archives files for Fallout 4, known as .ba2

It is part of the toolpack that come with the Fallout4's Creation Kit.


For end-users, it is useful to re-pack files under .ba2, especially textures.


Installation

The creation kit and its toolpack have to be installed through the Bethesda.net launcher.

You can download the installer by clicking here

Once the download is complete, run BethesdaNetLauncher_Setup.exe to install it to the location of your choice.


Then, start the launcher (either from the shortcut if you chose to create one during the installation, or by launching BethesdaNetLauncher.exe ). You will be presented with this page:


If you don't already have a Bethesda.net account, you will need to create a one by clicking on CREATE ACCOUNT. If you already have one, simply enter your credentials to gain access to the launcher:

Simply select Creation Kit: Fallout 4 in the left panel, and click INSTALL on the bottom-left corner of the launcher. Accept the EULA, and leave the install options at default (except for shortcuts if you want/don't want them).

Wait for the download/installation to complete (less than 1 minute).

Congratulation ! You know have access the the FO4's creation kit and all of its toolset.

Utilization

Packing a single archive from scratch

You will find Archive2.exe in <gamefolder>\Tools\Archive2

Simply double-click on it to have launch the application:

To add files to your archive, click on Archive -> Add Files... or Archive -> Add Folder..., browse your computer and add the relavant files with the proper folder architecture.

Once all the files you want into your .ba2 have been added, you can pack the .ba2 by clicking on File -> Save.

You will have to enter a name and choose the location of your archive. Your archive will then be generated according to your settings.

Creating a new archive

Instead of the above method, it is possible to first create the archive, then add files into it. This is pretty much the same, except that you're first prompted to enter the archive's settings when you create it.

To create a new archive, Click on Files -> New...

You will be prompted to enter the archive's settings. See Settings Configuration

Settings Configuration

To configure the settings of your archive, click on Archive -> Settings... to bring up this dialogue:

Archive Settings

Those settings affect the archive itself.

Format

Default: General

Options:

  • General - Pack the archive as a regular .ba2
  • DDS - Pack the archive optimized for textures
  • XBoxDDS - Pack an archive optimized for textures and XBox
  • GNF - Unknown, should allow for texture-storage optimization as well
Maximum Archive Size

Default: 17592186044415

Mutually exclusive with Archive Count. Set the size limits of an archive, in MB.

Note that despite this setting, the game itself can only load .ba2 under ~2Gb This is probably intended to limit further the size of archives when packaging for consoles.

Archive Count

Default: 0

Mutually exclusive with Maximum Archive Size. Believed to be usable to create multiple indexed archives (see FO4's textures .ba2 files).

Save String Table

Not 100% sure about this yet (well, this sure is to save a string table of the archived files somewhere, the question is where, and to which purpose).

File Settings

Those settings affect individual files stored in the archive. Only files added to the archive will have those settings taken into consideration, files already present will retain their previous compression level.

Compression

Default: Default

Options:

  • None - No compression
  • Default - Standard compression
  • XBox - Xbox-specific compression

The compression of the file.

Max Chunk Count

Default: 4

Seems to be the maximal number of chunks before mipmaps are indexed individually.
The exact incidence of this setting is currently unknown.

Single Mip Chunk Area

Default : 512 x 512

Note that despite those default values, it'd seems that vanilla .ba2 are using 256x256 (to be confirmed).
The exact incidence of this settings is currently unknown.

Browsing and editing an archive

To browse the content of an archive, use File -> Open... and select a pre-existing .ba2 file.

The list of tiles is displayed on the main table. You can filter it with the text field at the top to only display specific files, either by sub-string match ("Normal" radio-button), or by regular expression ("Regex" radio-button).

From here, you can:

  • Add new files to the archive, using Archive -> Add Files/Folder/Source Files...
  • Remove files: Select them and press suppr or use Archive -> Remove Files
  • Extract all the content of the archive to a specified location with Archive -> Extract All To...
  • Extract specific files: Select them and use Archive -> Extract Selected To...
  • Change the settings of the archive (keep in mind that only archive settings will take effects. File settings will affect only newly added files, not those already present).

Why and how re-packing texture packs

Texture-optimized archives improve the way textures are handled by the game, optimizing performances and VRAM usage.

Technicalities are... technical. Here are two quotes from ianpatt (f4se, originally dumped .ba2 for bsaextractor), and Jon (Nifskope, B.A.E.):


The Texture BA2s are an optimized format. They do not hold complete DDS files but instead are optimized for streaming certain miplevels into the game.

— Jon


There are two types of ba2 archives: general, and texture. General archives can contain anything, while texture archives are optimized for storing textures. There is no significant size advantage when comparing the two, but texture archives store textures in a more intelligent way that is friendlier to the runtime texture streamer. When reading a DDS file, finding the lower resolution textures requires seeking to, and therefore decompressing most of the file. This is inefficient, because in most cases you will care about the lower resolution mips first, when the object is off in the distance. Texture archives store any mips higher than 256x256 in their own separate blocks, while the 256x256 and below are all in their own block.

— ianpatt



Textures pack are often distributed as loose files, because they don't need any plugin. However, re-packing them as .ba2 can improve performance over loose files.

To repack a mod as a .ba2:

  • Extract the mod's texture folder in a temporary location.
  • Start Archive2.exe, select File -> New...
  • In the settings, make sure that:
    • Format is set to DDS
    • Compression is set to default
  • Add the mod's texture folder using Archive -> Add Folder...
  • Save as a .ba2 using File -> Save As...

There is two ways to have a .ba2 loaded into the game :

Plugin's name match:

  • Create a dummy plugin by simple opening the CK and saving. (In this example, PluginName.esp)
  • Package your archive with the texture pack, and name it PluginName - Textures.ba2
  • Make sure both are present in the Data\ folder, and that PluginName.esp is activated.

INI force feed:

  • Package your archive with the texture pack. Name it whatever you want, such as MyTexturePack.ba2
  • Add MyTexturePack.ba2 at the end of the list (separated by comma) of the sResourceIndexFileList setting in Fallout4.ini