Kael
Deity
HOW TO: Get your mod to load faster
[tab]This guide is particularly useful for mods that use a lot of art resources. The first version of Fall from Heaven took several minutes to load on most machines. This load time got longer as more art resources were added.
[tab]Dandrae found a solution that allowed the mod to load in a few second instead of a few minutes. He packed all of the art files into a single fpk file. This article will cover the process of doing that for your mods to decrease the load times.
1. Download PakBuild.exe.
2. Copy your 'art' directory into an empty directory. For this process we will assume you create a 'Temp' directory on your desktop and copy your art directory into it.
3. Run PakBuild.exe.
4. From within PakBuild select File -> New. PakBuild will allow you to select a directory, select the 'Temp' directory on your desktop.
[tab]Notice we had to select the parent of the art directory. If we did that in the mod we would be selecting the Assets directory and Pakbuild would pak everything under Assets (so the entire mod). Making the final fpk file much larger than we need.
5. After you have selected the 'Temp' directory you should see the art directory in the left hand window. Make sure you have 'Store File Paths' checked. See the screenshot for an example of what it should look like.
[tab]I could never get compression to work. Regardless though that might shrink the size of your mod it would probably increase load times and slow down the game as it would have to decompress the data to use it.
6. Select the 'New PAK File' button.
7. From the Pak menu select 'Build'. This will create the fpk file.
[tab]It doesn't really matter. Civ4 searches the Assets directory for all files that end with a fpk extension. Just make sure it isn't 'Assets0.fpk', 'Assets1.fpk', 'Assets2.fpk' or 'Assests3.fpk' so it doesn't conflict with any of the Vanilla Civ4 files (you don't need to worry about Warlords, they didn't pak their files).
8. Copy the newly created fpk file into the Assets directory of your mod.
9. Delete your art directory.
[tab]That should be it. Please use this thread to post any questions you may have.
Bonus section (free of charge)
[tab]Ploeperpengel came up with some great information about art files and the formats they use. You may want to consider the following formats for your dds files:
DXT1 (ARGB 1 bit Alpha): This is the smallest format to use. Meaning it will take up less size on the disk and in memory. I use DXT1 for all of the 2d graphics in Fall from Heaven. The disadvantage of DXT1 is that there is no gray on the alpha channel, each pixel is either black or white. That usually means it doesn't work well for skins which want to use greys in the alpha channel to blend the teamcolor or provide partial transparency.
DXT3 (ARGB Explicit Alpha): This is the format Firaxis uses. Its larger, and therefore takes more memory, than DXT1 but it allows shades of grey on the alpha channel.
8:8:8:8 (ARGB 32 bit): I havent really found a use for this format but I include it since it is a viable format for Civ4. It creates pretty big files and I would recommend against using it.
Mip Maps
[tab]Mip Maps are multiple versions of the image at different sizes. Having Mip Maps included in the save file increases the size of the file but saves the application from having to resize it on the fly. So in theory it should cause you to have larger dds files but faster performance.
[tab]Because 2d art isn't dynamically resized I dont save it with mip maps. I have noticed that if you do save 2d art with mip maps it can look blurry at certain resolutions.
[tab]If you use mip maps with your skins is up to you. If you don't include mip maps it should make your mod run slower. But I haven't noticed any speed difference either way and the skins look less blurry to me if mip maps aren't included.
[tab]This guide is particularly useful for mods that use a lot of art resources. The first version of Fall from Heaven took several minutes to load on most machines. This load time got longer as more art resources were added.
[tab]Dandrae found a solution that allowed the mod to load in a few second instead of a few minutes. He packed all of the art files into a single fpk file. This article will cover the process of doing that for your mods to decrease the load times.
1. Download PakBuild.exe.
2. Copy your 'art' directory into an empty directory. For this process we will assume you create a 'Temp' directory on your desktop and copy your art directory into it.
3. Run PakBuild.exe.
4. From within PakBuild select File -> New. PakBuild will allow you to select a directory, select the 'Temp' directory on your desktop.
Spoiler Why don't we pakbuild directly on the art directory in our mod? :
[tab]Notice we had to select the parent of the art directory. If we did that in the mod we would be selecting the Assets directory and Pakbuild would pak everything under Assets (so the entire mod). Making the final fpk file much larger than we need.
5. After you have selected the 'Temp' directory you should see the art directory in the left hand window. Make sure you have 'Store File Paths' checked. See the screenshot for an example of what it should look like.
Spoiler Why don't we use compression? :
[tab]I could never get compression to work. Regardless though that might shrink the size of your mod it would probably increase load times and slow down the game as it would have to decompress the data to use it.
6. Select the 'New PAK File' button.
7. From the Pak menu select 'Build'. This will create the fpk file.
Spoiler What should I name my pak file? :
[tab]It doesn't really matter. Civ4 searches the Assets directory for all files that end with a fpk extension. Just make sure it isn't 'Assets0.fpk', 'Assets1.fpk', 'Assets2.fpk' or 'Assests3.fpk' so it doesn't conflict with any of the Vanilla Civ4 files (you don't need to worry about Warlords, they didn't pak their files).
8. Copy the newly created fpk file into the Assets directory of your mod.
9. Delete your art directory.
[tab]That should be it. Please use this thread to post any questions you may have.
Bonus section (free of charge)
[tab]Ploeperpengel came up with some great information about art files and the formats they use. You may want to consider the following formats for your dds files:
DXT1 (ARGB 1 bit Alpha): This is the smallest format to use. Meaning it will take up less size on the disk and in memory. I use DXT1 for all of the 2d graphics in Fall from Heaven. The disadvantage of DXT1 is that there is no gray on the alpha channel, each pixel is either black or white. That usually means it doesn't work well for skins which want to use greys in the alpha channel to blend the teamcolor or provide partial transparency.
DXT3 (ARGB Explicit Alpha): This is the format Firaxis uses. Its larger, and therefore takes more memory, than DXT1 but it allows shades of grey on the alpha channel.
8:8:8:8 (ARGB 32 bit): I havent really found a use for this format but I include it since it is a viable format for Civ4. It creates pretty big files and I would recommend against using it.
Mip Maps
[tab]Mip Maps are multiple versions of the image at different sizes. Having Mip Maps included in the save file increases the size of the file but saves the application from having to resize it on the fly. So in theory it should cause you to have larger dds files but faster performance.
[tab]Because 2d art isn't dynamically resized I dont save it with mip maps. I have noticed that if you do save 2d art with mip maps it can look blurry at certain resolutions.
[tab]If you use mip maps with your skins is up to you. If you don't include mip maps it should make your mod run slower. But I haven't noticed any speed difference either way and the skins look less blurry to me if mip maps aren't included.