Virtual machines

From Unvanquished
Jump to: navigation, search

The Dæmon engine, following its inheritance from Quake 3 is using two virtual machines for server-side game logic (src/gamelogic/game) and client-side game logic (src/gamelogic/cgame). But unlike Quake 3, there is no ui virtual machine, the user interface is implemented in the client-side gamelogic.

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 src/cgame/cg_api.cpp src/engine/client/cg_api.h
Client-side gamelogic src/sgame/sg_api.cpp src/engine/server/sg_api.h