Audiokinetic Wwise Knowledge Base

Using file packages

In order to use file packages (created with the AK File Packager or any other tool), you need to write the Low-Level I/O code to handle file packages. Basically, it needs to specify the offset of the requested file in the package with the proper AkFileDesc::uSector value.

The class CAkFilePackageLowLevelIO is provided as sample code. It extends the Default Low-Level I/O and can be used as-is with file packages created with the AK File Packager. You simply need to instantiate a CAkFilePackageLowLevelIO instead of a CAkDefaultLowLevelIO. Then, before doing anything, you need to load the file package explicitly by calling CAkFilePackageLowLevelIO::LoadFilePackage(). The Low-Level I/O will open and parse the file package's header, and build its look-up tables. It does not load the actual packaged files in memory. Then, everytime the Stream Manager calls AK::StreamMgr::IAkFileLocationResolver::Open(), the file is first searched in all packages, and if it is not found, the default implementation is called.

The order in which packages are searched in this sample corresponds to the opposite order in which they were loaded (using LoadFilePackage()). If you are implementing DLC with file packages, your game should load the "base" (default) file package first, then DLC packages. CAkFilePackageLowLevelIO::Open() will therefore search the DLC packages first. If a file exists in both a DLC package and the "base" package, it is the one in the DLC package that will be picked.

This sample implementation is briefly presented in the SDK's documentation (Reference Materials > Sample Code, in section "File Package Low-Level I/O Implementation"). There, you will find links to other relevant parts of the documentation (for e.g. the Low-Level I/O sample code walkthroughs).

The CAkFilePackageLowLevelIO and associated AK File Packager utility code can be used as a starting point to implement more complex file packaging solutions.


Article Details

Last Updated
17th o February, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Continue