Documentation GOTHIC
Gothic Mods: How to create, install and start
Author: Bert Speckels Version: July 26th 2001
Inhalt: back to index

How can I modify Gothic?

Most of the Gothic files are saved in the VDF volumes in the /data/ directory. Exceptions are the script files and (for technical reasons) videos and music data.

The actual data directory of Gothic is /_work/data/ (from now on just referred to as [GDATA]); not to be confused with /data/, in which the VDF volumes are placed. VDF volumes contain the complete directory structure in "[GDATA]/" ... thus they are virtual images of these directories.

The programme \VDFS-Tool\GothicVDFS.exe can be used, to show or to extract the content of VDF files. To modify data stored in VDF files they first have to be extracted.

It is also possible to unpack a VDF volume to "[GDATA]/" and then to delete it. Now Gothic won't find the files via the VDF-System (VDFS) anymore, but will then look in the respective directories on the hard drive, which takes longer though.

Almost every data format of Gothic exists in compiled form. The following sections will go into these individual formats in a bit more detail. At this point it be just mentioned, that the compiled data is lying in the respective COMPILED directores.

Note: In the SYSTEM directory there is also a file named paths.d, in which the individual, especially important directories are listed. But the file must not be modified, otherwise it is not to be expected that Gothic keeps working.

Textures

Texture directories:

  • General: [GDATA]/textures
  • Compiled textures (*.TEX): [GDATA]/textures/_compiled

The textures of Gothic are in the TEX format. This format can be generated automatically by Gothic. The TGA format serves as the source format for it. Gothic is looking for TGAs across all sub directories, by the way. Thus, identical texture names should be avoided, even if the textures lie in different directories.

Convert textures

New textures in the TGA format will be automatically recognised and converted by Gothic. The converted textures in the TEX format end up in the COMPILED directory. When you modify already existing textures, you must use the GothicStarter.exe (Advanced-Options: convert textures) to convert.

Sounds

Sound directories:

  • General: [GDATA]/sounds

For Sounds the same as for textures applies: They are looked for across all sub directories. Here too identical file names should be avoided. The sounds are directly used as WAV files. A conversion does not occur.

Worlds/Levels

Level directories:

  • General: [GDATA]/worlds

Levels are safed as ZEN files. Here a short overview, how one comes to such ZEN files:

  1. Load a levelmesh (3DS format) in the Spacer
  2. For texturing compile in Editor-Mode (consider Indoor/Outdoor!)
    • Texturing
  3. For object placement compile without Editor-Mode (considerIndoor/Outdoor!)
    • Set Default-Zones (DefaultFogZone and DefaultMusicZone)
    • Insert objects: Trees, Items (no NPCs!)
    • Illuminate and insonate: Light and sound objects
    • Construct riddles
    • ...
  4. Compile light
  5. Save level as ZEN-file

Additional information to the level editing you find in the following docs:

  • Tutorial: Outdoor-Level

    Scripts

    Script directories:

    • General: [GDATA]/scripts
    • Compiled (*.DAT): [GDATA]/scripts/_compiled
    • Content (*.D, *.SRC): [GDATA]/scripts/content
    • System (*.D, *.SRC): [GDATA]/scripts/system

    As Content we identify all scripts, which have something to do with the game content: NPCs, Items, Quests, AI; System scripts describe Menus, effects et al.

    In the framework of our script language there are three different kinds of files:

    • D-Scripts (extension ".d") are the actual scripts, which are compiled by the Gothic-Parser. They are written in a language, that (faintly) reminds of C. There are IF-conditions, logical expressions, variables and -type, as well as funktions. Additionally a very simple Classes- and Instances concept is used. More detailed information about the script language are to be found in the respective document.
    • SRC-Lists (extension ".src") are simples lists of D- and SRC-scripts and can perhaps be compared most easily with INCLUDE-Blocks: The files listed there (Wildcards are allowed) are linked to a DAT-file by the Parser.
    • DAT-files (extension ".dat") are compiled versions of SRC-lists.

    Compile and test Scripts

    In order to transfer modified Scripts into a new updated DAT-file, Gothic must be started with the parameter -zreparse. This can be done too by the GothicStarter.exe (Advanced-Options: reparse all scripts).

    Then all scripts in the script directory will be parsed completely new and linked to updated DAT-files.

    More about the scripts and their functioning you find in the following documents:

  • The Script language (Daedalus)
  • Gothic-Scripts
  • Script-Tutorial

    How does Gothic find my files?

    The mechanism is actually quite simple:

    1. Gothic checks if the file sought-after is to be found in a VDF file
    2. If it is to be found in exactly one VDF file, then this will be used
    3. If it is available in multiple VDF files, it will be taken from the most up-to-date one (by this means patches are possible)
    4. If it is to be found in no VDF file, it will be searched for in the respective directory on the hard drive.
    5. If this fails too, there's an error message.

    This of course leads to a problem:
    A file, that is to be found in a VDF file already, will never be read from the hard drive, which naturally complicates the testing of changed files (e.g. textures).

    But step by step:

    1. New files, as e.g. a new level or textures, sounds etc. referenced therein, will not be found among the VDF-files, thus searched for on the hard drive. Excellent!
    2. Changed files by you, which are also available in the official VDFs, will be found there and the individual file on the hard drive will be ignored. Possibilities to solve the problem:
      1. Always create a VDF (the GothicMOD-VDF, see next chapter) of your own and test with it.
      2. Use the new option vdfs:physicalfirst. In the GothicStarter is an intended option for that (physicalfirst). Thereby one can force Gothic, to look on the hard drive directly first.
      3. Work with unpacked VDFs: Thus, unpacking the individual files from the VDFs to "[GDATA]/" and deleting the VDF.

    This was a short description of all things that one can change or create anew within a mod. Before you begin to make a mod of your own, please read also the extensive documentation on the script language, the ZenGin and the tutorials.

  • How do I create a Gothic Mod?

    Content of a Gothic Mod

    In this section will be explained, how modified files can be composed to a Mod, in order to hand them over to others. In doing so, I will deal less with the individual files and more with how one packs these files into a Gothic Mod.

    A Gothic Mod regularly consists of two files:

       ./system/modname.ini
       ./data/modvdf/modname.mod
    
    • Gothic Mod INI
      To every Gothic mod belongs a file modname.ini, in which diverse file names and options are defined. This file is expected to be in the SYSTEM directory. A detailed description of all entries in the INI you find in the document Gothic Mod INI
    • Gothic Mod VDF
      The actual data of a mod (sounds, textures, level, script data) will be packed into a VDF file. But this file has, other than the VDF files provided by Gothic, not the extension .VDF, but the extension .MOD and is to be saved in a different directory (/data/modvdf/). Every mod should have only one such Gothic Mod-VDF.

      For the creation of a Gothic Mod VDF you need the programme \VDFS-Tool\GothicVDFS.exe

      With this programme you must now pack all the changed or new files, which belong to your mod, into a VDF file (.mod). In doing so, you only need the compiled data, that said for the scripts the DAT-files only, not the individual scripts (.d)!

    • In the section "Exceptions" you find guidance for using musical pieces and videos of your own, which must not be packed into the Gothic Mod VDF.

    Exceptions

    Some files of Gothic are not located in the VDF files. For one these are the script files (DAT-Files), which you should absolutely pack into your Gothic Mod VDF though; and then, but for technical reasons, Videos and music files for DirectMusic (DirectX) can't be managed in a VDF File. Therefore you must include such files, if you have created some, as individual files into the mod package:

    Examplary content of modname.exe (e.g. a ZIP- or RAR-EXE):
       ./system/modname.ini
       ./data/modvdf/modname.mod
       ./_work/data/music/modname/file1.sgt
       ./_work/data/music/modname/file2.dls
       ./_work/data/videos/modname/video1.bik
       ./_work/data/videos/modname/video2.bik
    

    Again: All files for a mod belong into the Gothic Mod VDF-files with the name modname.mod. Exceptions are only music files and videos.

    Creation of a Gothic Mod EXE

    In the ideal case a Gothic Mod is a self-extracting archive:

    Content of modname.exe (a ZIP- or RAR-EXE):
       ./system/modname.ini
       ./data/modvdf/modname.mod
    

    This self-extracting EXE-file must only include relative paths (relative to the gothic directory).

    Thereby you proceed as follows:

    Create yourself a small directory structure, in which you place your finished mod files (and only them):

    For example as in the following way:
       c:/mymod/system/mymod.ini
       c:/mymod/data/modvdf/mymod.mod
    

    Now you still need to create the Archive-EXE (Attention, the default way with WinZIP/WinRAR will not do the trick!)

    That's how it's done with WinZIP:

    1. Start WinZIP
    2. Create a new archive with the file name modname.zip
    3. Make sure, that the option "Store full path info" is not activated.
    4. Navigate into (!) the directory you just created (e.g. c:/mymod/)
    5. Mark the directories system/ und data/ therein and push the ADD-Button
    6. Now the Gothic Mod VDF and the Gothic Mod INI should appear in the overview. Make sure that in the column "path" the correct paths are given (data\modfvdf\) und (system\)
    7. Generate the self-extracting file with the menu point "ACTIONS/MAKE .EXE FILE".
    8. As "Default to"-Path specify the following: "./"
    9. Done: You should test the generated EXE-file with the name modname.exe once yourself. See also the section "Installation of a Gothic Mod".

    That's how it's done with WinRAR:

    1. Start WinRAR
    2. Navigate with WinRAR into the directory you just created (c:/mymod/)
    3. Mark alle the directories contained therein (system/ und data/)
    4. Push the ADD button in the toolbar
    5. Make sure that the option "Store relative paths" is selected on the dialogue page "FILES".
    6. Give the archive a name modname.rar and select the option "Create SFX archive" (modname.rar becomes modname.exe)
    7. Confirm with OK and the EXE is finished. Don't forget to test :-) See also the section "Installation of a Gothic Mod"

    Installation of a Gothic Mod

    With such a correctly generated GothicMod-EXE it is now very easy to install the Mod.

    1. Copy the GothicMod-EXE into the Gothic Main directory
    2. Start the EXE

    All the contained files will then be copied into the correct directories.

    Play a Gothic Mod

    After a Gothic Mod was correctly installed, it can be started with the programme GothicStarter.exe. This programme shows all available Mods in a list and also offers a few additional functions. When you use Gothic Mods, you should start Gothic only with this tool. For this I also recommend the GothicStarter Documentation.