Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Updating position/velocity over the network

This topic is 6090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all. I''m having troubles with updating positions/velocitys over the network. The idea is to calculate positions locally at the client and then send it to the server wich then send it to the other clients. This is how I calculate the position locally (the usual equations): position+=velocity*time + 0.5*thrust*time*time; velocity+=thrust*time; Now, sending the position is straightforward, the velocity is not. The ''time'' in above equations is the time it took to render/update a frame, so its going to be different on different computers depending on how fast it is. So I need to "take out" the frametime dependancy from the velocity I guess. I tried to send this instead: velocity_to_send=velocity/time; And then on the receiving clients multiply by their local frametime. But that didn''t really work so good as I thought it would. The velocity gets wrong and I cant understand why. Oh yea, I need to send the velocity because of the prediction on the clients ofcourse. So any ideas?

Share this post

Link to post
Share on other sites
competely seperate the your rendering from your logic code.

are you trying to do extrapolation? if so I recommend sync''in all the clients to the server time and going from there.

xpos = xpos + xvel * time_spent_traveling_over_net;

do a search, this forum has lots of good topics about sync''in.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!