Translations of this page:

This is an old revision of the document!
—-

11. Packages and packaging system

We've already briefly experience packages at work when we tried to compile packages in the Project Manager (key F7) (id you haven't tried it yet, do it NOW!) Back then everything our game produced was a folder with 3 files - data.dcp, game.exe, and settings.exe. While both exe files are from wme engine itself, data.dcp is the actual game.

We've already touched a subject of referrencing files for our game without the data so instead of data\scenes\Circle\Circle.scene we've simply written scenes\Circle\Circle.scene. This is because WME looks into contents of ALL packages as if they were copied into one big virtual directory. Well it's not exactly that, because you can set priority to packages too, but let's start from the begining.

The best would be to start with an example. In the top level structure create a new folder and name it audio. So just for a record it will be right next to the data folder and wpr file. Then MOVE folders music and sounds into the audio folder.

The next step in the process is "Promoting" our folder to package. For this step you might need right clicking the folder tree in the project manager and choose Refresh.

Right Click folder audio and choose Promote to package.

And suddenly our folder icon changed to a package icon. From now on this package will be compiled in the target build and contents of this folder will be used when you debug your game. So now your game will again have audio! Reverse process to promote to package is Degrade to folder, which you can't done on the main package.

Ok, and why all the fuss with packages?

There are 4 great uses:

  1. Order. By splitting your files into packages it's much easier to orientate where is what.
  2. Distribution. Code package is usually much smaller then gfx or voiceovers / sounds / music / video. If split separately you don't need to send all the time around the huge ammount of data.
  3. Localization. By changing language specific contents you can very fast localize the game into any language overwriting only the necessary contents.
  4. Patches. Excellent support for bug correcting. You send around only changed files and not huge packages.

We know that the first two are easily done by simply splitting the contents into more folders, but how does one go with creating patches? The "virtual directory" would just take the first of files referrenced by name (thus we must keep our filenames unique! data\hello.ogg and audio\hello.ogg would result into game bug!)

For that we have a special part of the Project Manager I briefly wrote in the first chapter with a link to Package chapter. So here we go!

The priority is a number and higher number you issue, the bigger priority will be set. Let's test it in action. Create in the top level structure a folder called patch. Promote it to package and set its priority to 1. Then create inside this folder structure: scenes\Street\scr\ and copy inside the scene_init.script from the Street folder.


 
wmebook/ch11.1197316454.txt.gz · Last modified: 2007/12/10 20:54 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki