Skip to content

Commit 3731e12

Browse files
authored
Update Engine-overview.md
1 parent 18340bf commit 3731e12

1 file changed

Lines changed: 42 additions & 26 deletions

File tree

Engine-overview.md

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Engine overview
33
toc: true
44
---
55

6-
### Overview of the GemRB Engine
6+
## Overview of the GemRB Engine
77

88
GemRB is a game engine that strives to be compatible with Bioware's
99
Infinity Engine (IE), the engine**s** that drives Baldur's Gate, Icewind Dale
@@ -34,7 +34,7 @@ means of **GameType**, which in turn selects appropriate Game Flags,
3434
GemRB's own override files, plugins and scripts. GameType is set in the
3535
main config file (usually autodetected).
3636

37-
### GemRB Sources
37+
## GemRB Sources
3838

3939
GemRB sources consist of:
4040

@@ -57,34 +57,50 @@ GemRB sources consist of:
5757
- Includes
5858
- Docs
5959

60-
#### Main program: `gemrb/GemRB.cpp`
60+
### Main program: `gemrb/GemRB.cpp`
6161

6262
Trivial main() function that just calls the engine's `Init()` and `Main()`
6363
functions.
6464

65-
#### Core library: `gemrb/core/`
65+
### Core library: `gemrb/core/`
6666

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

71-
##### Interface Class: `gemrb/core/Interface.cpp`
71+
#### Interface Class: `gemrb/core/Interface.cpp`
7272

7373
The library's central hub is `Interface` class, which binds the various
7474
parts of the engine together (including the plugins), contains global
7575
initialization, main loop, utility functions etc. It needs to lose some
7676
weight!
7777

78-
##### PluginManager Class: `gemrb/core/PluginManager.cpp`
78+
#### PluginManager Class: `gemrb/core/PluginManager.cpp`
7979

8080
This is the class responsible for loading GemRB plugins.
8181

82-
##### User Interface: `gemrb/core/GUI`
82+
#### User Interface: `gemrb/core/GUI`
8383

8484
These are classes defining window management, GUI controls (eg. buttons)
8585
and our text handling subsystem.
8686

87-
#### Plugins: `gemrb/plugins`
87+
#### Scriptable Classes: `gemrb/core/Scriptable`
88+
89+
These classes host most of the interactive objects a player sees in the world. They are all scriptable
90+
in the sense that they can have one or more `GameScript` scripts associated, which enables complex
91+
behaviour (NPCs, combat AI, traps, general scripting).
92+
93+
`Scriptable` is the (grand)parent class. There is always only one `Game`, then one or more loaded maps
94+
(`Map`) that can contain creatures (`Actor`), three types of regions (`InfoPoint`), doors (`Door`) and
95+
loot containers (`Container`).
96+
97+
##### Actor Class: `gemrb/core/Scriptable/Actor`
98+
99+
This is another big class (needing more sub-encapsulation) with most of the logic related to PCs, NPCs
100+
and other creatures. It hosts the stats, the combat calculations and links to `Inventory`,
101+
`Spellbook`, `EffectQueue`, `CharAnimations` ...
102+
103+
### Plugins: `gemrb/plugins`
88104

89105
Plugins in GemRB are used for:
90106

@@ -93,25 +109,25 @@ Plugins in GemRB are used for:
93109
- Scripting language
94110
- Effects
95111

96-
##### I/O Drivers
112+
#### I/O Drivers
97113

98-
These plugins are used for graphic and audio output (SDLVideo, SDLAudio,
99-
OpenALAudio, NullSound) and input (SDLVideo again).
114+
These plugins are used for graphic and audio output (`SDLVideo`, `SDLAudio`,
115+
`OpenALAudio`, `NullSound`) and input (`SDLVideo` again).
100116

101-
##### Resource Loaders
117+
#### Resource Loaders
102118

103119
These plugins implement readers and writers for data files used by the
104120
engine, many of which are in [custom formats](https://gibberlings3.github.io/iesdp/file_formats/index.htm)
105-
(INIImporter, AREImporter, MVEPlayer, ...) and in case of
106-
audio/video files also provide streaming (ACMReader, ...).
121+
(`INIImporter`, `AREImporter`, `MVEPlayer`, ...) and in case of
122+
audio/video files also provide streaming (`ACMReader`, ...).
107123

108-
##### Scripting Language
124+
#### Scripting Language
109125

110-
GemRB's support for Python scripts is contained in the GUIScript plugin.
126+
GemRB's support for Python scripts is contained in the `GUIScript` plugin.
111127
It is used in place of Lua, which the originals used to power the cheat
112-
console.
128+
console and the EEs used for the GUI glue.
113129

114-
Note that GameScript, scripting language used in Infinity Engine scripts
130+
Note that `GameScript`, scripting language used in Infinity Engine scripts
115131
(sometimes called IEScript), is implemented in the Core Library instead.
116132
See these explanations:
117133
- [general overview](https://www.pocketplane.net/tutorials/simscript.html)
@@ -122,22 +138,22 @@ See these explanations:
122138
[variables](https://gibberlings3.github.io/iesdp/appendices/variables.htm)
123139
- [file format](https://gibberlings3.github.io/iesdp/file_formats/ie_formats/bcs.htm) (scripts are compiled, while snippets in dialogs aren't)
124140

125-
##### Effects
141+
#### Effects
126142

127143
These plugins implement effects used in the Infinity Engine spells and
128144
scripts like *RetreatFrom*, *SetPoisonedState*, *Damage* ... Common
129-
effects are in the FXOpcodes plugin, game-while specific ones are in
130-
IWDOpcodes and PSTOpcodes.
145+
effects are in the `FXOpcodes` plugin, game-while specific ones are in
146+
`IWDOpcodes` and `PSTOpcodes`.
131147

132-
#### GUIScripts: `gemrb/GUIScripts/`
148+
### GUIScripts: `gemrb/GUIScripts/`
133149

134150
These are Python scripts implementing GemRB's user interface and many
135151
game rules, which were hardwired into the executable in the original
136152
games. The scripts are organized by game type, while the top dir contains
137153
shared files. Hacking the scripts provides a gentle path into GemRB
138154
development and you can find [specific documentation here](GUIScript/Index.md).
139155

140-
#### Overrides and unhardcoded data: `gemrb/override/`
156+
### Overrides and unhardcoded data: `gemrb/override/`
141157

142158
`gemrb/override/` and `gemrb/unhardcoded/` are two directories
143159
containing GemRB's own data files for all (`shared`) or a given game
@@ -153,17 +169,17 @@ potential conflicts with mods.
153169
See this [tabular overview](Modding.md#notes-to-modders) to better
154170
understand how they relate to the data shipped with the games.
155171

156-
#### Platforms: `platforms`
172+
### Platforms: `platforms`
157173

158174
Special files for various platforms, including custom includes for
159175
building (eg. additional cmake logic, scaffolding, polyfills),
160176
art assets and configuration files.
161177

162-
#### Includes: `gemrb/includes`
178+
### Includes: `gemrb/includes`
163179

164180
Common include files used by Core Library and the plugins.
165181

166-
#### Docs: `gemrb/docs`
182+
### Docs: `gemrb/docs`
167183

168184
Initial GemRB documentation. `Tables/` contains descriptions of
169185
GemRB's override tables ([not for long](https://github.com/gemrb/gemrb/issues/685))

0 commit comments

Comments
 (0)