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.
     
  21. Deep_Blue

    Deep_Blue Knight

    Joined:
    Aug 2, 2005
    Messages:
    750
    I used DTX3 format, but I didnt modify any xml or lua assuming that the new DDS will replace the old one. so you cant edit old icons and you can only add new ones?
     
  22. lemmy101

    lemmy101 Chieftain

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    Well you can edit old ones technically, by duplicating them to another file, with this tool, saving as DXT (5 is better if you have an alpha channel btw) and redirecting the atlas or UI to the new one, then making the changes to the new file. So if you wanted to edit all the techs you could do it like this, while technically new ones you would have for all intents and purposes edited them.

    The fonticons are an exception to this rule though.
     
  23. SamBC

    SamBC Chieftain

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    The one thing it seems impossible to add is IconFonts/FontIcons... devs appear to have admitted this and hope to fix it. I'm not sure if there might be a non-modular way around it using the above technique (modify a relevant atlas to point to a new file that's the same as the old one with new things added)...
     
  24. HotRoDDT

    HotRoDDT Chieftain

    Joined:
    May 25, 2011
    Messages:
    12
    Hi,
    My first time trying to MOD in CIV 4, I downloaded the unpacker, opened and tried it without success. When browsing the input directory, it will only let me select the assets folder and no specific files in the folder itself. Can someone please help me out?
    Thanks
     
  25. MouseyPounds

    MouseyPounds Chieftain

    Joined:
    Nov 8, 2010
    Messages:
    417
    Location:
    Maryland, USA
    I hope you mean Civ5. ;) Anyhow, this tool doesn't do single files. You have to give it a directory and it'll unpack everything it finds in that directory. So assuming you're already run the Nexus extract script, you just need to set the input directory to <Install Directory>\resource\DX9 and the output directory to wherever you prefer, and then it'll work its magic.
     
  26. Alikalix

    Alikalix Chieftain

    Joined:
    Feb 15, 2011
    Messages:
    26
    Location:
    Białystok, Poland
    For fonts it says FAIL :(
     
  27. Pazyryk

    Pazyryk Chieftain

    Joined:
    Jun 13, 2008
    Messages:
    3,585
    Yes, I had the same problem. Fonts have the two files (filename-index.dds and filename.dds) but throw an error using the unpacker. Has anyone succeeded in opening these?
     
  28. carloscodex

    carloscodex Chieftain

    Joined:
    Sep 14, 2012
    Messages:
    64
    Location:
    Pleasanton (San Francisco), Ca
    For the life of me, I can't get this to work anymore. The first time I did it (about 9 months ago) it unpacked everything but kept many of the "icon" (buildings, tech, units) files scrambled (not the mini-icons).

    Now, all I see is:
    Start....
    Complete!

    And nothing happens.

    I even thought it could have something to do with my soft- and hard-linking on my folder structures, so I copied everything to very simple folders:

    E:\in
    E:\out

    With the files BuildingTextures.fpk and UITextures.fpk in the "in" folder.

    I of course set the Input and Output directories appropriately.

    Any ideas?
     
  29. isnorden

    isnorden Amnesiac Modder

    Joined:
    Jul 6, 2012
    Messages:
    608
    Location:
    Madison, Wisconsin, USA
    Hmmm...I copied the DX9 directory contents to my art-modding directory, set the input and output locations, and clicked Unpack without getting any result. What could I have done wrong?
     
  30. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    2,984
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    This tool doesn't actually unpack the fpk's. You have to use the Nexus script or Dragon Unpacker first. That was certainly carloscodex's problem in the post above. Is it yours as well?
     

Share This Page