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

Mac Extractor for Assets .fpk files

Discussion in 'Civ4 - Macintosh' started by AlanH, Apr 30, 2008.

  1. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    I'm not sure I understand you answer.

    There are some Art files that are inside the assetsX.fpk files, there are others that are not. Which ones do you think are missing?

    If I run Macapaka on the assets files on my Civ4 DVD, and highlight the Art folder in each of the four files, Macapaka tells me there are the following numbers of packaged files in each one:

    assets0.fpk: 1975 files
    assets1.fpk: 2594 files
    assets2.fpk: 2250 files
    assets2.fpk: 739 files

    Are you seeing different numbers?
     
  2. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    Thats the thing, when I open macapaka and open the files, nothing happens. I guess I thought once you open the files they would appear under the art folder.
     
  3. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    You clearly haven't read the Readme/Help that's included in Macapaka!

    Here is the part about Running Macapaka:

    I have emphasised the part that explains how to extract the files. Please let me know whether this answers your question.
     
  4. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    When I go to the file - open menu and select one of the Assets.fpk files, nothing happens. I dont get the window with the expandable listing.
     
  5. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    I thought the above posts meant you were able to see the Art folder :confused:

    I've tested Macapaka on an Intel Mac in Leopard, and on a G4 running Tiger. I think it's very unlikely that Tiger on an Intel Mac would fail. What do you see if you select "About Macapaka" in the Macapaka menu? What do you see if you select "Help" in Macapaka?
     
  6. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    Macapaka version 1.1.0
    produced and tested by Alan Hart

    The help window shows up as it should
     
  7. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    When you try to open a .fpk file, do you see any messages appear in the system console?

    Here is a version that will dump some debug information in the Console when you try to open a file. Please can you run this one, try opening Assets0.fpk, and copy the console output here?

    [EDIT] Debug version removed to avoid confusion
     
  8. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    When I open macapaka I get this

    -[NSBundle load]: Error loading code /Library/InputManagers/MagicMenuEnabler/MagicMenuEnabler.bundle/Contents/MacOS/MagicMenuEnabler for bundle /Library/InputManagers/MagicMenuEnabler/MagicMenuEnabler.bundle, error code 2 (link edit error code 0, error number 0 ())

    And when I select to open the fpk file I get this

    2008-08-11 10:20:01.274 Macapaka[5417] *** -[NSToolbar initWithCoder:]: selector not recognized [self = 0x12b1e140]
    2008-08-11 10:20:01.276 Macapaka[5417] *** -[NSToolbar initWithCoder:]: selector not recognized [self = 0x12b1e140]

    EDIT: I tried the debug version and it worked!
    What did you change?
     
  9. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    Please can you go into /Library/InputManagers/ and remove MagicMenuEnabler. It is a third party 'Haxie'. I suspect it's PPC-only code.

    I don't call NSToolbar anywhere in the code, so I'm hoping that is a secondary effect of the first problem. If not I'll have to investigate ...
     
  10. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    Okay. Both of the errors are gone now.
     
  11. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    Great!

    So can you extract the files now?
     
  12. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    Yes it worked perfectly :banana:
     
  13. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    Jut saw your edit:

    The debug version had two changes. They would only have any effect if it got beyond the [NSToolbar initWithCoder:] error you were seeing.

    The first was to output some debug details that I thought could have been useful, but they would only be output later. They change no program logic.

    The second was a byte order bug fix that should only affect operation on a PowerPC CPU. That is included in the new version I have now put in the first post. Since you said you are on an Intel Mac that should have had no effect for you.
     
  14. iggymnrr

    iggymnrr Chieftain

    Joined:
    May 20, 2003
    Messages:
    1,974
    Worked fine for me. Are there really no fpk's to unpack in the Warlords folder? I don't believe my own eyes.
     
  15. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    The .fpk files are simply bundles of art files that were shipped with the original Civ4. They are not even compressed, so I'm really not sure why Firaxis did it. Perhaps they were just concerned about the number of files they were shipping? :hmm:

    Warlords still uses the main bulk of the original files, and adds some art of its own. There are way fewer art files for these add-ons. Firaxis clearly didn't bother making them into .fpk files. Maybe they realised it wasn't buying them anything.
     
  16. Flintlock1415

    Flintlock1415 Chieftain

    Joined:
    Feb 24, 2008
    Messages:
    1,057
    Location:
    MN
    According to a number of modders at the C&C forum, paking files makes the game load/run faster, so people w/ a lot of art in their mods like to do it.
     
  17. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    The only difference for the Civ4 software between having those files separate, or having them bundled is that it would probably have to maintain a lot more separate file handles in memory. Windows used to be notorious for running out of "resources" (aka file handles) when it had to keep track of lots of files, but I very much doubt if this is true of modern versions.
     
  18. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    3,993
    Location:
    Aotearoa
    This tool has been working well for me for the .FPK files included in Civ, as well as the .FPK files in most mods. However every now and then I come across a mod's .FPK that looks like it is unpacking but when I look at the resulting files they all have a size of 0 kB.

    The following appears in Console:

    Code:
    22/01/10 1:53:52 PM	[0x0-0x197197].uk.org.alanhart.Macapaka[5467]	*** error: can't allocate region
    22/01/10 1:53:52 PM	[0x0-0x197197].uk.org.alanhart.Macapaka[5467]	*** set a breakpoint in malloc_error_break to debug
    22/01/10 1:54:54 PM	[0x0-0x197197].uk.org.alanhart.Macapaka[5467]	Macapaka(5467,0xa08ec500) malloc: *** mmap(size=1388572672) failed (error code=12)
    22/01/10 1:54:54 PM	[0x0-0x197197].uk.org.alanhart.Macapaka[5467]	*** error: can't allocate region
    22/01/10 1:54:54 PM	[0x0-0x197197].uk.org.alanhart.Macapaka[5467]	*** set a breakpoint in malloc_error_break to debug
    22/01/10 1:54:54 PM	Macapaka[5467]	Macapaka(5467,0xa08ec500) malloc: *** mmap(size=1388572672) failed (error code=12)
    *** error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    This particular .FPK is 1.39GB in size. I'm guessing this means there's not enough memory to unpack it? Unfortunately this happens regardless of trying to extract single files/folders or the entire thing.

    Any way to get around this? I can't buy more memory as my MBP already has its maximum of 3GB and this happens even after a fresh restart of my system with no other applications running. On 10.6.3 if that matters, Intel MBP.
     
  19. AlanH

    AlanH Mac addict, php monkey Moderator Hall of Fame Staff Supporter GOTM Staff

    Joined:
    Jan 9, 2003
    Messages:
    29,102
    Gender:
    Male
    Location:
    England
    If you can provide a link to the .fpk file I'll take a look at it. I'm surprised it's trying to allocate 1.3 GBytes. Cocoa's API is supposed to use virtual mapping to read the file, and my code only reads the file data in small chunks. However ...
     
  20. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    3,993
    Location:
    Aotearoa
    Thanks. I've PMed the link to you as it's not a public playtest.
     

Share This Page