Game processing order
Here is an overview of the order in which operations and events are executed during an average frame of playing MTA.
Frame start
-
GTA Environment & Entity Updates - The game engine updates the surrounding environment, streaming, weather, and general world state through various update methods.
-
World Processing & Matrix Updates -
CWorld::Processis executed. This handles frame positions, matrices, and IK animations. -
onClientPreRender - Triggered immediately after
CWorld::Processfinishes.Best used for: 3D
dxDrawoperations or elements that need to strictly follow world objects. -
Camera Processing -
CCamera::Processupdates the player’s view and perspective. -
onClientRender - The primary rendering pipeline event.
Best used for: Drawing 2D DX elements, user interfaces, and custom GUI. MTA handles its internal screen drawing here.
-
Entity Pre-Render & Preparations - GTA calls
PreRendermethods for all entities to update their lighting and frame animations (e.g., vehicle components or ped bones). -
onClientPedsProcessed - Triggered after
CWorld::ProcessPedsAfterPreRender.Best used for: Updating ped bone transformations, overriding moving vehicle component positions (e.g., firela ladder), or overwriting element lighting.
-
World & FX Rendering - The engine renders the physical 3D world, geometry, and visual effects (
FX). -
onClientHUDRender - Triggered right before
Render2dStuff(the game’s HUD drawing routine).Best used for: Full-screen post-processing effects that should render underneath the radar and in-game HUD.
-
GTA HUD & Final Frame Output - GTA draws the final HUD elements and wraps up the frame.