1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

DDS unpacker for interface textures

Discussion in 'Civ5 - Utility Programs' started by Sterkhov, Oct 7, 2010.

  1. Sterkhov

    Sterkhov Chieftain

    Joined:
    Oct 1, 2010
    Messages:
    11
    Location:
    Russia
    I made DDS unpacker.
    It unpack some packed interface textures. These textures consist of two files (filename-index.dds and filename.dds). This utility creates filename.png from these files.
     

    Attached Files:

  2. Supercheese

    Supercheese Zeppelin Commander

    Joined:
    Aug 2, 2009
    Messages:
    378
    Location:
    Idaho
    You, sir, are awesome. May many cookies be bestowed upon you. :goodjob:
     
  3. Tabris

    Tabris Chieftain

    Joined:
    Oct 31, 2005
    Messages:
    98
    Nice! Time for some serious modding.
     
  4. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,399
    Location:
    The Matrix
    This program is working as advertised, but only for the contents of the DX9 dir.

    EDIT: btw :goodjob:
     
  5. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,399
    Location:
    The Matrix
    Any chance you could make it unpack into the original DDS format instead of converting them to PNG? Would be nice to have the alpha channel data as well.
     
  6. Sterkhov

    Sterkhov Chieftain

    Joined:
    Oct 1, 2010
    Messages:
    11
    Location:
    Russia
    only DX9 dir contain UI packed textures.

    PNG has the alpha channel.
     
  7. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,399
    Location:
    The Matrix
    There is no alpha channel in the PNGs your program creates - none that I can spot in Photoshop anyway.

    EDIT: Ok, if I save them as DDS files and then reloads the file the alpha channel appears. Odd stuff.
     
  8. RandomPete

    RandomPete Chieftain

    Joined:
    Oct 8, 2010
    Messages:
    34
    This is an oddity of how Photoshop opens PNG files. The transparency IS there - you can see by the fact that the underlying white/grey checkered background is visible. However it's treating them as transparent RGB pixels rather than a separate alpha channel.

    See this thread for a variety of ways around this problem:
    http://forums.cgsociety.org/archive/index.php/t-665136.html
     
  9. smeagolheart

    smeagolheart Monarch

    Joined:
    Sep 4, 2007
    Messages:
    924
    Location:
    Phoenix, AZ
    Or dump photoshop and use theGimp
     
  10. NeverMind

    NeverMind Proud to be Russian

    Joined:
    Apr 29, 2005
    Messages:
    618
    Gender:
    Male
    Location:
    Moscow, Russia
    Cool! Спасибо, земляк! :goodjob:
     
  11. Zyxpsilon

    Zyxpsilon Running Spider

    Joined:
    Oct 29, 2009
    Messages:
    2,554
    Gender:
    Male
    Location:
    On Earth
    Many thanks for this tiny "tool". It's puzzling to know that the official Firaxis ModTools package (re-Nexus) doesn't even give us such stuff.

    I also believe you might need to contact Alexandre at Dragon-Unpacker to see if he could integrate your little prog into his own Civ-V FPK-files decoding process.
     
  12. lemmy101

    lemmy101 Chieftain

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    Sterkhov you are amazing!

    Very nice!!!

    :D:D

    Any chance you could make a version that supports command line arguments so I could incorporate support for loading up all the texture atlases in the tech tree editor? Like the user can set a path to it or something? Or put it in the same directory? Credit obviously will be provided. :)
     
  13. Sterkhov

    Sterkhov Chieftain

    Joined:
    Oct 1, 2010
    Messages:
    11
    Location:
    Russia
    I can give you the source code and you'll be able to integrate this functionality into your project
     
  14. lemmy101

    lemmy101 Chieftain

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    aw well that's awesome of you :D

    I already had a nose at the code in reflector so source code won't be be necessary, but I didn't want to diminish the use of your tool by incorporating it into mine. Entirely up to you though, obviously. We'd stick a credit on the (soon to be in) splash screen or we can call it separately if you'd prefer, I'm cool either way.
     
  15. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    Bump.

    So is this tool meant to make the somehow run-length encoded DDS files readable?

    It doesn't work for me, anyways, it starts, finishes but doesn't unpack anything and doesn't display an error
     
  16. Deep_Blue

    Deep_Blue Knight

    Joined:
    Aug 2, 2005
    Messages:
    750
    you have to unpack the fpk files (in resource folder) first using fpk unpackers in nexus script browser.
     
  17. Deep_Blue

    Deep_Blue Knight

    Joined:
    Aug 2, 2005
    Messages:
    750
    The question is how to use the generated png files for modding? there is no way to reverse the filename.png to filename-index.dds and filename.dds after modifying the graphics.
     
  18. lemmy101

    lemmy101 Chieftain

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    Civ reads in normal DDS files. Just export using the NVidia DDS exporter plugin for Photoshop / GIMP or whatever and you're good to go.
     
  19. Deep_Blue

    Deep_Blue Knight

    Joined:
    Aug 2, 2005
    Messages:
    750
    Nothing work for me. I modified a png file then saved as DDS then added the DDS file to my project but when I start the game old textures are loaded. I tried modifying icons like diplomacy icons, yield icons and worker action icons. it seems you need both filename.dds and filename-index.dds

    If it works for you can you give me an example?
     
  20. lemmy101

    lemmy101 Chieftain

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    We've added about 80 religion icons, several tech icons, unit icons, interface changes. Trust me it works. :p

    However, mod DDS files don't get loaded on-top of core ones, so you can't replace icons like you can UI files, you can only make new ones. So to change an existing icon, you'll need to modify the XML of the appropriate UI or IconAtlas to point to a new DDS file. As such making new yield icons is impossible since they are part of the fonticons which is currently defined in non-moddable xml, so you can't redirect to a new one. I'm sure a patch will sort this out.

    Though you could possibly add a new yield to the city screen etc by editing the XML / Lua to point to a new icon atlas, but you would never be able to reference that new yield in text (tooltips, top bar, etc) as other yields are since it's not part of the fonticons.

    Also, what format of DDS are you saving out as? I use DXT5 and it works fine.
     

Share This Page