Looking for some server/client advice

Hey,

I have a pretty big game and I’ve been moving into a multiplayer setup using authoritative server/client model. I have it all running but I’m concerned about certain areas. My game has players running around, doing various actions, but nothing intense like a FPS where the millisecond matters.

Quick background:
First, the clients have their own collision and prediction systems, they do what the player instructed, then it contacts the server who verifies validity. If data is valid, no news is sent back to the originating client and the valid data is sent to the other clients. I’ve read up on server/client concepts (e.g. http://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html). I’m using a slightly different approach. I don’t contact the original client if server agrees. Only failure, does the server respond to the originator of the request.

  1. For those with experience in authoritative server/client, is this an okay approach? I don’t want to box myself in later.

  2. I’m torn on how much logic to put on the client side. For example, if a player drops an item, should I…

    a) Send command to server, stating dropping item, server confirms validity, sends that data to all clients? (Player has to wait for response due to round trip to server, could be 50-200ms and it could seem sluggish)
    b) Client drops item because locally it sees it is valid, sends command to server, server confirms validity, sends data to other clients? (Player has no lag response)

Now (a) is the easiest because it requires less client logic and you really only rely on the server but you get into small lag conditions. (b) is more player friendly in terms of lag but if a violation is detected, you have to reverse everything on the player (remove item from floor, put the item back in inventory, etc…)

Currently my movement system is using (b) because it needs to be responsive. My item drop system is using (a). I’m concerned lag will make players mad. I’m looking for advice on anyone who has experience in this area. I’d prefer to use (a) as much as possible because it is simpler.

Thanks,
David

For 2 you can always do the easier way just to get it done and then if it’s an issue you can upgrade to the more complex way. You could say that doing 2B for everything would be premature optimisation.

Thanks. That is what I was thinking too. I just worry the refactor to make more optimized later will be a huge task if there is a problem.

I did some testing through a VPN to get a sense of the network distance lags. I believe it worked. I was getting between 50-100ms. I think I might go hybrid and make some A and some B depending on timing requirements.

Let me just say… network games are complex lol.

I strongly recommend you find a way to simulate lag, in Lidgren you can set a delay time but if your networking tech doesn’t have that you could always just store your network messages and not actually read them until after simulated delay time.

I am using Lidgren. I didn’t know it had lag simulation built in. That is fantastic! Thanks.