Forum

Question about QuakeWorld

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Question about QuakeWorld

Postby Downsider » Fri Aug 28, 2009 4:56 pm

How is movement handled in QW?

Is it entirely clientside, then positional packets sent to the server?

Is movement logic done on both client and serverside, and it simply sends key inputs?

Is there a way to replicate it using CSQC, rather than a total rewrite of the network code?
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Spike » Sat Aug 29, 2009 11:35 am

movement is calculated both clientside and server side.
clientside is just a prediction with the unacknowledged movement frames applied to the last-received server state.
the actual predicition for the standard player physics is exposed via a builtin named 'runstandardplayerphysics', which... runs the engine's standard player physics. For a QW engine, this is QW physics.

For an example of running prediction within csqc, consult FTE's csqctest mod, in fte's trunk/quakec/csqctest subdirectory on the svn.
prediction.qc is the file that updates the current origin, while player.qc is responsible for getting the current player origin from the server and animating the player locally (the way player.qc is set up is to faciliate local animations (read: q3 player model replacements or potentially skeletal animation blends)).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Downsider » Sun Aug 30, 2009 3:46 pm

Now, as far as I know, and correct me if I'm wrong, the Source engine uses methods similar to this?

Now, why can a player download and use a speedhack if this is the case? Wouldn't only his clientside prediction show up further ahead, and one it gets the corresponding packets from the server, it would be shot back to where he should be?

Also, is it possible to communicate client -> server variables with CSQC?
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Spike » Sun Aug 30, 2009 5:43 pm

the movement frames contain a duration. if you change that duration, you can tell the server that 500 seconds passed within a single second.
The server needs to protect against that a bit, although with major packetloss, its possible to get false positives.

and... stuffcmds. :s

localcmd("cmd blah\n");
:(

there's a sendevent builtin too
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Downsider » Sun Aug 30, 2009 7:11 pm

Thanks for the info ;)

Cleared up a lot of confusion for me. Would you call using CSQC for movement prediction a viable route, anyway? I don't feel like porting QuakeWorld kthxbai.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest