Authors:
- Alen Ladavac, Lead Programmer, Croteam
Targeted audience:
- Croteam programmers
- licencee programmers
- public programmers
Required reading:
Required knowledge:
Explains:
- Basic information about programming classes and game executables with Serious Engine.
Required Tools
- [Win32 specific]
- VisualC++ 6.0 w/ sp3
This will be the compiler, debugger and editor, both for the game and engine executables and for the classes.
- [/Win32 specific]
- Entity Class Compiler (ecc.exe)
Ecc is used for compiling the entity class sources (.es) into .cpp files which are in turn compiled by the cpp compiler to get the final binary code. Ecc comes in a binary form with a complete distribution of engine, and should be located in the Bin\ directory of the engine dir.
- [licencee programmers only]
- Parser generator tools (flex and bison)
You do not need these unless you will recompile the engine itself, or the ecc.
- [/licencee programmers only]
Directories and Path Settings
While all the data and executables must reside in the engine directory, sources have their independent directory tree. They all reside in a directory that we will refer to as 'sources directory', or sources dir. The sources dir is always separate from the engine dir (e.g. D:\Work\Sources\ being my sources dir, while D:\Work\SeriousSam\ is my engine dir).
In the sources dir, each project has its own subdirectory, named by that project. The sources are compiled there as usual, while the last stage in project building must always include copying the final binaries to the Bin\ (or Bin\Debug\) directory in the engine dir.
To enable access to the sources and binaries from the makefiles, you must have the following environment variables and settings set up:
[Win32 specific]
You should set the ENGINE_DIR in your global environment (using autoexec.bat on Win9x, or SystemProperties control panel under WinNT) and adjust the rest in the 'Directories' tab under Tools/Options in VisualC++.
[/Win32 specific]
1) ENGINE_DIR env var must point to the engine directory (e.g. 'D:\Work\SeriousSam'). Do not put the trailing backslash here.
2) Include file path must be set to include both the engine dir and the sources dir. (e.g. D:\Work\Sources; D:\Work\SeriousSam). The sources dir must be here, because all the includes are specified relatively to the sources dir, and the engine dir must be here because automatically generated header files for models are put in the same directory where the models are.
3) Library file path must include Bin\ and Bin\Debug\ subdirectories of the engine dir (e.g. D:\Work\SeriousSam\Bin; D:\Work\SeriousSam\Bin\Debug). Link libraries for the engine and game dlls are put there.
4) Executable file path must include Bin\ subdirectory of the engine dir (e.g. D:\Work\SeriousSam\Bin). This is because the build requires access to the Entity Class Compiler (ecc.exe) which is located there.
[licencee programmers only]
Also, if you will rebuild the engine binaries itself, you must add one more directory to the executable path: the directory where you have installed parser generator tools - Flex and Bison.
[/licencee programmers only]
Project Hierarchy
(only those parts relevant for changing are described, this excludes the editors for now)
- Ecc builds the Entity Class Compiler executable. It is the base project and does not depend on anything.
- Engine is the dll containing most of the engine's code, including base support, graphics, sound, input, rendering, networking, built-in classes etc. But it does not contain any GUI elements. It depends on Ecc because some built-in classes are compiled using Ecc.
- Entities dll is a package containing all the classes used in Serious Sam. Classes can be separated across many different dlls, and any custom classes will most certainly be in some separate dlls. Depends on Engine and on Ecc.
- Game dll contains code of the game that is run both from SeriousSam.exe and from the WorldEditor. This enables embedded game testing. Game takes care of all the game management including: starting a game, managing network connecting, loading, saving, managing game controls, game-specific rendering options etc. Buit it does not contain any GUI elements. It is just a small dll, since it relies heavily on Engine for carrying out these tasks. Game dll only calls specific functions from the Engine. Depends on Engine and on Entities.
- SeriousSam builds the main game executables whose main task is to load the Game dll, open a window any provide menu management. It relays all of the game management to the Game dll, Engine dll and entities. Depends on Engine, Game and Entitites.
- EngineGUI is a dll containing those parts of the engine that rely on the Windows GUI. This is available only under Win32, and is used only by the editors. Depends on Engine.
- GameGUI is a dll containing the part of game with a few customizable dialogs that WorldEditor. This is available only under Win32, and is used only by the editors. Depends on Engine and on Game.