Overall architecture: coupling between game, cgame, etc?

Locked
vinny
Posts: 57
Joined: Sun Feb 20, 2011 12:25 pm

Overall architecture: coupling between game, cgame, etc?

Post by vinny »

I have decided to rewrite most of the code inside cgame, by slowly deactivating old code and migrating to newer code. However, i'm not completely sure about the Quake 3 architecture. Is there any other dependency between cgame and the engine, other than the vmMain and the events it receives? There seems to be some tight coupling with other parts of the system, and i'm afraid about global variables and shared global state. Or is it really completely isolate and i should just care about vmMain and drawing the current frame properly?
Ganemi
Posts: 564
Joined: Thu Apr 21, 2005 12:57 pm

Re: Overall architecture: coupling between game, cgame, etc?

Post by Ganemi »

I think this might be what you're looking for:

http://fabiensanglard.net/quake3/

The main thing in c_game and g_game is that they transmit information through playerstates and entitystates, which is why if you want to change any info in either of those datetypes you have to update msg.c for the game to run properly.

I do know that since your movement is predicted, a ton of the bg_ code is used by both sides of the game. So the server will run the pmove code with a call from the game code, and the clientside will call pretty much the exact same code between valid snapshots received from the server, just to fill the gap and create a smooth experience.

Other than movement, keeping record of which events have been triggered by entity interactions, and transmitting playerstates and entitystates, I'm not sure what else the local and server code rely upon eachother for.

Edit: Super necro, I need to check the dates on things.
Locked