Re: [hlcoders] Predicted VPhysics entity

2006-09-12 Thread Robbie Groenewoudt
--
[ Picked text/plain from multipart/alternative ]
The client and server have different times and ticks so it's quite possible
the 2 are different. Some more code would help.
Also, you should make it an networked entity so the client predicts it but
receives the right position from the server.

On 9/12/06, Maurino Berry [EMAIL PROTECTED] wrote:

 I'm attempting to simulate physics for an entity on the client as well
 as the server (a type of vehicle) Everything works fine except what
 feels like the 'drag' is different on the client/server, they're set
 to ignore gravity so they are hovering and a single boost with
 ApplyForceCenter/Offset results in different positions and I can't
 seem to figure out why, it's like the client has less air density
 almost, but I've made sure it's the same. Is the simulate rate of
 havok different between the client/server? or is there anything I
 should know about regarding this? Thanks.

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Predicted VPhysics entity

2006-09-12 Thread Maurino Berry

It is a networked entity. They use a shared CreateVPhysics method to
initialize their physics objects to be identical. If the clientside
representation of an entity has its own vphysics object it will not
get forced changes from the server (which is what we want) but I can
use GetAbsAngles/Origin to get the proper server position. The idea
was to eventually use sendproxies to write out appropriate server
physics data (inertia's etc) to correct the client vphysics object.

Within the void CGameMovement::PlayerMove( void ) method I call a
simulate method on the players controlled entity, and look at the most
recent usercmd with

#ifdef GAME_DLL
cmd = pPlayer-GetLastUserCommand();
#else
cmd = pPlayer-GetCurrentUserCommand();
#endif

and then based on keys down (like IN_FORWARD) etc I apply thrust, and
use the mouse deltas to figure angular rotation, but the point is even
with a single keypress (I'm echoing the amount of times this method is
called) the client drifts longer than the server, so repeated
keypresses of left and right end up throwing the client object way out
of sync with the servers.

On 9/12/06, Robbie Groenewoudt [EMAIL PROTECTED] wrote:

--
[ Picked text/plain from multipart/alternative ]
The client and server have different times and ticks so it's quite possible
the 2 are different. Some more code would help.
Also, you should make it an networked entity so the client predicts it but
receives the right position from the server.

On 9/12/06, Maurino Berry [EMAIL PROTECTED] wrote:

 I'm attempting to simulate physics for an entity on the client as well
 as the server (a type of vehicle) Everything works fine except what
 feels like the 'drag' is different on the client/server, they're set
 to ignore gravity so they are hovering and a single boost with
 ApplyForceCenter/Offset results in different positions and I can't
 seem to figure out why, it's like the client has less air density
 almost, but I've made sure it's the same. Is the simulate rate of
 havok different between the client/server? or is there anything I
 should know about regarding this? Thanks.

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Predicted VPhysics entity

2006-09-12 Thread Jay Stelly
You can always EnableDrag(false) on your object to isolate the air
density/drag from the motion of the object.  If doing this fails to fix
the problem, then it's not an air density issue.

Other factors that could be different:
damping, rotdamping:  Make sure these are the same on your client and
server objects (hardcode them to something constant as a test).

The other factor that is almost certainly different unless you've
changed it in your mod:

The client and server apply user input at different points relative to
physics simulation.  The server runs at a fixed framerate which is
always an integer multiple of the physics simulation rate.  This can all
be configured by your mod, but the default behavior is that ticks are
15ms for both server logic and vphysics simulation.  That means that all
user input is applied at the beginning of a tick.

The client runs at a variable framerate - as fast as it can render
frames.  The vphysics simulation still runs at a fixed interval (15ms).
It intepolates between fixed frames to match the client clock.  This
means that any impulses applied do not take effect until the next
simulation frame is reached.  This will probably complicate your
client-side prediction or at least introduce additional error.

Jay

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Maurino Berry
 Sent: Tuesday, September 12, 2006 9:29 AM
 To: hlcoders@list.valvesoftware.com
 Subject: Re: [hlcoders] Predicted VPhysics entity

 It is a networked entity. They use a shared CreateVPhysics
 method to initialize their physics objects to be identical.
 If the clientside representation of an entity has its own
 vphysics object it will not get forced changes from the
 server (which is what we want) but I can use
 GetAbsAngles/Origin to get the proper server position. The
 idea was to eventually use sendproxies to write out
 appropriate server physics data (inertia's etc) to correct
 the client vphysics object.

 Within the void CGameMovement::PlayerMove( void ) method I
 call a simulate method on the players controlled entity, and
 look at the most recent usercmd with

   #ifdef GAME_DLL
   cmd = pPlayer-GetLastUserCommand();
   #else
   cmd = pPlayer-GetCurrentUserCommand();
   #endif

 and then based on keys down (like IN_FORWARD) etc I apply
 thrust, and use the mouse deltas to figure angular rotation,
 but the point is even with a single keypress (I'm echoing the
 amount of times this method is
 called) the client drifts longer than the server, so repeated
 keypresses of left and right end up throwing the client
 object way out of sync with the servers.

 On 9/12/06, Robbie Groenewoudt [EMAIL PROTECTED] wrote:
  --
  [ Picked text/plain from multipart/alternative ] The client
 and server
  have different times and ticks so it's quite possible the 2 are
  different. Some more code would help.
  Also, you should make it an networked entity so the client
 predicts it
  but receives the right position from the server.
 
  On 9/12/06, Maurino Berry [EMAIL PROTECTED] wrote:
  
   I'm attempting to simulate physics for an entity on the client as
   well as the server (a type of vehicle) Everything works
 fine except
   what feels like the 'drag' is different on the client/server,
   they're set to ignore gravity so they are hovering and a single
   boost with ApplyForceCenter/Offset results in different positions
   and I can't seem to figure out why, it's like the client has less
   air density almost, but I've made sure it's the same. Is the
   simulate rate of havok different between the client/server? or is
   there anything I should know about regarding this? Thanks.
  
   ___
   To unsubscribe, edit your list preferences, or view the list
   archives, please visit:
   http://list.valvesoftware.com/mailman/listinfo/hlcoders
  
  
  --
 
  ___
  To unsubscribe, edit your list preferences, or view the
 list archives, please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 

 ___
 To unsubscribe, edit your list preferences, or view the list
 archives, please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders