Client Prediction and Server Reconciliation (cpsr) in the Engine

Hey there, I’m looking to understand the inner workings of the netcode for this engine. So far I have a handle on cpsr movement and mouse look for the active client player, which is that you simply run the movement code on the client immediately and then when an authorative server update comes in we rollback to the gamestate before we predicted anything and then re-apply the input snapshots from there. I have two main questions:

How does ioquake handle projectile based things such as rockets and grenades, are they using cpsr at all or are they simply rendered when they get received from the server?

How does ioquake handle hitscan based things such as railgun, machinegun, meele?

With respect to both of my questions I’m hoping someone can tell me what source files I should start poking around in to figure this out myself (or if they understand it and are willing to explain that would be great too!)

1 Like

The Unlagged mod documentation discusses Quake 3 network prediction and interpolation.

https://web.archive.org/web/20240227034723/https://www.ra.is/unlagged/contents.html

ioquake3 itself does not contain Unlagged mod (which uses the Q3 SDK license which is not compatible with GPLv2+). Unlagged is included in Wolfenstein: Enemy Territory though (GPLv3+ with additional terms).

1 Like

Hi there, thanks for linking that article it’s got a lot of useful information.

In that case does this mean that ioquake3 doesn’t client side predict rockets? Eg, rockets are only rendered once they come back from the server?

Yeah, I don’t think it displays the projectiles until the server snapshot has it.

The OpenArena gamecode has delagged hitscan. And OpenArena’s Ratmod adds delagged projectiles and client side projectile prediction.