Coding

From modwiki

Jump to: navigation, search
Coding quick reference

All engines in the id Tech 4 family are written in C++, a high-level programming language. Coding, as it applies to id Tech 4 games, is the modification of the engine's public source code to extend upon its capabilities.

Contents

Engine code

The engine code is not currently available without licensing, however there are plans by id Software for it to be released under an open source license in the future.

Among other systems, the engine contains - the common framework, renderer, sound system, file system, network system.

The compiled engine code is referred to as the engine executable.

Game code

Game code can be downloaded as part of the respective games SDK and is released under the SDK EULA.

Among other systems, the game code contains - the main game logic, map loading, entity spawning, spawn classes, physics, networking.

The compiled game code is referred to as the game binary. People often refer to the game code and the game binary interchangeably, also using such terms as the dll, or the SDK.

The engine/game interface, or API, is described by idGame with local aspects in idGameLocal.

There is version check done by the game engine on loading the game binary in order to enforce the API which halts the game with the error "ERROR: wrong game DLL API version". Therefore each engine update or game patch is likely to 'break' compatibility of mods, necessitating the author to update the mod to the new game code.

For more details on each file and class included in the SDK, and therefore what can and cannot be done, please read The annotated API.

The SDK

This game code project in the SDK, allows modders the ability to compile a new game binary for different platforms - gamex86.dll/gamex86.so/gameppc.dylib file for windows/linux/mac respectively.

Most of the SDKs support Visual Studio .NET 2003 and 2005 "out of the box".

Where to start

So much code!

As a starting point the idGameLocal::RunFrame() function can be considered the entry point or the systems "main()".

It is the part of the game loop called by the engine at 60Hz (30Hz for ETQW). Each call referred to as a game frame.

The idGameLocal class handles main game aspects, loading map, setting up the main data structures, spawning and tracking entities.

idEntity is the base spawn class that other entities are derived from.

References

Coding tutorials

Coding Tools

Personal tools
Main
id Tech 5