How server manage incoming update from client

I’m looking at the code and have questions:

  1. In our code, Server_SendMove() and ServerState are changed or called every tick, does that mean that an update is sent to the server every tick. The change that we made NetUpdateFrequency = 1; is in an if statement with HasAuthority() so if I understand everything properly(which I hope I do), only the server has this setting set, meaning that our server and client are not sync. Note: I did the test and the client has a default tick rate of 100

  2. How does a server handle multiple connexions, when I look at our code, the simulation is done in between ticks because the method is SimulateMove() is called by an outside event for every connected player. If I have many players connected isn’t this going to cause a lot of performance overhead?

  3. If not careful, is it possible to create an endless loop of replication update or does Unreal has protection against that.

Hiya, I’m working through this course as well, I think your observation on point 1 is correct and explains why at this point if we drive on the client we see the server update pretty smoothly where as if we drive on the server it only send out an update every sec to the client. I guess all will become clear in later lectures perhaps or perhaps it was just missed in testing.

I think Tick and NetUpdateFrequency are separate tho, tick fires every frame Network update frequency is separate see Property Replication | Unreal Engine Documentation and the comments around data driven network update frequency

There’s a good write up on the replication flow here Detailed Actor Replication Flow | Unreal Engine Documentation but it doesn’t explicitly call out between server and client replication. I think because we are working on a scenario where the server is also going to be a client for someone we have to treat the server as a client as well as an authoritative server which is why it all feels a bit confusing.

If we were going for a true client server model where we had a dedicated server I think the code would be easier to understand conceptually but harder to set up for a training course.

For point 2, I think (but I’m no expert) that this solution is more of a teaching aid and also suited to smaller scale connections where someone is also hosting the server as a client as well so it wont scale great as you observe. If you look at the unreal documentation they have a section on Replication Graph | Unreal Engine Documentation I think this is what we need for MMRPG style games / battle royal etc. I’ve got it on my list of things to read up on (as well as how Microsoft Azure PlayFab | Full Stack LiveOps, Real-time Control integrates after this course. It look interesting for larger scale stuff.

  1. I’m sure we probably could :slight_smile: it’s a great observation and something to consider and keep an eye on for sure!