Skip to content

Daedalus Compilation

Before loading the data by game the Daedalus scripts have to be parsed and compiled into a .dat file. This is done by the engine itself, but the .d files have to be listed in .src files first.

Parsers

The engine itself has multiple parser instances used for parsing different .src files.

  • Game Parser - parses Scripts\Content\Gothic.src and creates Gothic.dat
  • SFX Parser - parses Scripts\System\SFX.src and creates SFX.dat
  • PFX Parser - parses Scripts\System\ParticleFX.src and creates ParticleFX.dat
  • VFX Parser - parses Scripts\System\VisualFX.src and creates VisualFX.dat
  • Camera Parser - parses Scripts\System\Camera.src and creates Camera.dat
  • Menu Parser - parses Scripts\System\Menu.src and creates Menu.dat
  • Music Parser - parses Scripts\System\Music.src and creates Music.dat

SRC syntax

The .src files are simple text files that contain the paths to the .d files that have to be parsed. The paths are relative to the folder where the .src file is located.

Warning

Booth \ and / can be used as path separators, but in the wildcards only \ is supported.

Example file structure:

<gothic-root>/_work/Data/
└── Scripts
    ├── _compiled
    └── content
        ├── Story
        │   ├── SubStory
        │   │   ├── SubSrc.src
        │   │   ├── SubFile1.d
        │   │   ├── SubFile2.d
        │   │   └── SubFile3.d
        │   ├── Classes.d
        │   ├── Constants.d
        │   └── Main.d
        └── Gothic.src

That is how the Gothic.src file can look like:

Gothic.src
1
2
3
4
5
6
Story\Constants.d
Story\Classes.d
Story\Main.d
Story\SubStory\SubFile1.d
Story\SubStory\SubFile2.d
Story\SubStory\SubFile3.d

Multiple .d in one folder can be parsed by using wildcards.

Gothic.src
1
2
3
4
Story\Classes.d
Story\Constants.d
Story\Main.d
Story\SubStory\*.d

In addition, .src file can contain paths to other src files.

Gothic.src
1
2
3
4
Story\Classes.d
Story\Constants.d
Story\Main.d
story\SubStory\SubSrc.src
SubSrc.src
1
2
3
SubFile1.d
SubFile2.d
SubFile3.d

Code order

The order of the code and therefore files in .src is crucial, as Daedalus parser is lineal. If you refer to the symbol that wasn't parsed it would throw an error.

Something like this wouldn't work as the bar() doesn't exist at the moment of parsing foo()

1
2
3
4
5
6
7
8
func void foo()
{
    bar(); // would throw an error
};

func void bar()
{
};
The same applies to files order in .src if in one file refers to the symbol form other it has to be listed later.
Gothic.src
1
2
3
Story\Classes.d
Story\Constants.d
Story\Main.d
Classes.d
1
2
3
func void bar()
{
};
Main.d
1
2
3
4
func void foo()
{
    bar(); // correct order
};