Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
How does the Warzone file system work? |
PhysicsFS
When you start a game, Warzone looks in two key places to find it's data:
- Image Added Application Folder – the core application, data and videos
- Image Added Config Folder – log files, add-ons (mods, maps, etc), saved games and game settings
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:
Image Added <Config Folder> ← How do I find it?
Image Added maps ← How do I install a Map? or How do I make a map?
Image Added mods ← mods in this folder need to be loaded using command line parameters
Image Added 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
info to follow
Child pages (Children Display) |
---|
class | box |
---|
Icon Key
The icons shown have the following meanings:
Image Removed Application folder
Image Removed Config folder
Image Removed Warzone zip
Image Removed Normal folder
Image Removed Configuration data
Image Removed Javascript file
Image Removed Image or icon
Image Removed Music or audio
Image Removed Video filea 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:
Image Added data → Image Added Warzone
Stage 1 - Warzone loads
When you load Warzone, it's virtual disk initially looks like this:
Image Added Warzone ← (the data folder)
Image Added Warzone.* (application icon)
Image Added base.wz
Image Added mods
Image Added mp.wz
Image Added music
Image Added 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 Image Added 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:
Image Added Warzone
Image Added Warzone.* ← file from original data folder
Image Added gamedesc.lev
Image Added palette.txt
Image Added anims
Image Added audio
Image Added components
Image Added effects
Image Added features
Image Added icons
Image Added images
Image Added messages
Image Added misc
Image Added mods ← file from original data folder
Image Added mp.wz ← file from original data folder
Image Added music ← file from original data folder
Image Added script
Image Added sequenceaudio
Image Added sequences
Image Added sequences.wz ← file from original data folder
Image Added shaders
Image Added stats
Image Added structs
Image Added texpages
Image Added tileset
Image Added wrf
If Image Added 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:
Image Added <Config Folder>/mods → Image Added 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.
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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.
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 Image Added 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.
Div | ||
---|---|---|
| ||
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. |
Div | ||
---|---|---|
| ||
ContentsJump to:
|
Include Page | ||||
---|---|---|---|---|
|