How to Optimize your Mod Using the Mod Optimizer Tool

11/05/04

Requirements:

-MDT tools version 2.75 or higher

The mod Optimizer tool will create a list of all sounds and texture files that are in your mod folder but not actually used in the game. The generated lists are batch files that you can then use to automatically delete the unused files. It is recommended that you do this before each major release to keep the download size of your mod as small as possible.

Note: once you use the batch files to delete the unused assets, you will not be able to get them back. Back your files up if you think you may lose something you need later!

Setup

No setup is necessary with this tool other than to have the MDT tools installed.

Generating the Lists

1. Launch the MDT tools, and from the main screen click on the "Show All Tools" button.

2. Open the folder labeled "Mod Optimizer" and double-click on "Mod_Optimize_GUI.exe". You should see the following screen:

3. Select the game you are modding, either Battlefield: 1942 or Battlefield: Vietnam.

4. Select the mod you are optimizing. (In this case it's "My_Mod".)

5. Check the boxes next to the folders you want to check. ("Sounds", "Textures", or both.)

6. Click the "Run Scan" button.

The program will now generate two lists in the form of batch files: "Sounds_not_used.bat" and "Textures_not_used.bat".

7. Click the "View Results" button.

The program will now open windows containing the contents of the batch files, allowing you to see which files are not currently being used in your mod.

Note: the batch file windows will open on top of each other. To see the second one, you will have to move the top one out of the way.

Cleaning up the Folders

Now that you have created the batch file lists, you can clean the unused assets out of your mod folders.

8. Open the "Battlefield Mod Development Toolkit\Mod Optimizer" folder again if you've closed it. (Clicking the "Show All Tools" button on the MDT screen and then opening the "Mod Optimizer" folder is a quick way of getting there.)

You will now see the two new files that were generated.

9. Copy or move the "Textures_not_used.bat" file to the "Texture" folder of your mod. In this case it would be "Battlefield 1942\Mods\My_Mod\Texture".

10. With the batch file in the "Texture" folder, double-click on it.

This will cause the batch file to automatically run, deleted all unused textures from the folder. You may now delete the batch file.

11. Follow the same procedure to clean up the "sound" folder.

Important: as stated at the beginning of this tutorial, once you run the batch file to delete these files, they are gone! It is recommended that you create a backup of all files before optimization. You may also view these lists by right-clicking on the batch file and choosing "Edit". (Don't double-click to open a batch file. This causes them to run!)

You are now ready to repack your files.

- end


Go to Step by Step Tools, Step by Step Scripting, Advanced Step by Step Scripting, or Video Tutorials