Skip to content

AGS Virtual FileSystem

Érico Vieira Porto edited this page Jul 4, 2020 · 4 revisions

Both the AGS Engine and Editor can read and write to virtual files that are stored in packages (like game.ags or audio.vox). Below is detailed some of the current implementation used.

MultiFileLib

MultiFileLib is a library that is replicated in both on the Editor and on the Common library in the Engine, that enables assigning meaning to a group of bytes in a file as a stream with the following information:

  • Filename, used to identify the group of bytes;
  • Offset, the location of this stream in the biggest possible stream of the file.
  • Length, the byte size of this stream;
  • Datafile, the bytes of this stream;

MultiFileLib is used to abstract the contents of packages read by the engine file in a virtual filesystem, without needing to worry on how they are stored using the filename the same way it uses to read files stored directly in the filesystem on disk.