Virtual machines

From Unvanquished
Jump to: navigation, search

The Daemon engine, following its inheritance from Quake 3 uses three virtual machines for server-side game logic (src/gamelogic/game), client-side game logic (src/gamelogic/cgame), and the user interface (src/gamelogic/ui). Note that even when playing alone, the server VM is still used; it is just run locally in the same executable instead of in the dedicated server game executable on another machine.

Communication between virtual machines and the engine is done with calls to "trap" functions. These functions have the "trap_" prefix:

Virtual Machine API implementation API header
Server-side gamelogic gamelogic/game/g_api.c engine/server/g_api.h
Client-side gamelogic gamelogic/cgame/cg_api.c engine/client/cg_api.h
User interface gamelogic/ui/ui_api.c engine/client/ui_api.h