Game Development Community

Some question about the client-server model

by Nachi Lau · in Torque Game Engine · 12/08/2003 (3:16 pm) · 3 replies

Hello,

As a beginner of the Torque engine, I wish to ask some questions about the server-client model. I have traced the script files in the client side, and I found out that when the user presses a key to update the player movement, function "moveforward(%val)" will be called. I found out that this function is actually update the global variable "$mvForwardAction". I wonder what is this variable for and how come the player will perform the movement update by just update this variable? Also, I ddo not find any code in the script that send the variable to the server-side..... so I wonder how come the server know the player will perform its movement update? Can someone give me some explaination about how the whole thing work..... ? I am really appericated of it!!!

Thanks!

Nachi

#1
12/09/2003 (7:59 am)
Hey, my guess is that somewhere in the main loop, a network update is called. Usually games will send current location at ever pass and not sent the specific keypresses.

Ben
#2
12/09/2003 (8:25 am)
Nachi,

A quick grep reviles that the script global variable $mvForwardAction is defined in engine\game\gameConnectionMoves.cc within the function void MoveManager::init(). This variable is set to the C++ variable mForwardAction, which is used in the function bool GameConnection::getNextMove(Move &curMove).

Rich
#3
12/09/2003 (11:15 am)
Oh.. Thanks!

Nachi