Jump to content
  • Advertisement
Sign in to follow this  

Networked object creation and management

This topic is 2436 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, I am working on a networked game and I have hit a wall in its development. I am trying to come up with a way to synchronize the creation of objects between the server and all clients in a way that wont be susceptible to hacking or extreme lag. If I allow the client to tell the server what object to create and its position/velocity it will not lag, but it will be easily hacked for quickfire/aimbots etc. If I just send the input data to the server and have it tell the clients to make the objects on their ends the players with high pings will have huge delays. So, I was thinking that the only way to solve this would be to create the object on the client side instantly, send the input data to the server, have the server come to the same conclusion that an object should be created, crate it itsself, and then send the object data to all clients. The problem with this is I do not know how I would synchronize the object IDs between the creating client and server so that further updates(via server scripting) and corrections could be applied.

Am I on the right track, or is there a better method that I have overlooked?

Thank you.

Share this post


Link to post
Share on other sites
Advertisement
You are exactly on the correct track. To synch your client with your server you can create an std::map on your server to identify the mapping between the two sides. So for example, when your client creates an object it gets a unique ID (clientID). You pass your "request to create object", with the clientID to the server. When the server gets this request it will create its own object and get the serverID value to refer to it. Now that the server has the clientID and serverID you can put those into your map so that anytime you get a call from the client about clientID you will know that it actual refers to the serverID that is used on the server. When the server sends something down to the client about serverID, you would also use the map again to get the clientID and pass down your command that way.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!