Content Management before 0.7.0

From Ultronomicon
Revision as of 19:15, 21 May 2005 by 24.245.6.189 (talk) (tweak)
Jump to navigation Jump to search
Note: the information contained in this page pertains to the 0.3 and 0.4 versions of The Ur-Quan Masters. The content system will be revised in the future.



Introduction

The game uses a virtual file system to access the content. Directories from various locations are combined ("mounted") to form one big file system, where files from a mounted directory are hidden if files with the same name exist on a directory mounted "on top" of it. A directory to be mounted may exist as an actual directory on the operating system's file system, or as a directory within a .zip file.

If a file exists in a directory which is mounted read-only, but not in a directory mounted read-write on top of it, then writing to the file will produce a copy in the latter directory.


Content directories

The following list shows which directories are mounted in the game. The later mentioned ones are mounted on top of the earlier mentioned ones.

DirectoryMounted onflags
default packages, in alphabetic order/read-only
add-on packages, in alphabetic order/read-only
content base directory/read-only
user data directory/read-write
temporary directory/tmpread-write

You can see from this table that unzipped files always override zipped files. This means that using add-on packages to override a zipped base content won't work. This is one of the issues that will be addressed in a next release.


Detailed description

Content base directory

This is the base directory where the content files are stored. It needs to contain a file named version with the UQM version number to be accepted by the game. In it, you'll usually find a directory packages, which contains the default packages, and indirectly the add-on packages (optionally). The add-on packages are kept in a directory addons within the packages directory.

On Windows Systems the content base directory is located in the installation root directory, which can be specified by the user at installation time. Using the installation default C:\Program Files\The Ur-Quan Masters\, that would place the content directory in C:\Program Files\The Ur-Quan Masters\content\. The game tries the directory where it is started and the directory "content" within that dir as the content base directory.

On Unix systems, the content directory may vary per packager. If you're building from source, you can specify the installation directory yourself. Per default, the content is stored in lib/uqm/content/ in the specified installation prefix, which is /usr/local/ per default. A wrapper script supplies the content dir location to the game.

To override the default content directory, pass something like --content-dir /path/to/content to the game.


Default packages

Default packages are .zip files located in the directory packages/ in the content directory. They are mounted automatically, in alphabetic order, with the later ones overriding the earlier ones.


Add-on packages

Add-on packages are .zip files located in subdirectories of packages/addons/ in the content directory. If the --addon argument is passed to the game, the game will use the succeeding argument as the name of a subdirectory in packages/addons/ from which additional packages will be loaded. The game will mount all the .zip files in such a directory in alphabetic order, with the later ones overriding the earlier ones. The --addon argument can be supplied multiple times to include multiple add-on directories. They will be mounted in the order they are supplied, with the later ones overriding the earlier ones.

Files in add-on packages will override files from the default packages.


User data directory

In the user data directory the user's key config, melee config, melee teams, and saved games are stored.

On Unix systems (including Darwin/MacOS X) the user data directory is ~/.uqm/.

On Windows systems, the user data directory is the directory uqm in the Application Data directory for the current user. The Application Data directory is usually in one of the following locations, and may be hidden:

Windows 95, 98, SE without separate users
C:\Windows\Application Data\
Windows 95/98/SE with separate users
C:\Windows\Profiles\YourName\Application Data\
Windows NT/2k/XP
C:\Documents and Settings\YourName\Application Data\


Temporary directory

A temporary directory is used to store some data during the game. This was necessary in older versions of Star-Control, but on modern systems the memory involved is not worth it. It will be removed in a future version.

The temporary directory for the game is a directory created in the operating system's default temporary directory. If an environment variable TMP or TEMP is set, that will be where the temporary directory for the game will be created, otherwise a directory /tmp/ will be used if that exist. If that directory doesn't exist either, a directory is created in the current working directory.


A typical layout

On Windows

A typical The Ur-Quan Masters installation on Windows looks like this:

C:\Program Files\The Ur-Quan Masters\uqm.exe
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.3-content.zip
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.3-3domusic.zip
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.3-voice.zip
C:\Program Files\The Ur-Quan Masters\content\packages\addons\remix\uqm-remix-pack1.zip
C:\Program Files\The Ur-Quan Masters\content\packages\addons\remix\uqm-remix-pack2.zip
C:\Program Files\The Ur-Quan Masters\content\packages\addons\remix\uqm-remix-pack3.zip
C:\Program Files\The Ur-Quan Masters\content\version


On Linux

A typical The Ur-Quan Masters installation on Linux looks like this:

/usr/local/bin/uqm        (wrapper script)
/usr/local/lib/uqm/uqm    (the actual executable)
/usr/local/share/uqm/content/packages/uqm-0.3-content.zip
/usr/local/share/uqm/content/packages/uqm-0.3-3domusic.zip
/usr/local/share/uqm/content/packages/uqm-0.3-voice.zip
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack1.zip
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack2.zip
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack3.zip
/usr/local/share/uqm/content/version