View Full Version : Mac Extractor for Assets .fpk files
AlanH Apr 30, 2008, 08:34 PM I have put together a Mac OS X extraction utility for the Assets archives installed with Civ4.
Macapaka may be of interest to mod makers who don't have access to a Windows system to run the PakBuild utility provided by Firaxis. It only does file extraction, and will not rebuild .fpk files, but that should be enough to allow modders to get at the original Art content installed in Civ4.
Download version 1.2.1 here (http://gotm.civfanatics.net/civ4games/Macapaka%201.2.1.dmg), and please let me know if it works for you. There's a help file in the disk image, and that is also the built-in Help information, but it should be pretty straightforward to use.
Version 1.3.5 with added Packing capability is linked BELOW. The built-in Help file gives extra information on how to use the new feature.
Version 2.0.0 handles Civ5 .fpk files and is linked BELOW.
[UPDATED: May 2, 2008] Version 1.1.0 released at the above link. Now compatible with Tiger, and tested on PowerPC G4.
[UPDATED: Aug 11, 2008] Version 1.1.1 released at the above link to fix a byte order bug on PowerPC Macs.
[UPDATED: Jan 23, 2010] Version 1.2.1 released at the above link to handle very large .fpk files.
[UPDATED: May 31, 2010] Version 1.3.1 released. Experimental version with added FPK file creation.
[UPDATED: June 15, 2010] Version 1.3.5 released here (http://gotm.civfanatics.net/civ4games/Macapaka.1.3.5.dmg). Bugs fixed, performance improved
[UPDATED: November 26, 2010] Version 2.0.0 released here (http://gotm.civfanatics.net/civ4games/Macapaka.2.0.0.dmg). Civ5 .fpk formal supported.
Welnic May 02, 2008, 12:27 PM I tried this on a dual G5 tower and it seemed to work fine.
AlanH May 02, 2008, 12:42 PM Thx for the feedback. Was it any use to you?
Note that it will probably not run in Panther or earlier versions of OS X, as there are some items in the user interface that were not introduced until Tiger. If this is a problem for anyone. please let me know.
dojoboy May 02, 2008, 03:58 PM Very cool Alan. I will extract some files tomorrow. :D
kkmo May 29, 2008, 01:14 AM Alan, just noticed this. This is amazing. Easy to use and works perfectly for me, even on my MacBook. :D Thanks very much.
Flintlock1415 Jun 01, 2008, 05:22 PM The link isn't working for me! Why??????
AlanH Jun 01, 2008, 05:49 PM Because the file server is down.
Flintlock1415 Jul 26, 2008, 08:44 PM I think somehow I corrupted my art assets files in an earlier attempt to unpak them.
Could anyone post a copy of their files so that I could use them?
AlanH Jul 27, 2008, 06:11 AM They should be on your DVD.
Flintlock1415 Jul 27, 2008, 11:20 AM I tried redownloading my game files, but the art files still wont show up in the application.
AlanH Jul 27, 2008, 12:12 PM On the DVD there's a folder called Civilization IV. That's the one you copy to your hard drive when you install Civ4. Inside that folder is a folder called Assets. Inside Assets are four files called:
Assets0.fpk
Assets1.fpk
Assets2.fpk
Assets3.fpk
Here is a screenshot of my DVD contents ...
Flintlock1415 Jul 27, 2008, 05:29 PM I see the files, but when I go to macapaka and select to open the asset0.fpk file, nothing happens.
AlanH Jul 27, 2008, 06:31 PM You should see a window with 'Art' in it, with a disclosure triangle to the left. Click the triangle to display the contents of the Art folder. If you don't see the window then there must be some incompatibility. What version of Mac OS are you running, and what Mac hardware?
Flintlock1415 Jul 28, 2008, 09:04 AM okay, I found it. thanks for all the help
AlanH Jul 28, 2008, 09:21 AM Glad to hear you are OK. What should I do to make the Readme clearer?
Flintlock1415 Jul 29, 2008, 07:58 AM tell people to check the art folder
AlanH Jul 29, 2008, 12:39 PM Erm! The following is Paragraph 3 of the "Running Macapaka" section of the Readme/Help info:
When you open a file it is displayed in its own window as an expandable listing. Initially you will just see the top level Art folder. Click the disclosure triangle next to Art to view its subfolders. Expand subfolders to see their contents and so on.
I'm not sure how I can make that any clearer.
Flintlock1415 Aug 09, 2008, 11:36 PM I feel so stupid...
After deciding to try adding a new unit I looked at the files in the art folder and there seems to be numerous missing files. I did, well attempted, to unpak all of the art asset files.
Maybe there is some incompatability issues as I am running An intel imac on running tiger.
AlanH Aug 10, 2008, 05:49 AM What do you mean by "attempted to unpak"? Did the extractor fail?
Which assets files do you think are missing? The assetsX.fpk files only contain a basic set of art assets. There are some extra units in Civ4/Assets/Art/Units/ and Civ4/Warlords/Assets/Art/Units/.
Flintlock1415 Aug 10, 2008, 10:48 AM It must have because there are only some of the art files under the civ4 Art folder and the warlords art folder.
AlanH Aug 10, 2008, 11:16 AM 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?
Flintlock1415 Aug 10, 2008, 03:06 PM 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.
AlanH Aug 10, 2008, 05:40 PM You clearly haven't read the Readme/Help that's included in Macapaka!
Here is the part about Running Macapaka:
Double click Macapaka to launch it.
Use the File - Open menu to open an AssetsX.fpk file.
When you open a file it is displayed in its own window as an expandable listing. Initially you will just see the top level Art folder. Click the disclosure triangle next to Art to view its subfolders. Expand subfolders to see their contents and so on.
Select one or more files or folders that you want to extract.
If you select any folder then all its contents will also be included in the selection, so if you simply select 'Art' then the entire contents of the file are included.
You can hold the Command key down to make discontinuous multiple selections, or the shift key for multiple continuous selections.
Use the right hand button to open a file selection dialog to choose a destination folder for your extracted files. You only need to do this once if you always use the same destination folder, as Macapaka remembers your choice.
When you have chosen a destination and selected some files to extract, the Extract selection button will be enabled. Click it to extract the files.
The selected files will be copied into the destination folder, in a folder hierarchy that matches the one displayed in the window. Macapaka will create any new folders that are required.
I have emphasised the part that explains how to extract the files. Please let me know whether this answers your question.
Flintlock1415 Aug 10, 2008, 08:37 PM 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.
AlanH Aug 11, 2008, 02:34 AM I see the files, but when I go to macapaka and select to open the asset0.fpk file, nothing happens.
You should see a window with 'Art' in it, with a disclosure triangle to the left. Click the triangle to display the contents of the Art folder. If you don't see the window then there must be some incompatibility. What version of Mac OS are you running, and what Mac hardware?
okay, I found it. thanks for all the help
I thought the above posts meant you were able to see the Art folder :confused:
Maybe there is some incompatability issues as I am running An intel imac on running tiger.
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?
Flintlock1415 Aug 11, 2008, 08:18 AM Macapaka version 1.1.0
produced and tested by Alan Hart
The help window shows up as it should
AlanH Aug 11, 2008, 09:50 AM 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
Flintlock1415 Aug 11, 2008, 10:31 AM 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?
AlanH Aug 11, 2008, 10:50 AM 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 ...
Flintlock1415 Aug 11, 2008, 02:10 PM Okay. Both of the errors are gone now.
AlanH Aug 11, 2008, 02:17 PM Okay. Both of the errors are gone now.
Great!
So can you extract the files now?
Flintlock1415 Aug 11, 2008, 03:50 PM Yes it worked perfectly :banana:
AlanH Aug 11, 2008, 04:18 PM EDIT: I tried the debug version and it worked!
What did you change?
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.
iggymnrr Mar 29, 2009, 05:09 AM Worked fine for me. Are there really no fpk's to unpack in the Warlords folder? I don't believe my own eyes.
AlanH Mar 29, 2009, 05:37 AM 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.
Flintlock1415 Mar 29, 2009, 09:22 AM 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.
AlanH Mar 29, 2009, 10:58 AM 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.
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.
Xyth Jan 21, 2010, 07:00 PM 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:
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.
AlanH Jan 21, 2010, 07:46 PM 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 ...
Xyth Jan 21, 2010, 08:19 PM 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 ...
Thanks. I've PMed the link to you as it's not a public playtest.
AlanH Jan 22, 2010, 06:23 PM Please give version 1.2.1 (http://gotm.civfanatics.net/civ4games/Macapaka%201.2.1.dmg) a try.
Xyth Jan 22, 2010, 08:05 PM It worked! You're a legend Alan, thanks.
Xyth Apr 06, 2010, 06:35 PM Looks like I was wrong about the effect of FPKs on loading time. I've been doing some testing on a mod similar to mine, trying launching it with FPKs and without and it looks like there is quite a massive difference:
- With units not packed (574.4MB), time for loading splash to appear was 3 mins 28 secs.
- With units packed (537.5MB), time for loading splash to appear was 7 secs.
Is it possible to give Macapaka packing functionality as well?
AlanH Apr 07, 2010, 03:15 AM OK, I'll have another look at it, but it won't be until May earliest, as we have a UK General Election in progress here, and I'm heavily involved in getting a great MP re-elected!
Xyth Apr 07, 2010, 03:44 AM OK, I'll have another look at it, but it won't be until May earliest, as we have a UK General Election in progress here, and I'm heavily involved in getting a great MP re-elected!
No hurry, good luck with the election!
Xyth May 18, 2010, 07:19 PM Hope your MP got back in Alan (unless you support the BNP or something lol). Welcome to the fun world of coalition governments, we're pretty used to them down here.
Any chance you could have a look at adding packing functionality to Macapaka sometime in the next couple weeks? I got hold of an old PC laptop that I'm going to try use to to pack the next version of HR, but thought I'd check in with you here to see if I need to or not :)
AlanH May 19, 2010, 03:45 AM Yes, thanks. Our LibDem got back in by a whisker.
I'll have another look at it over the next week or so. I seem to recall I had a partially working setup, but was hung up on a couple of issues:
(a) There are two unknown values per file in the .fpk file format. I am not sure whether I can get away with putting dummy values in these locations. If I need to give them "correct" values, this will be a problem unless I can persuade someone at Firaxis to tell me how to calculate them. I need to create a set of files containing dummy values and see if it can be read by Civ4 and/or pakbuild.
(b) User interface. I'm not very impressed with the pakbuild Windows UI, it seems rather clunky and not very intuitive. Do you need a full .fpk file editor where you can add and remove assets files individually, or is a simple "Pack this folder to create a set of .fpk files" interface all that's required?
Xyth May 19, 2010, 04:38 AM Yes, thanks. Our LibDem got back in by a whisker.
Good to hear. LibDems seem like a good bunch, hopefully they can get some form of PR happening for Britain. Best thing that ever happened in NZ politics.
(b) User interface. I'm not very impressed with the pakbuild Windows UI, it seems rather clunky and not very intuitive. Do you need a full .fpk file editor where you can add and remove assets files individually, or is a simple "Pack this folder to create a set of .fpk files" interface all that's required?
I haven't tried pakbuild before but I've been setting my mod up so that I can hopefully pack each type of art into a separate FPK. Assets/Art/Leaderheads -> Leaderheads.fpk, Assets/Art/Units -> Units.fpk, etc. So a fairly simple "pack this folder and all subfolders and contents into a single FPK" would be fine.
AlanH May 31, 2010, 06:01 PM Please give Macapaka version 1.3.1 a try - link in the first post. I've added a File menu option - "New FPK File..." that lets you select a folder full of files. You can then select any subset of that folder as content to be Packed into a FPK file.
I have tested it by unpacking the Assets0.fpk file, then Packing the resulting files. I then used the new file to replace the standard Assets0.fpk file, and I was able to start up Civ4 with the new file. PakBuild unpacks the new file OK as well. However, the acid test is whether it will do what you need to build mods.
Please let me know whether it works for you.
Xyth May 31, 2010, 08:52 PM Please give Macapaka version 1.3.1 a try. I've added a File menu option - "New FPK File..." that lets you select a folder full of files. You can then select any subset of that folder as content to be Packed into a FPK file.
I have tested it by unpacking the Assets0.fpk file, then Packing the resulting files. I then used the new file to replace the standard Assets0.fpk file, and I was able to start up Civ4 with the new file. PakBuild unpacks the new file OK as well. However, the acid test is whether it will do what you need to build mods.
Please let me know whether it works for you.
Unfortunately I can't get it to work. The main issue seems related to subfolders. Firstly, when the window comes up that lets you choose which contents you want to include, selecting a folder in that window doesn't automatically select all the contents of that folder as well. You need to rotate the little arrow and select them all manually. I noticed the following messages in the Console while browsing in this window:
01/06/10 1:35:32 PM Macapaka[3739] *** -[NSCFArray objectAtIndex:]: index (4) beyond bounds (0)
The index number would change depending on what I was selecting. I also noticed that the file and byte count in the New FPK window would not always update properly. The count would increase if I selected a folder or file at the 'root' but the byte count would not increase appropriate to content size of any selected folder. Manually selecting a file in a folder would not increase the file or byte count.
Actually I just noticed that no matter what you select in the root directory the byte count only ever increases by exactly 6148 per item.
I then tried to make an FPK that contained no folders. This worked but the resulting FPK was too small (528 KB) compared to a folder of 26 items (3.7 MB). Trying to open this FPK in Macapaka failed with the console message:
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x200960
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x200960
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x16d000
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x16d000
Hope this helps :/
EDIT: Just tried to unpack and repack Assets0.fpk like you did. The new FPK was only 8.6 MB compared to the original 104.9 MB. What could be different on my system from yours? I'm using OSX 10.6.3.
AlanH Jun 01, 2010, 04:08 AM Unfortunately I can't get it to work. The main issue seems related to subfolders. Firstly, when the window comes up that lets you choose which contents you want to include, selecting a folder in that window doesn't automatically select all the contents of that folder as well.
You need to rotate the little arrow and select them all manually.
That is only a cosmetic problem. The subfolders are all selected, they are just not highlighted. You should not have to select the subfolders explicitly. The window behaves the same as when it is displaying the contents of a FPK file (it's running the same code).
I noticed the following messages in the Console while browsing in this window:
01/06/10 1:35:32 PM Macapaka[3739] *** -[NSCFArray objectAtIndex:]: index (4) beyond bounds (0)
The index number would change depending on what I was selecting. I also noticed that the file and byte count in the New FPK window would not always update properly. The count would increase if I selected a folder or file at the 'root' but the byte count would not increase appropriate to content size of any selected folder. Manually selecting a file in a folder would not increase the file or byte count.
Actually I just noticed that no matter what you select in the root directory the byte count only ever increases by exactly 6148 per item.
I then tried to make an FPK that contained no folders. This worked but the resulting FPK was too small (528 KB) compared to a folder of 26 items (3.7 MB). Trying to open this FPK in Macapaka failed with the console message:
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x200960
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x200960
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x16d000
01/06/10 1:51:52 PM Macapaka[3808] -[AHNode setParameters:location:param1:param2:]: unrecognized selector sent to instance 0x16d000
Hope this helps :/
EDIT: Just tried to unpack and repack Assets0.fpk like you did. The new FPK was only 8.6 MB compared to the original 104.9 MB. What could be different on my system from yours? I'm using OSX 10.6.3.
Were you running Macapaka from the disk image, or did you copy it to your hard drive? I can get it to crash and do some other strange things if I run it from the disk image, though I'm not sure why. I''ll investigate that further this evening.
Xyth Jun 01, 2010, 04:16 AM That is only a cosmetic problem. The subfolders are all selected, they are just not highlighted. You should not have to select the subfolders explicitly. The window behaves the same as when it is displaying the contents of a FPK file (it's running the same code). Were you running Macapaka from the disk image, or did you copy it to your hard drive? I can get it to crash and do some other strange things if I run it from the disk image, though I'm not sure why. I''ll investigate that further this evening.
I was running it from my hard drive. I'll keep experimenting and see if I can figure any thing else out.
AlanH Jun 01, 2010, 05:20 AM I have found one issue with subsets of files/folders. The packed file contains the wrong file count. I've fixed that, and issued version 1.3.2, linked in the first post.
Xyth Jun 01, 2010, 05:15 PM I have found one issue with subsets of files/folders. The packed file contains the wrong file count. I've fixed that, and issued version 1.3.2, linked in the first post.
I've had some success now. It looks like it will only pack properly if there is nothing else in the chosen root directory. Once I copied the folders I wanted to pack into directories with nothing else in them it started to work. Interestingly this seems to affect Pakbuild on Windows too.
One side effect I'm getting is that the presence of FPKs seems to partially break modular loading of art. I imagine this is nothing to do with Macapaka though. I have a busy day today but I'll do more experimenting tonight and see what more I can figure out, but I suspect the issues I'm still having with it are simply limitations/bugs in the original Pakbuild. I'll report back when I know.
Thanks very much for this though, having this functionality is going to make things so much easier. Copying my mod continually back and forth between my Mac and a PC really sucks.
AlanH Jun 01, 2010, 05:25 PM Thanks, that's interesting. I can't imagine how the presence of unselected files/folders in the root directory would affect the generated FPK file. And there's no fundamental reason why PakBuild and Macapaka would have similar symptoms in relation to this, as I have no idea how the PakBuild code works. I'll try some experiments with extra directories and files in the root folder.
What does "modular loading of art" look like, and how does it misbehave when it breaks?
Xyth Jun 01, 2010, 06:05 PM What does "modular loading of art" look like, and how does it misbehave when it breaks?
Well for my mod all my unique units are not working when Art/Units is packed. The button appears pink in the pedia and the game crashes when trying to view them - meaning their art can't be found. The art for these is inside the .fpk but their definitions and info xml files are modular (somewhere in Assets/Modules). Units defined in Assets/XML are fine, as are units with both art and xml entirely in Assets/Modules. I guess it needs to be all one or the other.
EDIT: Actually it looks like most packed unit art can't be found, I must have done something wrong. I'll try again tonight.
Xyth Jun 02, 2010, 05:53 AM Okay I've done a fair bit of testing now. Unfortunately most FPKs generated by Macapaka are not working at all. In all tests I packed the Art folder with pre-selected contents from a temporary directory with no other contents.
I first tried packing the entire Art folder of History Rewritten. The result was 804.9 MB compared to 798.2 MB from Pakbuild. Both could be unpacked fine by Macapaka but BTS couldn't find any of the art in the Macapaka one.
I had various tries with separate FPKs (Art/Leaderheads, Art/Units, etc). None of the ones from Macapaka worked (and all were slightly larger than their Pakbuild counterparts), but some of the ones from Pakbuild didn't work either. This implies to me that it's more an issue with how BTS loads these files than anything else. I'll do some research on this, but for now we're probably best to focus only on packing an Art folder in its entirety.
I then tried unpacking and repacking Assets0.fpk. This worked fine this time, sizes were the same and both Civ4 and BTS launched without issue.
Finally I tried unpacking and repacking some FPK from other mods (Diplomacy II, Varietas Delectat). These didn't work either. Both of those had multiple FPKs though so that may not be a fair comparison. I'll see if I can find a smaller mod with a single FPK to test tomorrow.
AlanH Jun 02, 2010, 05:51 PM I've had a look at the file/folder selection logic in Macapaka, and I think I might have resolved a couple of bugs that may have been causing problems.
Please can you have a look at version 1.3.3 and see if it is any better. I can't promise that it has solved all the issues, but I think some of them may have gone.
Apologies for subjecting you to this trial and error sequence, but I don't have any good test cases that I can use here. If there are still problems, and you have a test case I can use to investigate, please give me the details. You can email sample files to alanh <at> civfanatics <dot> net.
BTW, it's probably obvious, but I recommend that you ensure that the top level directory that you select from the "New FPK File" menu is the Assets folder or its equivalent, even if you plan to pack a file subset from lower in the folder hierarchy. This ensures that the .fpk archive records its file paths relative to the Assets folder. I don't know whether FPK files will work in Civ4 if they are created and saved at lower levels of the hierarchy.
Xyth Jun 03, 2010, 05:45 PM I've had a look at the file/folder selection logic in Macapaka, and I think I might have resolved a couple of bugs that may have been causing problems.
Please can you have a look at version 1.3.3 and see if it is any better. I can't promise that it has solved all the issues, but I think some of them may have gone.
It's my son's 1st birthday this weekend so I won't be able to do any more decent testing until next week. I'll let you know how it goes then.
Apologies for subjecting you to this trial and error sequence, but I don't have any good test cases that I can use here. If there are still problems, and you have a test case I can use to investigate, please give me the details. You can email sample files to alanh <at> civfanatics <dot> net.
No need to apologize, you are going out of your way to add this functionality for us modders and I'm hugely appreciative. The least I can do is help you test it.
If you want a test case, I just released History Rewritten 0.5. It's got 5 FPKs in it, all packed in Pakbuild, thanks to a crappy old Windows laptop I was able to borrow. Perhaps unpacking and repacking those in Macapaka could help to see what's going on?
AlanH Jun 03, 2010, 07:39 PM Thanks. Downloading History Rewritten now.
[UPDATE] OK, I see a problem with FPK created using multiple selections, and I'll investigate it. Don't bother trying version 1.3.3
AlanH Jun 04, 2010, 11:07 AM I've replaced he download link in the first post with one to version 1.3.4.
Here is my test sequence for this version:
1. I unpacked the fpk files from History Rewritten using PakBuild, and using using Macapaka.
2. I used BBEdit's Compare Folders option to look for differences between the two expanded Art folders. BBEdit said the two folders were identical.
3. I used Macapaka to pack new versions of the five fpk files. I compared their sizes in the Finder, and all but one were identical in size to the originals. Macapaka's HR_Structures.fpk was 27 bytes smaller for some reason.
4. I used Macapaka to unpack the five new fpk files it had created, and compared the new unpacked folder with the original. They were identical.
5. I replaced the five fpk files in History Rewritten with the new ones created by Macapaka, and installed the mod in my Windows BtS. It loaded and ran and I was able to start a new game.
I think this version of Macapaka works, at least to the extent verified by the above test sequence.
Xyth Jun 10, 2010, 04:25 PM Finally had some time to test this properly. Everything I tried seems to be working as it should :)
AlanH Jun 10, 2010, 05:54 PM Thanks for your feedback. I'm relieved to hear Macapaka is improving.
There are two issues that I am still working on:
1. Double counted files.
If you select a folder, and then ALSO select a subfolder or file within it, you will see the file count and size values increase. This is because the subfolder/file is double counted, both as a member of the higher level folder and in its own right. You can triple select a file by highlighting three folders in its hierarchy, and so on.
This is mainly cosmetic when you are expanding a .FPK file. Each selected file is expanded into its destination folder, so the same file may be selected, and expanded, more than once. However, each copy overwrites the previously expanded one, so you only end up with one copy.
But ... when packing a folder, any multiply-selected file will end up as multiple copies within the .FPK file. The packed file will be bigger than it needs to be, but it might also confuse software that reads it.
2. Performance
The current version of Macapaka takes a little while to open a large folder of source files, such as the complete unpacked assets file set for History Rewritten. I have optimised this process while I was fixing issue #1.
I have a new fixed version, which just needs some testing before I release it, and I'll try to do so within the next week. Meanwhile, please avoid selecting items more than once when selecting a set of files to pack.
AlanH Jun 14, 2010, 06:56 PM Version 1.3.5 uploaded. See first post.
Jarlaxe Baenre Jun 29, 2010, 02:02 PM 1.3.5 link is broken.
AlanH Jun 29, 2010, 03:24 PM 1.3.5 link is broken.
Thx ... mended.
AlanH Nov 27, 2010, 06:04 AM Version 2.0.0 now released. See first post for a download link. No feature changes for Civ4, but this one can unpack and pack Civ5 .fpk files.
Xyth Nov 27, 2010, 04:44 PM Version 2.0.0 now released. See first post for a download link. No feature changes for Civ4, but this one can unpack and pack Civ5 .fpk files.
Good work! I still haven't decided if I want to do anything with Civ5 yet and currently don't have it installed, but if I do I'll let you know if I run into any issues.
AlanH Nov 27, 2010, 04:48 PM Best of luck! I still haven't succeeded in loading a mod into Mac Civ5 yet.
Xyth Nov 27, 2010, 05:07 PM I'm pretty sure mods are completely disabled until the first patch, I seem to recall RickB mentioning something along those lines in one of his posts.
AlanH Nov 27, 2010, 05:15 PM Looks like it. I tried enabling the main menu Mods option in the .lua script, but that doesn't seem to be enough.
J450N Feb 15, 2011, 09:32 AM Hi,
I'm having a bit of an issue in the sense that nothing seems to happen when I File>Open FPK File in Macapaka 2.0.0
I have tried this on two seperate computers, and the only difference is that my MacBook gives the Error message "could not open..."
I did notice that in post #11 the thumbnail you uploaded showed that your Asset FPKs have "fpk package" as their Kind whereas mine are listed as Folders, despite the fact that they have .fpk file extensions.
What am I doing wrong?
Thanks in advance for any assistance offered.
AlanH Feb 15, 2011, 12:50 PM Hi, welcome :wavey:
Are you sure that those .fpk files are files? They look a lot like folders to me. What happens if you click the disclosure triangles next to them? A folder can have any name, and it can certainly have '.fpk' tacked on the end.
J450N Feb 15, 2011, 01:43 PM They are located in the assets folder where .fpk's should be; but the computer says they are folders, they act like folders, yet when opened there's nothing in them.
I have searched the harddrive for all files with ".fpk", and those folders are the only items found.
AlanH Feb 15, 2011, 02:37 PM Then they are dummies. How did you install the copy of Civ4 they are in? What folder path are they in?
[UPDATE] Ahah! I bet they are in ~/Documents/Civilization IV Beyond the Sword/assets/. That's not where you need to look. Try /Applications/Civilization IV/assets/.
J450N Feb 15, 2011, 04:10 PM You're right, it was in ~/Docs.
I installed Civ via Steam, and in Applications all I have is a Steam App, and nothing that even resembles CivIV/assets.
AlanH Feb 15, 2011, 04:20 PM Steam is an important piece of the puzzle. Look in ~/Library/Application Support/Steam/SteamApps/common/ You should find your Civ4 application folder in there, complete with its assets and other key resources.
That's in the Library folder in your Home folder, not the top level Library folder on the system hard drive.
J450N Feb 15, 2011, 04:24 PM *facepalm* I should have figured that myself really, but sometimes you just hit a brick wall face first.
Thanks a lot for your assistance.
AlanH Feb 15, 2011, 04:41 PM Our FAQ thread is your friend. There's a specific entry (http://forums.civfanatics.com/showthread.php?p=9846455#post9846455) explaining where the Steam apps are installed.
|
|