1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Using PakBuild to compress your Art folder

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Wolfshanze, Nov 3, 2008.

  1. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    Not sure if this is already covered and/or easy to find, but I just got asked by someone how to do this and they said they couldn't find a tutorial in this forum.

    What this is, is compressing your ART folder into a FPK file. This GREATLY increases load times when you have a lot of custom art for your mod... so anyone who makes Mods and wants it to load faster should consider FPKing their art folders to decrease load-time... once you've done this, simply place the FPK file into your assets directory for your mod... you won't need the ART folder anymore.

    Anyways, you only need PakBuild v2.14 or higher.

    ***

    On Pakbuild, do the following:

    1) Put your entire "ART" folder in an EMPTY folder (with nothing else in it but the "ART" folder from your mod). This is VERY important (or you'll be FPKing a lot of stuff you don't want to).

    2) Open-up PakBuild... select from pull-down menu:
    File
    New...

    3) Browse for the folder where you put your ART folder.

    4) You should just see the "ART" folder in the "Raw Files" large window on the left half of PakBuild.

    5) Select the "New PAK File" button in the middle

    6) You should see a large empty "Packed Files" window on the right now... select the "Rename" button... name it whatever you want (like I use "Wolfshanze.FPK").

    7) Just below the "Packed Files" window select "Store Full Paths" (and only that button... don't select anything else!).

    8) From the pull-down menu up-top, select "PAK", then select "BUILD".

    9) You're basically done... sit back and relax... if it's a small build, it could take only a few seconds, if it's HUGE (like 300 megs or so), it could take several minutes... you are DONE packing when the "Packed Files" window changes from blank to having a bunch of files listed there. Like I said, this might take a few minutes, all depends on the size of your project.

    ***

    That's it... if that doesn't spell it out for you, you're missing out on something.
     
  2. RavenKing

    RavenKing Warlord

    Joined:
    Sep 14, 2008
    Messages:
    148
    Location:
    BytheSalishSea
    :( Must be missing something...

    I followed your very clear instructions all the way, and I have my FPK file all built for about 30 new leaders I've added to Amra's Mod. All that seems to have gone fine. But when I open the leaders pedia in the game, I get a sprinkling of pink buttons and the leaders who rely on the new leader art don't appear in the pedia.

    I figure it's likely something I did/didn't do after your instructions ended.

    So here's what happened:

    1. When the pakbuild file was constructed, it ended up in Art/Newfolder/ (I already have 2 other art files paked from Amra's mod so not all the art is in the single new FPK). In addition the original 'leaderheads' art file (the one that I wanted to pak) was still there, with all the subfolders and all the little art files. So I figured that my loading times wouldn't be any better if that file was still in the game so I moved it out to hold somewhere else (and bring it back if this doesn't work).

    2. When I went to close 'Pakbuild' it asked if I wanted to save changes, so I said 'yes' and ended up with a little pakbuild file (much smaller) in my general assets file. It was far too small to be the FPK file and didn't look like anything from Amra's original mod, so I figured that I had said 'yes' to the wrong thing and deleted it.

    3. I have tried placing the new FPK file in my general directory (where Amra's FPK files are) and in the Art/Newfolder location where it was built. Neither works.

    So do I have the new FPK file in the wrong place(s)? Did I do something wrong when I was closing Pakbuild utility at the end?

    Thanks in advance for any light you can shed on this.
     
  3. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    First, you don't need to "Save" changes from PakBuild... "JUST SAY NO".

    2nd, I might recomend you MOVE your art folder to an empty/blank directory near your root drive... like:
    C:\REALLYTEMP

    (so it reads "C:\REALLYTEMP\ART")

    When you follow the above directions, simply browse to C:\REALLYTEMP as to which folder you wish to PAK.

    When you're done... move the new FPK file into your Mod's "ASSETS" directory... you can leave the ART folder in the ReallyTemp folder for the time-being (so you know it's nowhere near your mod).

    Try the Mod now... should work.
     
  4. RavenKing

    RavenKing Warlord

    Joined:
    Sep 14, 2008
    Messages:
    148
    Location:
    BytheSalishSea
    And when the FPK file is created (which I have done successfully, I think) then where is it placed? In the 'Assets' folder. In 'Assets/Art' Somewhere else? Left in 'C:\Reallytemp'? Thanks.
     
  5. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    When you have your FPK file created, stick it in the "Assets" folder.
     
  6. DVS

    DVS El Presidente

    Joined:
    Jul 1, 2005
    Messages:
    1,037
    Location:
    Canada
    Wow, sweet, thanks. I'm working on an art heavy mod now, we'll try this.

    So, conservative people are good for something after all. ;) :D
     
  7. smeagolheart

    smeagolheart Monarch

    Joined:
    Sep 4, 2007
    Messages:
    924
    Location:
    Phoenix, AZ
    Hey. What can't be pakd? The whole art folder can be or not? I get CTD entering worldbuilder so I guess there's some subfolders that can't be packed? I think I've seen elsewhere where movies can't be paked either.

    Is there unpakable stuff?
     
  8. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I don't know the exact answer, but you might want to look what wasn't packed in vanilla - it was probably for a reason...

    I think however the question is more "what should be packed ?" - paking Unit and LH art is known to be safe, and it is the bulk of the most mods art - so it should be enought to serve your purpose - which is reducing the start-up time.
     
  9. notque

    notque Artificially Intelligent

    Joined:
    Nov 13, 2005
    Messages:
    1,654
    Great stuff, thanks!
     
  10. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,220
    Location:
    DE/NL/FR
    Not a whole month, no necromancy :D.

    Question: Has anyone noticed, that packing affects the time of a game-turn?
    My loading-time is growing at the moment, but not very dramatically. But my mod is also not the fastest, so i wouldn't pack my art, if it affects the turn-time.
     
  11. smeagolheart

    smeagolheart Monarch

    Joined:
    Sep 4, 2007
    Messages:
    924
    Location:
    Phoenix, AZ
    Paking can dramatically dencrease mod load time, haven't noticed affect on turn time myself either way.
     
  12. Hephaistion

    Hephaistion Warlord

    Joined:
    Apr 19, 2005
    Messages:
    273
    Location:
    Mt. Vernon, NY USA
    I thought the whole point of Pak-ing was to DECREASE mod load time. If not, what IS the point of pak-ing?
     
  13. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    He must have meant decrease load time. If a mod contains a whole bunch of art the initialization step goes alot faster if the art is packed. It's noticeable with LoR at least. One odd thing I found out is you need to delete all the empty folders in your mod's art directory to notice this, if you just pack all the art, but leave empty folders with that maintain the pathing structure of the art in the main mod, the initialization time stayed the same.

    I'm pretty sure packing the art makes no difference when playing the game though. At least I can't notice a difference.
     
  14. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    I was unpaking something to a new folder, it said it unpaked succesfuly, but there were no files in the folder! I than looked through Pakbuild, and it seemed convinced that there are files and folders in that folder i unpakked to.

    Is pakbuild playing a trick on me? :confused:
     
  15. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,220
    Location:
    DE/NL/FR
    Are you using vista?
    If yes: Did you maybe unpack to a protected folder?
     
  16. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    What do you mean by protected folder? I'll try unpaking again to another place see if that helps.

    Edit: Oh do you mean a folder with a password protection? No of coarse not. Just a regular old folder.
     
  17. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    I tried again in two different locations, but the same thing happened.
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,220
    Location:
    DE/NL/FR
    I meant, that Vista has some sort of protection for the program files folder.
    Do you use vista?
    What fpk do you unpack? The vanilla ones?
     
  19. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    I was trying to unpack Polynesia.FPK from Civfusion to get the Koa.

    I tried again trying to pack it into D:\pack. (a new folder I created) and still nothing.

    Tell me if i'm doing something wrong, On Packbuild, I go on 'PAK' click 'unpack' select the fpk file, and choose D:\pack as destination. It only takes like half a second for it to unpack. I check and there is nothing there.
     
  20. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    Check post #1. It sounds like that's not what you did.
     

Share This Page