[MOD] Mundanely Better Textures 1.80d (Nov-26-2013)

A basic texture optimization mod

Mundanely Better Rebellion Textures

This mod is a texture optimization patch. Though the changes themselves are rather modest, hence the title, they are still noticeable, especially on older systems; on my machine, which can run the game at maximum settings without any problems, the mod reduces memory usage by about 15% and improves framerate by about 5 FPS on average. Except in a few cases mentioned later, everything should look the same: no textures were replaced with custom-made ones and no upscaling, color correction, bumpmap sharpening, or anything of the sort was done.

All sorts of optimization work was done for all textures, particle effects, and UI graphics. Mipmaps were generated for .dds textures/maps, resulting in slightly better framerate during the earlygame and/or when zoomed out at the expense of slightly higher space and memory requirements. To compensate, said .dds textures/maps were converted to DXT5, DXT3, or DXT1c compression, which significantly lowered their space and memory requirements; the only downside is DXTx compressions are considered lossy, but while theoretically you would get a slightly uglier texture, I haven't seen any major differences, not even for the planet surface textures. In total, all textures take up about 150MB less space than before, and in-game tests show an approximate 10% lower memory use from model textures alone. Since my machine is CPU-bound, I have experienced 2-3 more FPS during testing from only optimizing model textures, but people with weaker machines, especially GPU- or memory-bound ones, will most likely notice a greater difference. In the latest version of the mod, all graphical data stored in .tga files (particle effects and UI stuff) was converted to .dds files, mipmapped, and had color palette optimizations done, resulting in even greater framerate improvements and lower memory use, albeit with slightly larger file sizes.

The slight modifications I was talking about earlier were changes to certain UI icons, mainly research icons added in Diplomacy and Rebellion, that were 1-2 pixels shorter than they should have been, resulting in a black bar on the bottom edge of the icon. The population increase researches added by Forbidden Worlds DLC were also improperly sized (1 pixel too tall). I fixed these for all cases I could find, though if I missed something, please let me know.

Latest Changes (full changelog in the included Readme):

v1.80d
Removed mipmaps from the skybox textures, since they were bugged and high quality mipmaps were never loaded. Some mipmap color palettes were also optimized to maintain the low filesize. An addon that reduces the size of larger normal maps was also packed into the main mod file; the normal maps were also sharpened a bit to make the reduced size less noticeable. Using this addon reduces RAM usage by a huge amount (around 30%) and is not noticeable in most cases.

v1.80c
Fixed some bad brush names in Screen-FrontEnd.brushes.

v1.80b
RLE compressed .tga files were removed, as it turns out the game uncompresses them when loading, so it would only save on storage space at the cost of load times (thanks to myfist0 for pointing this out). Instead, almost all .tga files were converted to .dds, in addition to color palette and alpha channel optimization and non-power of 2 dimension sizes being fixed (images were rescaled and/or had "empty" space added, ie. transparency or solid black; the extra empty space is never actually visible in-game). UI files were also updated to force loading of the .dds files instead of the .tga ones.
An optional addon that also optimizes the main menu graphics for the game's original maps was also created; the improvements are slight and only affect the main menu, but since the maps' .galaxy files had to be edited to force loading of the .dds graphics, it could potentially cause problems in multiplayer, hence why it was not integrated into the main mod.

Download:

Download v1.80d here.
Download the v1.80b/c -> v1.80d patch here.
Download the maps addon for v1.80b/c/d here.

 

I could make a Trinity version if there is demand for it. I'm also open to suggestions for any other textures people think might need improving or optimizing. Since people have different tastes, I will probably shy away from beautification stuff, plus I don't think there is anything so glaringly ugly in SoaSE that it mandates anything of the sort.

 
 
 
 
34,211 views 28 replies
Reply #1 Top

Sounds interesting, but how much difference is there between the TSOP release and yours (along the lines of graphics size)?  Most mods try to use .dds format as much as possible, anyway.

Reply #2 Top

IIRC, I tried out before, and did some reading on RLE. they will be uncompressed when loaded in the ram which uses the same ram space but just increases load time. This was a few years ago and maybe the software has caught up but I doubt it.

Reply #3 Top

I was under the impression that most modders did all this compression stuff just to reduce the size of their download, not to boost performance....

Reply #4 Top

Quoting XATHOS, reply 1
Sounds interesting, but how much difference is there between the TSOP release and yours (along the lines of graphics size)?  Most mods try to use .dds format as much as possible, anyway.

I looked into TSOP, and the two don't really overlap. TSOP mainly concentrated on optimizing particle effects and meshes, while this mod focuses on optimizing texture files. The only overlap is that TSOP converted most .tga files to .dds, something which I hadn't done because I was unsure whether it would work, while I kept the .tga files and just recompressed them with RLE. Also, AFAIK, the devs fixed a lot of the problems TSOP addressed in later patches. Still, I'll look into the whole tga-dds thing, something interesting might come out of it.

EDIT: Did some actual comparing, looks like TSOP does, in fact, change some the same textures I changed. TSOP reduced their size, while I kept the same size and just applied the maximum compression settings.

Quoting myfist0, reply 2
IIRC, I tried out before, and did some reading on RLE. they will be uncompressed when loaded in the ram which uses the same ram space but just increases load time. This was a few years ago and maybe the software has caught up but I doubt it.

Experimentally, loading times seem to be unaffected, and I'm running the game from a 7200rpm HDD. I was unaware of Sins possibly uncompressing .tga's, so I'll try to check the bottom of the RAM usage and texture overlays to see if you're correct.

EDIT: You are correct, SoaSE uncompresses TGA files.

Quoting Seleuceia, reply 3
I was under the impression that most modders did all this compression stuff just to reduce the size of their download, not to boost performance....

You're confusing compressed folders (zips, rars, etc.) with file compression. Compressed folders do just what you say they do: they can pack a large amount of files in a much smaller storage space. File compression is based upon the different settings a filetype supports. For example, .jpg files have a quality setting that drastically reduces filesize as you lower it, but you start getting more obvious "compression artefacts", like noticeable blocks of same colored pixels, a prominent grid-like pattern when zoomed in, etc. File compression is either lossless, meaning there is no loss of quality (e.g. FLAC is a lossless compression of WAV), or lossy, meaning there is some loss in quality, but the trade-off is usually worth it up to a certain point (e.g. 320kbps audio still sounds OK on most systems compared to ~8000kbps for uncompresed audio, but 128kbps audio files often sound hollow and flat, even if they take up 67% less space than 320kbps ones). In this mod, I changed the file compression settings of a lot of the textures from a lossless A8R8G8B8 to a lossy DXT5, DXT3, or DXT1c setting; as mentioned in the description, though there is some loss in quality, I didn't notice it at all in-game, so the reduced filesize and memory usage of the texture outweigh the possible quality loss caused by the lossy compression.

 
 
 
Reply #5 Top

The bonus of dds is it loaded into the GPU's ram where tga is not, or it was when I worked on TSOP.

 

Quoting Delnar_Ersike, reply 4
I looked into TSOP, and the two don't really overlap. TSOP mainly concentrated on optimizing particle effects and meshes

Major Stress I think turned all tga into DDS5. along with finding and repairing many text errors, not many meshes were optimized, fighters were which was a major help late game.

DDS5 was a little to compressed for my liking on a lot of the UI stuff, I am happy with all the small research buttons and some of the smaller particle textures as tga

 

If you wish to incorporate anything from TSOP, go ahead, improve on it, the community needs a new leader of the TSOP genre as Stress is retired and I am way to busy with SOA2

Reply #6 Top

Quoting myfist0, reply 5

The bonus of dds is it loaded into the GPU's ram where tga is not, or it was when I worked on TSOP.

DDS5 was a little to compressed for my liking on a lot of the UI stuff, I am happy with all the small research buttons and some of the smaller particle textures as tga

... not to mention being able to have mipmaps for particle effects. In any case, I did a bit of testing with some of the tgas, and you're right, DXT compression is too lossy, but R5G6B5 isn't, not even when I compare using grain extraction. In some cases, the alpha channel is either unused or monochromatic, so I can just strip it out; in rare cases, the entire tga is just an alpha channel, so I can save it as A8L8. Currently slowly working my way through the tga textures at the moment.
 
Reply #7 Top

Quoting Delnar_Ersike, reply 4
You're confusing compressed folders (zips, rars, etc.) with file compression.

No, I'm not...

I don't for sure remember the exact numbers, but IIRC using DXT3 cut down the file-size by a factor of 2 or 4 for planet textures (probably comparable for other textures too)...yet when in-game, the memory usage seemed unaffected regardless of how "zoomed in" you were on planets...I tried on maps with lots of planets and lots of different planets -- did my best to keep other things constant, but I didn't see any differences in resources....essentially, the DXT3 compression did not seem to reduce the memory usage of the game, only the filesize...

I've discussed this with some other modders to hear their thoughts and the general gist I got was basically that they used file compression on their textures just to keep their download size small...

Now, I may be wrong on this....DXT3 may also reduce the memory used by a factor of 2 or 4, I just didn't test it properly...but I assure you I'm not confusing file compression with compressed folders.....

Reply #8 Top

Quoting Seleuceia, reply 7

I don't for sure remember the exact numbers, but IIRC using DXT3 cut down the file-size by a factor of 2 or 4 for planet textures (probably comparable for other textures too)...yet when in-game, the memory usage seemed unaffected regardless of how "zoomed in" you were on planets...I tried on maps with lots of planets and lots of different planets -- did my best to keep other things constant, but I didn't see any differences in resources....essentially, the DXT3 compression did not seem to reduce the memory usage of the game, only the filesize...

I've discussed this with some other modders to hear their thoughts and the general gist I got was basically that they used file compression on their textures just to keep their download size small...

Now, I may be wrong on this....DXT3 may also reduce the memory used by a factor of 2 or 4, I just didn't test it properly...but I assure you I'm not confusing file compression with compressed folders.....

Very odd, because the textures overlay for the dev exe clearly showed a reduction in texture memory usage, for BackdropInGame for example. In addition, I ran test case at the end of my dds pass (same game, same map, same conditions; 9 players, triumverte, all 6 factions present): for unmodded, the first 729 textures loaded took up exactly 814.37 MB, while for modded, the first 729 textures loaded took up exactly 735.00 MB.

 
 
+1 Loading…
Reply #9 Top

Yes the Devs worst textures is a great way to see what is loaded, now I remember that the rle's were showing the uncompressed size, and the different DDS types showed the same as the file size.

Great job so far  k1

Keep us posted on your testing please  :grin:

Reply #10 Top

Yeah, myfist is correct.

How you compress the TGA's really just affect their load times.

The power of DDS is mainly two fold-

  1. You can use mipmaps to improve performance of game elements when zoomed out.
  2. They are sent compressed to the graphics card and uncompressed in hardware by the GPU.

The downside of compressed DDS is they are lossy and add artifacts. Using compressed DDS on UI elements can result in noticeable artifacts in addition to the picture just being a bit blurrier. 

 

Keep working on it and let us know if you learn anything new.

 

On compressing the effect TGA's in the game- be careful as some are not in multiples of 4 on their length and width. They will not compress correctly to DDS if this is the case. I've had one example that also became corrupted after conversion when the file was 1 pixel width which I didn't catch when doing a batch conversion of the files.

 

Reply #11 Top

Quoting myfist0, reply 2

IIRC, I tried out before, and did some reading on RLE. they will be uncompressed when loaded in the ram which uses the same ram space but just increases load time. This was a few years ago and maybe the software has caught up but I doubt it.

So, there's actually a reason not to compress TGA files? I assume you mean the game loads faster at start up?

Reply #12 Top

Yes, load time, but it was negligible. I just didnt see the point when the sheet used up the same RAM uncompressed.

Reply #13 Top

Like Myfist0 said, best to incorporate TSOP into whatever you're working on, and work out from there.  Do you have all the DLCs?

Reply #14 Top

Quoting Delnar_Ersike, reply 8
Very odd, because the textures overlay for the dev exe clearly showed a reduction in texture memory usage, for BackdropInGame for example. In addition, I ran test case at the end of my dds pass (same game, same map, same conditions; 9 players, triumverte, all 6 factions present): for unmodded, the first 729 textures loaded took up exactly 814.37 MB, while for modded, the first 729 textures loaded took up exactly 735.00 MB.

What exactly were you changing?  Were you comparing just normal files to DXT3 or .dds to .tga?

Reply #15 Top

Quoting Seleuceia, reply 14

What exactly were you changing?  Were you comparing just normal files to DXT3 or .dds to .tga?

For v1.8a, I changed most existing .dds textures to DXT5 or DXT1, depending on alpha channel information. However, while converting the effect/UI files from .tga to .dds for v1.8b, I've recently discovered an odd way I can further optimize some textures: quite a few textures aren't colored (just shades of grey), yet they are stored as RGBA8. Converting these files to A8L8 or L8 will reduce their size by at least 50% with no backside, other than the fact that this method is limited to grayscale textures. Plus I don't know of any automation tools I could use to process all 800+ textures, so it will definitely take some time.

EDIT: Scratch that, I forgot DXTx has its own way of saving color, so it's either DXT3/5 or L8/A8L8, not both, making sorting through possible L8/A8L8 optimizations even more of a nightmare.

 
 
Reply #16 Top

I will have to re-look at the planet textures I was working with...I compared normal .dds to DXT3, but like I said, I may not have tested it properly...I also did not use the dev.exe memory stats but rather task manager (I know it sounds sketch but I decided using something NOT put in the game may be a fairer way of analyzing)....

Reply #17 Top

Next version of the mod is done and uploaded. In this version, I removed the RLE compressed .tga files and replaced them with .dds conversions of said .tga files. Since all 400 or so .tga files are different, I went through each one manually to do things like test to see if compression ruins the texture quality, remove unused alpha channels, check to see whether saving the texture with smaller color palettes e.g. R5G6B5 produced any noticeable quality degradation, rescale and expand textures that didn't have dimensions of a power of 2, etc. I also updated the UI files to force loading of the newly converted .dds textures, and also created an addon for optimized versions of maps' main menu graphics, since I had to edit the maps' .galaxy files and didn't want to integrate potentially multiplayer-breaking stuff into the main mod.

Compared to v1.80a, v1.80b lowers memory usage even further (~5% improvement for the update, ~15% improvement in total), has even more stuff mipmapped (weapon and spell effects mainly), and has slightly faster load times. The mod requires approximately 33 MB more disk space compared to v1.80a due to RLE compressed .tga files still being smaller than mipmapped and optimized .dds files, though the mod's textures still take up less space overall than the vanilla textures.

 
 
 
Reply #18 Top

While testing another mod I have in development, I found something nasty I overlooked in v1.80b. This is fixed in v1.80c, and since the modified file is only 7 kB in size, I uploaded a patch for the people who are already using v1.80b to download and decompress into the mod's folder. The full version will follow soon.

 
+1 Loading…
Reply #19 Top

Like Fist0 said. If you want to incorporate your changes into TSOP you are more than welcome to do so. In fact i encourage it. Being that i am retired and all.

The main reasons i converted the TGA's to DDS was that DDS is pretty much the gaming standard. To be able to use Mip Maps in the particle textures, and it saved a crap ton of in game memory, because the textures load into the GPU ram instead of system ram. I know TGA is a better quality format, but the benefits of DDS outweighed the drawbacks IMO.

The Dev's did in fact fix many of the issues TSOP addressed. Like the text errors, missing files, and bad file path name issues. Which is one of the main reasons why it was never updated. TSOP was created for one main reason, and that was to eliminate the 2 gig crash issue. The 2 gig issue is no longer a problem as of Rebellion.

However Rebellion, and the DLC's could have new minor issues that we are not aware of yet. That a simple text edit can fix. Which is why i encourage the community to take over TSOP, and incorporate projects like this one into it, or vice versa.

k1 for outstanding work

Reply #20 Top

Quoting Major, reply 19
The Dev's did in fact fix many of the issues TSOP addressed. Like the text errors, missing files, and bad file path name issues. Which is one of the main reasons why it was never updated. TSOP was created for one main reason, and that was to eliminate the 2 gig crash issue. The 2 gig issue is no longer a problem as of Rebellion.

For mods that is no longer true, I have to tell people to reduce their graphics settings again just like the good old Diplomacy days.  ;)

Reply #21 Top

I meant the 2 gig issue was fixed for the core game itself. Of course for mods it is a different story. People want to put even more eye candy in the game, but do not realize that they will hit the 2 gig brick wall if they over do it.

Reply #22 Top

Quoting Major, reply 21

I meant the 2 gig issue was fixed for the core game itself. Of course for mods it is a different story. People want to put even more eye candy in the game, but do not realize that they will hit the 2 gig brick wall if they over do it.

More like- people don't think your serious when you tell them they can't run mods on HIGHEST/HIGHEST/HIGHEST... Well technically they could- I could reduce the -da and -nm maps down to low resolution and let them feel better about running effects on all highest.

 

Reply #23 Top

Quoting ZombiesRus5, reply 22

More like- people don't thing your serious when you tell them they can't run mods on HIGHEST/HIGHEST/HIGHEST... Well technically they could- I could reduce the -da and -nm maps down to low resolution and let them feel better about running effects on all highest.

 


I, for one, would support some good trolling.

Reply #24 Top

Silliness aside, doing something like that might actually pay off; the map will have a lower resolution, sure, but it might not be not as noticeable if you can do some good sharpening. If I have a bit of time, I might try lowering the maximum resolution of some of the larger textures/maps by 25% (starbases, titans, planets, etc.), then doing a bit of wavelet sharpening (a little trick I learned way back to sharpen images with minimal noise by taking advantage of Photoshop's/GIMP's image resize algorithm, or "wavelet algorithm", hence the name), and see how they hold up.

 
 
Reply #25 Top

If you can reduce the starbase textures (including the -da, and -nm maps) to 2048 res, and make the quality look like the original 4096's. Then that will be a feat in itself. The game hates odd sized textures that are not in a power of 2. Despite a few odd sized ones being in game. Sharpening will be very hard to do without pixelating the texture. This is just from my experience using photoshop. Not saying it cant be done. I personally just wouldnt know how to do it.

You may know some things that i do not. So go ahead, and experiment. Worst that could happen is it fails. If it does work then outstanding.