Skip to content

General Architecture

shartte edited this page Oct 24, 2015 · 2 revisions

There are several core layers in the architecture of ToEE, which are closely mirrored in TemplePlus.

  1. TIG (game independent infrastructure)
  2. Game Systems (a.k.a. gamelib)
  3. Game Module
  4. Map Systems

Each of these layers contains several more subsystems that are initialized / uninitialized with the layer.

The game module isn't really a system in itself, but rather represents the content of Modules\ToEE.dat, which are loaded in a separate phase during startup. During this phase, additional callbacks are called on game and map systems, which allow them to load module specific data. This mechanism isn't really used to great effect in ToEE, since there is only a single module to load and even just the main menu cannot be displayed without loading module specific content (the main menu background).

TIG

TIG encompasses the following subsystems:

  1. memory (largely unused)
  2. debug (debug output and config for it)
  3. idxtable (basic hashtables)
  4. trect (pool allocator for rectangles)
  5. color (unknown)
  6. video (setup for rendering, d3d, etc.)
  7. shader (material management, MDF files)
  8. palette (possibly unused)
  9. window (apparently mostly for viewport to game mapping)
  10. timer (game timers)
  11. dxinput (initializes DirectInput)
  12. keyboard (initialized keyboard input via DirectInput)
  13. texture (texture management)
  14. mouse (initializes mouse input via DirectInput if in fullscreen)
  15. message (a rudimentary message queue for window messages)
  16. gfx (unused as far as i can tell)
  17. strparse (Helper for parsing files)
  18. filecache (Unused)
  19. sound (initializes the sound system)
  20. movie (initializes bink video playback)
  21. wft (basic UI library)
  22. font (font rendering)
  23. console (the console window)
  24. loadscreen (generic loading screens)

Since TIG is designed as a game independent library and even resides in its own static library (according to the build log that leaked in one of the patches), each subsystem only has a load and unload function and is loaded even before the actual game data has been made available. The only data file it relies on is tig.dat.

Clone this wiki locally