Jump to content

Flags in DDS file format?


Recommended Posts

This is as simple as it sounds. I was looking through the Squad folder in GameData, and I noticed that while all the parts and internals textures were in .DDS file format, all the flags (images that appear on the sides of some parts, on flags you plant, etc.) were in .PNG file format.

Is/would it be possible for Squad to convert these files to .DDS file format as well? I assume that would marginally improve improve memory management/loading in the same way converting all the parts textures to .DDS file format did?

Regards,

Northstar

Link to comment
Share on other sites

DDS has a hard requirement: both x and y must be a power of two.

Flags are not that size. So no DDS.

Huh? I thought it was that they be divisible by four, that's what Photoshop always tells me.

Flags are 256 * 160, this goes for standard flags and the large size agency flags. All of the large agency flag images are already in .dds format, so I don't see any reason why the regular flags folder couldn't also be.

I keep hearing people having issues when converting agency and/or flag files to .dds, something about it screwing up the agency loading by the contract system. But I've been distributing and using agency (large and small files) and flag images in .dds format for some time now without a single problem.

Link to comment
Share on other sites

Huh? I thought it was that they be divisible by four, that's what Photoshop always tells me.

Flags are 256 * 160, this goes for standard flags and the large size agency flags. All of the large agency flag images are already in .dds format, so I don't see any reason why the regular flags folder couldn't also be.

I keep hearing people having issues when converting agency and/or flag files to .dds, something about it screwing up the agency loading by the contract system. But I've been distributing and using agency (large and small files) and flag images in .dds format for some time now without a single problem.

I've definitely seen and experienced that issue (it's usually a post in Contract Configurator saying "OMG I have no contracts". I don't have the exact error handy, but it's the unity error saying that the texture data can't be directly accessed from code, being thrown from stock code in the agency loader. So I'm amazed why it would work for you....

Link to comment
Share on other sites

Is/would it be possible for Squad to convert these files to .DDS file format as well? I assume that would marginally improve improve memory management/loading in the same way converting all the parts textures to .DDS file format did?

The average flag png is less than 20 kb, and for the average player there's like.. 20, 25 of them? Saving would be marginally marginally. Time that could arguably be spent better elsewhere to gain bigger improvements.

Not to mention the fact that right now practically anyone can make their own flag have fun with that. DDS flags require software that can save as a DDS file, creating a big hurdle for the casual player to add their own flag to the game.

Link to comment
Share on other sites

Whoops, confusing Unity (which enforces power-of-two) and DDS (which is div-by-4, quite right).

However, the stock DDS loader only supports DXT1/5, it doesn't support uncompressed, and it doesn't support keeping the images readable (i.e. for use by GUI).

Link to comment
Share on other sites

The only reason agencies seem to have a problem is when the scaled logo gets screwed up somehow. GetPixels gets called presumably when it tries to make a scaled logo out of the big logo. Why the scaled logo gets screwed up when using .dds files (maybe it's a problem with the DDS converter) I don't know. But properly made agency definitions and dds agency logos shouldn't have a problem.

Squad seems to have no problem using dds agency logos (I don't know what the deal with those True Color scaled logos is), so there isn't really any reason why they shouldn't have dds flags.

Then again, the flag logos are the least of KSP's texture problems. I really wish they would spend some time optimizing some of their more gratuitously over-sized textures... The materials bay, the atmospheric sensor, about a dozen fuel tank textures (which could really just share two or three textures for each set)... the list goes on.

Link to comment
Share on other sites

The only reason agencies seem to have a problem is when the scaled logo gets screwed up somehow. GetPixels gets called presumably when it tries to make a scaled logo out of the big logo. Why the scaled logo gets screwed up when using .dds files (maybe it's a problem with the DDS converter) I don't know. But properly made agency definitions and dds agency logos shouldn't have a problem.

Squad seems to have no problem using dds agency logos (I don't know what the deal with those True Color scaled logos is), so there isn't really any reason why they shouldn't have dds flags.

Then again, the flag logos are the least of KSP's texture problems. I really wish they would spend some time optimizing some of their more gratuitously over-sized textures... The materials bay, the atmospheric sensor, about a dozen fuel tank textures (which could really just share two or three textures for each set)... the list goes on.

I'd settle for some smarts around punting currently unused texture out of the local set until they are actually needed... but that AND a texture reduction pass would be absolutely fantastic.

Link to comment
Share on other sites

I tested out my scaled agency logo theory and it seems that the DDS converter is doing something to muck up scaled logos. Standard size agency flags get converted from png to dds fine, but the small flags don't get loaded by KSP (and they don't show previews in Windows Explorer either), forcing it to try creating a new scaled logo by shrinking the big file and choking when it runs GetPixels.

Converting the scaled logo to dds in Photoshop works fine, so I would just suggest that mod authors convert all of their agency and flag icons to dds, using something other than the DDS converter from the forums. Aside from the benefits of dds over png, this would prevent the kind of problems that arise when users try converting all of the png files in their GameData folder.

Link to comment
Share on other sites

No photoshop, but tried this using both GIMP and the forum converter program:

  1. Used 'Agency_scaled.dds' - get the load failure on 'Agency_scaled', then the failure when it tries read the unscaled logo to make the scaled logo.
  2. Used 'Agency_scaled.truecolor' - No failure messages, but there's obviously a load failure as the scaled logo in game just appears as a question mark (presumably a placeholder image).

EDIT: Just double checked, and the stock .truecolor images are indeed PNG, no idea why they use the weird file extension. Maybe I'll just rename mine too so people trying to mass-DDS convert won't get caught.

Edited by nightingale
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...