Easy Pak

EasyPak is a content packer for Xna. It is a fork Nick Gravelyn's EasyZip without the compression since Xna now compresses your files for you. EasyPak can reduce loading times by merging your content to minimize seek times. Loading the content requires minimal code changes.

How it works

EasyPakWriter is a MSBuild task that takes multiple files from your game's content folder and writes them to a single content.pak file. You can then create a PakContentManager at runtime which will load this .pak file. When you call PakContentManager.Load<T>(), your asset will be loaded from memory instead of from disk.

Usage


  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets. -->
  <Target Name="BeforeBuild">
  </Target>
  <UsingTask TaskName="EasyPak.PakWriter" AssemblyFile="c:\EasyPak\EasyPakWriter.dll" />
  <Target Name="AfterBuild">
    <PropertyGroup>
      <OutDir>bin\$(Platform)\$(Configuration)\Content\</OutDir>
      <ContentDir>bin\$(Platform)\$(Configuration)\Content\</ContentDir>
      <PakName>content.pak</PakName>
      <IncludeFolders></IncludeFolders>
      <ExcludeFolders></ExcludeFolders>
      <ExcludeExtensions>.xgs;.xwb;.xsb;.pak</ExcludeExtensions>
    </PropertyGroup> 
    <EasyPak.PakWriter OutDir="$(OutDir)" ContentDir="$(ContentDir)" PakName="$(PakName)" IncludeFolders="$(IncludeFolders)" ExcludeFolders="$(ExcludeFolders)" ExcludeExtensions="$(ExcludeExtensions)" />
  </Target>

Example Notes