User Tools

Site Tools


Current version: 0.8.5
iOS: 0.8.1+
Android: 0.8.5 (Play/Market version is obsolete!)

Github Coding has become social! Fork us!


Latest commit

# ideally, but does not work on sourceforge (does elsewhere); even http proxies don't help rss> 1 author 30m sidebar for frequently accessed stuff


Overview of the GemRB Engine

GemRB is a game engine that strives to be compatible with Bioware's Infinity Engine (IE), the engine that drives Baldur's Gate, Icewind Dale and Planescape: Torment games.

GemRB stands for Game Engine Made with preRendered Backgrounds. This indeed describes the fundamental characteristics of Infinity Engine-based games: The world, or more correctly the areas where you move, be it cold empty plains of Icewind Dale, busy streets of Waterdeep or damp catacombs under Sigil, was painted and/or rendered in advance, during game development, into a series of static pictures.

The engine then transfers portions of those pictures on the screen, puts animated player and non-player avatars on top of it, and uses clever tricks to make the world appear lively and three-dimensional. But remember that deep inside it's just animated sprites over a static picture.

If you are not proficient with modding of Infinity Engine-based games, you should first read IESDP, IESDP Update Thread and about IE modding, e.g. Area Making with DLTCEP.

Note that actual engine of each of the original games differs from that of other games. That of Baldur's Gate 1 is the most primitive, PS:T is the most atypical, and Baldur's Gate 2 the one most useful for modding :-).

Simplified Infinity Engine Ancestry

GemRB has to be compatible with all of them, either by adopting superset of the features, or choosing between mutually exclusive features by means of GameType, which in turn selects appropriate Game Flags, GemRB's own override files, plugins or scripts. GameType is set in a config file or autodetected.

GemRB Sources

GemRB sources consist of:

  • Main program
  • Core library
    • Interface class
    • UI
    • Plugin manager class
    • Plugin stubs
    • Gamescript
    • Scriptables,
    • Messages,
    • Weak pointers
    • and much more
  • Plugins
    • I/O drivers
    • Resource loaders
    • Scripting language(s)
    • Effects
  • GUIScripts
  • override
  • includes
  • docs

Main program


Trivial main() function that just calls engine's Init() and Main() functions.

Core library


Core library is the main part of GemRB. It contains parts of the engine common to all the games. The goal is to make it as much universal as possible, but some AD&D rules-specific stuff is hard to get rid of.

Interface Class


The library's central hub is Interface class, which binds the various parts of the engine together, contains global initialization, main loop, utility functions etc.

PluginManager Class


This is the class responsible for loading GemRB plugins.

User Interface



Plugins in GemRB are used for:

  • I/O drivers
  • Resource loaders
  • Scripting language(s)
  • Effects
I/O Drivers

These plugins are used for graphic and audio output (SDLVideo, SDLAudio, OpenALAudio, NullSound) and input (SDLVideo again)

Resource Loaders

These plugins implement readers and writers for data files used by the engine (INIImporter, AREImporter, MVEPlayer, …) and in case of audio/video files also provide streaming (ACMReader, …)

Scripting Language(s)

GemRB's support for Python scripts is contained in GUIScript plugin. There's also a LUAScript plugin in the making. Note that GameScript, scripting language used in Infinity Engine scripts, is implemented in the Core Library instead.


These plugins implement effects used in the Infinity Engine scripts, like RetreatFrom, SetPoisonedState, Damage, … Common effects are in FXOpcodes plugin, game-specific ones are in IWDOpcodes and PSTOpcodes.



These are Python scripts implementing GemRB's user interface and game rules, which are hardwired into executable in the original games. The scripts are organized by game type. Hacking the scripts is traditionally a gentle path into GemRB development, especially if you read guiscript.



Override contains GemRB's own data files for a given game type, e.g. tables which were hardwired in the original engine. Also the all important gemrb.ini is found here.



Common include files used by Core Library and the plugins.



GemRB documentation. Really :-). Tables/ contains descriptions of GemRB's override tables, GUIScript covers API used by the Python scripts.

engine/start.txt · Last modified: 2017/09/14 15:56 by lynxlynxlynx