Coding

What’s this?

Coding quick reference


- How to build the SDK on Linux - How to build the SDK on OSX - How to build the SDK on Windows

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.

Engine code

The engine code is available on a GPL v3 licence at [ [1] ]

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.

During development it can be handy to set si_pure to 0. This makes it possible to run the game with a modified game binary placed directly in the base directory. However, once you’ve finished making your code changes you should package the modified game binary for distribution as described in the how to articles linked at the top of this page.

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

Note: The remaining articles are missing. I don’t know if archive.org was missing them or if they were never written. - caedes

Coding Tools