Jump to content

Full control over controllers


Ywa
 Share

Recommended Posts

Hi everyone,

 

I was wondering. What's the best way to fully control a controller entity?

 

My current server is like this (multiplayer environment):

Client A walks arounds the map and utilizes the UpdateController function. Every 10 frames, the position, rotation, velocity and omega are read out and send to the server. Which also has a controller (without updating) and sets the 4 vectors.

 

However, the problem is that when I read out the rotation values every frame. If in the same frame the 4 vectors are set on the server (by the networking), the values are correct (makes sense), however, when reading out the values when not being set, they always return something between -1 and 0 (usually 0).

 

I tried to store the Y-angle/rotation in a separate variable (on the server) and call this every frame (no movement):

UpdateController(self.Entity,fControllerAngleY,0.0,0.0,0,40,1,0);

 

It does fix the 0-rotation problem, however, things are not smooth at all.

 

So is there a way to simulate the velocity, rotation etc. Without actually calling UpdateController?

 

Thanks in advance.

Link to comment
Share on other sites

..all transformations and way they suppose to behave (smooth turning, etc etc), regarding controller, should be done before actual UpdateController call..

I'm setting the position, rotation, velocity and omega before calling it. But it seems to slow it down because UpdateController is called with 0 speed.

Link to comment
Share on other sites

This is fascinating to me. I plan on implementing some similar functionality, just haven't gotten to it, so I love to pick the brains of those doing it ahead of me.

 

Why are you not calling UpdateController on the server with the velocity that you passed it from the client?

 

What do you mean "things are not smooth at all"? The first thought I had was that you are not taking into account network latency.

rotation_on_server = rotation_on_client + omega_on_client * network_latency

Link to comment
Share on other sites

Well, when I sync props/phys-objects using the same way (pos, rotation, velocity, omega) things are very smooth. And I didn't mean network lag anyways. What I meant was it seems the player was slowing down on the server (and thus other clients too).

 

In the past I used a simple barrel as player-model (and only used the controller @ the local player). And everything was perfect, because there was no controller at server + other controllers screwing things up.

Link to comment
Share on other sites

Are you calling UpdateController every frame? Or only when you receive info from the Client? You should call UpdateController everyframe with information received from or extrapolated from info received from the client every frame, even if that info is only updated every 10.

Link to comment
Share on other sites

The whole problem is that I don't want to call it. I just did it an attempt to work-around the problem.

 

It's simple. I want to simulate the movement the client calculates. I decided to use a controller on the server too because they have the same shape then. If I give the server an oildrum physics file and the client the real controller, there's no possibility it would ever work properly, unless their physics collisions are the same.

 

I better just stick to this question now: Is there a way to give the controller physics shape to a non-controller entity?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...