(info) Most of the information here is for Warzone 3.1 and above.

Warzone Filesystem

How does the Warzone file system work?

 

PhysicsFS

When you start a game, Warzone looks in two key places to find it's data:

Warzone uses the contents of those folders to create it's virtual file system. It does this using a library called PhysicsFS with a few custom extensions.

Understanding the virtual file system is critical if you want to mod Warzone...

What's the "right way" to mod Warzone?

To apply a mod to Warzone, even if you want to change something in the Application Folder, you should create a mod that lives in either the maps or autoload folder as shown below:

 <Config Folder> ← How do I find it?

 maps ← How do I install a Map? or How do I make a map?

 mods  mods in this folder need to be loaded using command line parameters

 autoload  mods in this folder will be loaded automatically

If your mod contains a map designed for skirmish, challenge or multiplayer games, it should go in the maps folder, even if it has other customisations (such as graphics mods, etc).

All other mods should go in the autoload folder (assuming you want them to load automatically). There are a few scenarios where this doesn't apply, but they're beyond the scope of this intro to the Warzone Filesystem.

What happens when a mod loads?

When a mod gets loaded, it changes the contents of the Warzone file system:

  • If it contains folders and/or files that don't already exist, they are added to the file system
  • If it contains folders that already exist, the existing folders are kept (so if there's a folder with files in, you can't empty that folder by putting an empty folder in your mod)
  • If it contains files that already exist, in the same folder path, the files in the mod will replace them

What order are mods applied in?

To answer this question, you need to know all the key stages of how the Warzone file system is initialised from the moment you load Warzone to the point where a game starts.

First, familiarise yourself with the contents of the Application Folder – opening it in a new browser tab or window so you can refer to it might help.

If you imagine the Warzone file system to be like a virtual hard disk, the data folder is the disk drive:

 data →  Warzone

Stage 1 - Warzone loads

When you load Warzone, it's virtual disk initially looks like this:

 Warzone ← (the data folder)

 Warzone.* (application icon)

 base.wz

 mods

 mp.wz

 music

 sequences.wz (unless you downloaded the "No video" version of Warzone)

The Warzone Zip (.wz) files listed above are just like mods, but special ones that come with the game and live in its data folder.

Before the main menu is displayed Warzone "virtually unarchives" the contents of  base.wz in to the root of the Warzone drive, which is good because things like menu backgrounds and music live in base.wz.

Now we've got something like this:

 Warzone

 Warzone.* ← file from original data folder

 gamedesc.lev

 palette.txt

 anims

 audio

 components

 effects

 features

 icons

 images

 messages

 misc

 mods ← file from original data folder

 mp.wz ← file from original data folder

 music ← file from original data folder

 script

 sequenceaudio

 sequences

 sequences.wz ← file from original data folder

 shaders

 stats

 structs

 texpages

 tileset

 wrf

If  sequences.wz is present, it virtually unarchives that in to the root of the Warzone disk as well so all the extra videos are available. Imagine it virtually clicking the "replace all" button if asked to overwrite existing files of the same name.

Next, it replaces the mods folder with the folder of the same name, if found, from the Config Folder:

 <Config Folder>/mods →  Warzone/mods

If you've got mods that require manual activation (they live in the mods folder, not mods/autoload) and have used command line options to activate some of them, those will be virtually unarchived, in the order specified by the command line options, to the root of the Warzone disk, again with a virtual click of the "replace all" button.

Warzone then goes through all the .wz files it finds in the mods/autoload folder and virtually unarchives them, to the root of the Warzone disk, with a virtual click of the "replace all" button as usual.

For example, if you've got a "foo.wz" mod that looks like this:

 <Config Folder>

 mods

 autoload

 foo.wz ← your "foo.wz" mod, which contains...

 abc.txt

 bar

 wibble.txt

It's contents will be in the following locations on the Warzone disk:

 Warzone

 abc.txt ← file from your foo.wz mod

 gamedesc.lev ← file from base.wz

 palette.txt ← file from base.wz

 Warzone.* ← file from original data folder

 anims ← folder from base.wz

 audio ← folder from base.wz

 bar ← folder from your foo.wz mod

 wibble.txt ← file from your foo.wz mod

 components ← folder from base.wz

and so on...

Note: If you extracted foo.wz to a folder called "foo" and put that "foo" folder in to <config folder>/mods/autoload, it would have exactly the same effect – as if the contents of the "foo" folder were just copied (with "replace all") to the root of the Warzone disk.

(warning) It's not clear what order mods in the mods/autoload folder are applied in – it could be alphanumerical filename order, creation date order or something else. If you know, please leave a comment or edit this page.

Stage 2 – Starting a game

When starting a game, some additional mods may be loaded as follows...

Campaign games

If you play a campaign mission, no further mods are loaded unless you specified some obscure command line option that loads a campaign-only mod (I'm not sure if this is still supported in recent versions of Warzone).

Fastplay and Tutorial games

From what I can tell, these work in a similar way to campaign games.

Skirmish, Challenge and Multiplayer games

If you play a skirmish, challange or multiplayer game, the contents of  mp.wz are virtually unarchived to the root of the Warzone disk, with the usual "replace all" thing. After the game, that action is undone (so there's no multiplayer stuff lurking around if you then decide to play a campaign mission).

When you select a map to play during the skirmish, challenge (the map is chosen for you in the .ini file) or multiplayer game, the .map file (which is a .wz file renamed to .map) is virtually unarchived to the root of the Warzone disk, with "replace all" effect as usual. After the game, the action is undone. This means that the map you play can install additional customisations, including custom AIs, tilesets, etc., that will only exist when you play that map.

This article is designed for ease of understanding from a mod developer perspective, not technical accuracy from a C++ source code "what actually happens" perspective.

Contents

Jump to:

Icon Key

The icons shown have the following meanings:

Application folder

Config folder

Warzone Zips (.wz)

Normal folder

Configuration data

Javascript file

Image or icon

Music or audio

Video file