Toontown: Optimizing Content Packs
Tips and tricks to boost performances with content pack development.
Content pack optimization is crucial for player compatibility. It wouldn’t be a good thing if a content pack dropped a couple of frames on average or extended area loading times. Especially with lower-grade PCs and laptops, unoptimized content packs warrant a sacrifice between smoother performance vs. visual/audio differences. Additionally, It’s not surprising to find a lot of content packs that exceed over 1 gigabyte in file size, thus requiring a sufficient amount of bandwidth to download the pack.
In this post, I’ll explain several techniques to optimize the performance and overall storage size of content packs.
Note: My examples are derived from random content packs. This post is not in any way targeted for or against any specific content pack.
What contributes the most to the size?
First and foremost, it’s probably a good idea to scope out what files in specific contribute the most to the overall pack size. I’ll be using a Windows freeware tool called “DiskSavvy” to analyze files within a certain pack’s directory
So, what can we do to improve the performance in a content pack?
1) Adjusting texture resolutions.
One of the common malpractices working with textures is an incorrect file resolution. By default, Toontown’s game engine, Panda3D, has a special rule on how it processes textures.
If the width or the height of a texture isn’t an exponent of 2, such as [4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, …], Panda3D will raise that value to the nearest exponent.
- For example, if you had a texture of
100x200, then Panda3D will automatically rescale that texture to
- If the texture’s resolution is
129x257, then Panda would automatically rescale to
256x512since the next exponent after
256and so forth.
Suppose you have a texture that has a resolution of 1920x1080 in your pack. When that texture is loaded into the game, both the width and the height would automatically be scaled to 2048x2048. Solution? Resize that graphic to 1024x512 or 2048x1024 if focused on quality precision.
2) Downscale texture resolutions over x2048+.
Unless you intend to create a texture pack intending to have x4096 (4K) or even x8192 (8K) textures, I strongly recommend you keep textures below x2048 in resolution.
Keep in mind that Toontown wasn’t built around using high resolution texture sizes, so extremely high texture resolutions may cause game instability in some places. Not only will this help optimize file sizes, but some users may see a performance boost when running the pack. Downscaling textures may result in a quality difference (as expected).
3) Remove unmodified/stray textures.
Keep in mind that by default, the game will apply any contents located within the maps and audio folders (and subfolders) when content packs get loaded in. That being said, having vanilla/unmodified assets within your content pack is a sign of redundancy and should be cleaned out if possible. I recommend having a backup of Toontown’s resources outside of the distributed pack and using those as a reference for making new content.
Additionally, unless done intentionally, ensure that your content pack doesn’t have any stray textures such as a project file or a version of a texture that’s renamed (Example: Having a file called lawbotHQ_palette_3cmla_1_v2.jpg that doesn’t get used at all in the game.)
4) Remove extraneous folders.
This is more towards beginner producers, but make sure you don’t include any ‘models’ or ‘etc’ folders in your content pack. By default, Toontown projects (besides Toontown Offline) will intentionally skip over these folders when reading a content pack, since custom models may be used to alter gameplay.
** Besides phase_3, if you would like to modify the Toontown cursor in Toontown Rewritten.
If you want to make a certain 2D texture transparent, the best way to go is to stick in an RGB (or PNG) file that’s 4x4 in resolution, that’s either completely black (_a.rgb) or transparent (png)
. There’s no need to have any sort of complimentary texture since it’ll be transparent anyway. Note: don’t apply this shortcut for any palletized textures!
I recommend the same thing for any solid colors/basic gradients. Solid colors don’t have any sort of repeating pattern or design per se, so there’s not really a point in having a single color in a high resolution. (This may help with some optimization, too!)
On a Windows computer, I personally take advantage of the “Group by” options and select the ‘Dimensions’ category which sorts images into groups of similar/identical resolutions.
For macOS users, check out this stack exchange post on how to do it here
When you design a content pack, aim for lower file size (en masse). The larger the pack, the more it tolls on computer resources.
As someone who went through the ride of creating content packs from 2013 up until 2016, I know far and wide how important the total file size is for your content pack. After working more on the technical side of things with Toontown and Panda3D, I learned about how Toontown’s assets could be further optimized while keeping them of high quality. I’ve been researching many different techniques and procedures I could use to further boost Toontown’s quality and performance. I decided that I wanted to share some tips I’ve learned throughout my time understanding ways to optimize Toontown’s assets for projects like Toontown: Corporate Clash. I hope none of my explanations are overcomplicated or confusing!
If you have any questions or suggestions about this post, please feel free to reach out to me on Discord,
loonatic#1337. Feedback is greatly appreciated!
Goodies + Links
DiskSavvy, a freeware tool to analyze disk space usage (Windows): https://www.disksavvy.com/downloads.html
Alternative to DiskSavvy for macOS users: http://www.derlien.com/
Here’s a nice PDF I found that explains a bit more about how digitals photos work. If you’re a beginner or just unsure about some of the terms I’m talking about, I recommend giving this a read. https://www.reading.ac.uk/web/files/using-images/Understanding1.pdf