VirtualFileSystem: Difference between revisions

From Spring
Jump to navigationJump to search
Jk (talk | contribs)
Hoijui (talk | contribs)
→Archive Hierarchy: make list ordered
Line 5: Line 5:


==Archive Hierarchy==
==Archive Hierarchy==
When loading a new archive (sdz, sd7, sdd) it overrides existing file references in the VFS, so the order archives are loaded is very important. So here it is:
When loading a new archive (sdz, sd7, sdd) it overrides existing file references in the VFS, so the order archives are loaded is very important. So here it is (in reverse):


* raw fs (only for unsynced data)
# raw file system (only for unsynced data)
* map
# map
** map archive itself
## map archive itself
** map dependencies
## map dependencies
** maphelper.sdz
## maphelper.sdz (engine supplied)
* game
# game
** game archive itself
## game archive itself
** game dependencies
## game dependencies
** springcontent.sdz
## springcontent.sdz (engine supplied)
*** bitmaps.sdz
### bitmaps.sdz (engine supplied)


(top most are checked first when accessing a file -> map overrides game files!)
(top most are checked first when accessing a file -> map overrides game files!)

Revision as of 13:46, 26 August 2011

Development < VirtualFileSystem

VFS

The Virtual File System is an unified layer to access the different archives used at runtime. So you can access map, game & config files via the same interface.

Archive Hierarchy

When loading a new archive (sdz, sd7, sdd) it overrides existing file references in the VFS, so the order archives are loaded is very important. So here it is (in reverse):

  1. raw file system (only for unsynced data)
  2. map
    1. map archive itself
    2. map dependencies
    3. maphelper.sdz (engine supplied)
  3. game
    1. game archive itself
    2. game dependencies
    3. springcontent.sdz (engine supplied)
      1. bitmaps.sdz (engine supplied)

(top most are checked first when accessing a file -> map overrides game files!)

Extra Informations

Spring's VFS is lowercase only. Also it is extremely recommended to use linux style path separators, e.g. "foo/bar.txt" and not "foo\bar.txt".

Engine Read Files

The engine access a few files directly, most of them are lua files which access other files themselves. Here the list of files that must exist in the VFS (some of them don't have to be in the game/map archive cause there are fallback solutions in springcontent.sdz & maphelper.sdz):