LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
290 stars 160 forks source link

Compressing DDS files #305

Closed qqqbbb closed 9 years ago

qqqbbb commented 9 years ago

I've compressed all dds images from CP using dxt1 compression with 1 bit alpha. For some files dxt5 compression with proper alpha was used to keep image quality. https://dl.dropboxusercontent.com/u/28753474/Community%20Patch%20dds.rar

These 2 files are not used by CP: CommunityArt256 5.dds, CommunityArt256 C.dds.

I checked dds files from vanilla game and some of them are not compressed too. Should CP fix it?

LoneGazebo commented 9 years ago

Excellent, I'll include. Did the compression affect the file quality? I use gimp, and dxt5 compression wrecks the quality in that program.

LoneGazebo commented 9 years ago

Regarding latter point - we can, but it probably won't make much of a size difference. In the end it'd just make the CP bigger, and civ minimally smaller.

LoneGazebo commented 9 years ago

Added files - look fine, however they appear to have offset about 1-2 pixels to the right.

qqqbbb commented 9 years ago

I use gimp too and I never had any problems with image quality. After compressing to dxt5 you should not notice any difference in quality. Try updating dds plugin.

There is no offset. What you noticed is difference between 8 bit and 1 bit alpha channel. With 1 bit alpha (dxt1) a pixel can be either 100% opaque or 100% transparent. With 8 bit alpha (dxt5) pixel can has any level of transparency. Compressing dxt5 to dxt1 reduces file size by 50%.

qqqbbb commented 9 years ago

Here is compressed dds files from vanilla game. https://dl.dropboxusercontent.com/u/28753474/compressed%20dds.rar File size reduced to 10-20% after compression.

LoneGazebo commented 9 years ago

Seems that unit flags in strategic view become blank with compression. Mind checking for me? G

qqqbbb commented 9 years ago

fixed unit flags: https://dl.dropboxusercontent.com/u/28753474/CP%20unit%20flags.rar Looks like unit flag dimensions have to be power of 2 if you compress the image.

qqqbbb commented 9 years ago

About replacing vanilla files. If CP gets a proper installer, we can just copy compressed images to assets folder and set LooseFilesOverridePak = 1 in config.ini.

qqqbbb commented 9 years ago

You forgot to include compressed unit flags

qqqbbb commented 9 years ago

Some compressed images were not displayed becuase of their dimensions. I rescaled them. https://dl.dropboxusercontent.com/u/28753474/Community%20Patch%20fixed%20dds.rar

You did not include fixed unit flags in the latest version.

LoneGazebo commented 9 years ago

Yeah, I'll include them in this next one. Sorry! Thanks again for your hard work. If it wouldn't be too much trouble, I'd love to see the same compression applied to CSD's artwork, which is almost as numerous as CBPs! G

qqqbbb commented 9 years ago

compressed dds files from CSD: https://dl.dropboxusercontent.com/u/28753474/Compressed%20CSD%20dds.rar

ProjectUN.dds is copy of wonderconceptun.dds and can be removed. I edited Projects.xml so the mod uses it instead of the copy.

citizenCivilServant.dds is not used.

LoneGazebo commented 9 years ago

Got it! Thanks.

LoneGazebo commented 9 years ago

The CSD art works at all but the smallest size - the smallest ones (i.e. tech tree ones) are blank.

G

qqqbbb commented 9 years ago

I tested them and everything was fine. Did you copy files from art/xml folder from my archive?

LoneGazebo commented 9 years ago

Yep. I'll try again, sometimes Modbuddy is evil. G

qqqbbb commented 9 years ago

Updated compressed art for CSD:https://dl.dropboxusercontent.com/u/28753474/compressed%20art%20CSD.rar. Removed a duplicate file. EmbassyAtlas256.dds can now be deleted.

qqqbbb commented 8 years ago

Vanilla game has a lot of uncompressed dds files. You wanna include compessed copies in CP?