Skip to content

File System

PRXPHET edited this page Jul 12, 2025 · 1 revision

Supported archive types

The engine supports two types of archives:

  • X-Ray Legacy (*.db, *.xdb).
  • SquashFS (*.sq).

From the features of X-Ray Legacy we can only emphasize the presence of its own encryption. You can change the values by building the engine with the trivial_encryptor_ovr.h file, so the engine will only read archives that were built with your xrCompress.

Otherwise, SquashFS will be better: better compression, faster file unpacking/packing, no archive size limit.

For packing: https://github.com/pmq20/squashfuse/files/691217/sqfs43-win32.zip

sqfs43-win32\mksquashfs.exe gamedata gamedata.sq_01 -comp lz4 -Xhc
pause

For unpacking you can use: https://github.com/mcmilk/7-Zip-zstd/releases/download/v24.09-v1.5.7-R1/7z24.09-zstd-x64.exe

Anomaly-style archives

Archives have no name restriction (gamedata.db*), and the archives themselves can be placed in a subdirectory. The directory for archives is specified in fsgame.ltx:

$app_arch_root$         = true|   false|  $fs_root$		  | game_archs\

Garbage file cleanup

Two conditional types of garbage file cleanup have been added to the engine:

  • Reference copying
  • Unused references

In reference copying all necessary files are duplicated into a separate folder. Files are copied at the moment when they are directly needed by the game, i.e. if you have loaded some texture that is used on some model, at this moment they will be duplicated.

On the plus side, we can emphasize the fact that the perfect workout will not require any more machinations: packed a separate folder in the archive and use it. On the downside, it takes up additional disk space.

To enable reference copying, you need to run the game with the -dev_reference_copy key. Also you need to add paths in fsgame.ltx:

$game_sounds_reference$	  = true|	false|	$fs_root$|		gamedata_ref\sounds\
$game_textures_reference$ = true|	false|	$fs_root$|		gamedata_ref\textures\
$game_meshes_reference$	  = true|	false|	$fs_root$|		gamedata_ref\meshes\

In unused references a text file with all possible paths to game files is created, and when any file is required by the game, the path is removed from the text file.

On the plus side, there are no requirements for free disk space, as well as the ability to additionally check what needs to be deleted or not. On the downside, you will have to delete files yourself.

To enable the mode of unused references, you need to run the game with the -dev_gamedata_unused key. After that the gamedata_unused.ltx file will appear in app_data_root.

For both modes, you will need to go through the game to the end (ideally several times) to be sure that all files are processed.

Clone this wiki locally