Game engines [25], software product-lines [12], [16] to build computer games, are the most important tools used to build computer games. A term game engine refers to a software system designed for creation and development of computer game. They enable reuse of software code and sophisticated software components, therefore development of a new game is speeded up rabidly. Especially when developing CRPGs, new games are nearly always build on top of a game engine. Even if the game engine is developed for a certain game, it is most likely used to build several similar games later on.
Features present in game engines vary a lot. Major components of a modern game engine usually include the following:
• Rendering engine. Rendering engine is responsible for producing three- dimensional graphics. It transform data of location and appearance of game world objects into 3D virtual world.
• Physics engine and collision detection. Physics engine is responsible for behaviour of game world objects. It ensures objects cannot overlap or acts otherwise unnaturally. Ready-made collision detection also very useful feature, since game objects can have very complicated shapes.
• AI engine. AI engine controls NPCs in the game. The required func- tionality for game AI varies depending the game genre [13]. Typically in CRPG at least path finding, and combat behaviour are essential.
• Networking. Networking component is responsible for handling re-
quired network connections.
• Sound. Sound component plays sound effects of the game. It is also responsible for playing background music.
• Scripting engine. Scripting engine runs scripts used in the game. De- pending on the game, different parts of the game can be implemented using scripts, commonly they are used, for example AI and conversation dialogues.
• Support for IO, threading, and memory management. A game engine requires low-level functionality, such as support for IO, threading, and memory management. CRPGs are massive software with a lot of code lines, and it is important they do not leak memory, and file operations run smoothly.
Some game engines offer IDE, where software tools are included, and IDE works as the user interface for the game developer using the game engine, while others are used through common IDEs, for example, Microsoft’s Visual Studio [49].
In addition to the features present, the programming paradigms in game engines vary. Depending on the game engine, most of the game can be imple- mented by programming through IDE. Models and other parts are created using external tools and loaded into the game in the source code. The other possibility is that the game engine uses integrated graphics environment as the primary method of development. In this approach the game develop- ment is mostly done by modifying properties of graphical objects present in the environment. In addition, scripts are written if more complex behaviour is needed for some object. Examples of such game engines are Unity [85], Blender Game Engine [10], a component of Blender 3D content creation suite, and Torque 3D game engine [77].
Before game engines, the game code was written as a single entity, con- sisting of game logic and game data. The term game engine was introduced in mid-90’s, with first person shooters (FPSs) like Id Software’s Doom [35] and Quake [36]. Quake was also one of the first games open for user modifi- cations (mods). When used with a game upgrade called QuakeWorld, it was possible to program the game using compilable QuakeC programming lan- guage. QuakeC enables the makers of modifications to publish their creations in a single bytecode file, therefore without revealing the source code [96].
Nowadays, scripting languages are often used to make modifications for games, and those are not compiled. Scripting interface is sometimes left open on purpose to allow community made modifications for the game, al- though there are several other ways for making modifications. For example, initialization files can also be modified to change graphics or other features in the game. Existence of mods can extend the lifespan of the game signif- icantly. Famous examples of games with wide moding communities include Civilization IV [15] and The Elder Scrolls IV: Oblivion [72].
Especially AI support of game engines has been improved in recent years. Nowadays, there is an increasing tendency to have general AI routines in the game engine, which allow characters to be designed by the level editors or technical artists [51]. A term AI engine is used to refer to the part consisting the AI routines.
Publication [I] of this thesis presents a novel game engine implemented to be used in game programming education. The implemented game engine CAGE includes a C++ core and a scripting interface. The C++ part can be called through the interface using Lua scripts. In addition, CAGE includes an AI framework, which allows easily implementing NPCs using state machines. Students used CAGE as a platform in programming assignments of game programming course.
Recently some game engines have appeared that can be used for imple- menting browser-based games. These tools require different kind of features than game engines functioning in traditional environment. Today most game engines are implemented for binary environment. However, this might well change in the future. More and more browser-based games are developed
and many games that previously would have been implemented as instal- lable software are nowadays deployed onto the Web.