Question regarding a concern of mine (network replication)

Okay so I started a fun project on my own to attempt to create a tower defense game, and seeing how other tower defense games perform when many units spawn and move (e.g. via pathfinding and velocity), I see that their received network jumps above the target of 50 KB/s once many units have spawned (the received network fluctuates, lowering as the units get destroyed once reaching the destination or increasing once spawning and going their path).

This made me consider wanting to try out a different approach where I basically do all the pathfinding on the server and then offload the animation (linearvelocity) to all clients. I am aware that that clients should not be trusted and there should be regular sanity checks such as regularly verifying/validating information from the client to the server to prevent desynchronization, interpolate the positions and ensure clients do not provide far off information that doesn’t resemble that of other clients.

Now, my question here is whether I should offload the animation to recreate this network replication in order to increase the performance in first place, whether I should use something like zap/blink to further enhance the performance, and whether this system is reliable or has been proven to be reliable (and if there are any notable games having implemented this).

To be honest I have never really encountered a problem with too many units on the server-side as they get destroyed once they reach their destination and thus lowering the received network, but I was still wondering what a good practice for my use case would be.

If network bandwidth saving is the goal, then the best approach is to run the entire visual part of the game on the client via simple event or replication updates and have the server do all the heavy lifting for all the game math and simulations to avoid cheating. This means you’ll need to create a system where the client only needs the minimum amount of information to “simulate” what the server is processing in real-time.

  1. If the object is going to move around a set path with no change in speed, the client should be about to do this easily via just a few starting variables like speed for example.
  2. “Fighting” can be scripted on the client so that is Object A is throwing fireballs at Object B, it doesn’t have to be exact. The server is tracking when one object destroys another and all the client needs to do is “play” the defeat animation when appropriate.
  3. Compress the data when possible, via what you know about how much the client needs to preform as “proper” simulation of what is going on in the server.

There is no one-in-all solution to your question because it will be unique for every game. When doing bandwidth optimizations for my own game, I found bandwidth hogging replication through lots of debugging and just thinking in terms of what the client needs to know and what the server can process without the client needing to be part of that process, thus saving lots of bandwidth in the end.

2 Likes

A thought just arrived:

what if instead of offloading it to 10 clients, what if it’s only one client?

How can the server trust this one single client to not exploit while the server doesn’t have any other clients to compare the client to?

In my case would I have to estimate/determine where the unit might be or is meant to be? The exploiter could take advantage of this to exploit in a way that deludes the server into thinking the data is valid and realistic.

communication between server and all clients is key after all

This is in the wrong category. Change it to #help-and-feedback

okay I have changed the category