Game Development Community

Just a little question

by Wolfgang Kurz · in Torque Game Engine · 11/07/2006 (6:16 am) · 3 replies

Hello all,

on all the tutorials i have seen so far all the movement was done on the client side like:

function GoAhead(%val)
//----------------------------------------------------------------------------
// running forward
//----------------------------------------------------------------------------
{
   $mvForwardAction = %val * movement;
}

playerKeymap.Bind(keyboard, up, GoAhead);

am i missing something or shouldnt this be done on the server side on a multiclient environment?
wouldnt the client have to send a request for movement to the server here? Or is this something that torque handles itself?

please someone tell me if this is just for simplicity on the tutorials or if thats the way to go?

thx a lot

#1
11/07/2006 (6:23 am)
Torque handles this itself, as you guessed. $mvForwardAction is a global variable whose value is sent to the server 'behind the scenes', and the server does the actual movement.
#2
11/07/2006 (6:26 am)
Ok but if the client manipulates the movement value?

wouldnt he be able to go at hyperspeed compared to others?

i dont see how this could work correctly
#3
11/07/2006 (9:32 am)
I typed up a quick description about how movement controls flow through in this thread.

The client always defers to the server on object location and movement. So if you took out the limits on the client side you would end up warping back because the servers position would override the clients position with each update packet. Take a look at the pack / unpack methods on both Player and Camera to see how this is done.