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 files that are parsed have to be listed in the .src files.

Parsers

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

Parser Source file Output file
Game Parser Scripts\Content\Gothic.src Gothic.dat
SFX Parser Scripts\System\SFX.src SFX.dat
PFX Parser Scripts\System\ParticleFX.src ParticleFX.dat
VFX Parser Scripts\System\VisualFX.src VisualFX.dat
Camera Parser Scripts\System\Camera.src Camera.dat
Menu Parser Scripts\System\Menu.src Menu.dat
Music Parser Scripts\System\Music.src 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
};