I’m pretty sure if there is a solution to this, It will be in c++, so I’m asking this in this forum.
What I’m trying to do is simply make a typical strategy game using the UE4 dedicated server if I can. However, it seems the Pawn, Actor, Character Base classes all have massive networking built in spamming the server for an FPS type game.
What I would like is to turn off all that “FPS” networking, and only use the replication and passing a few vars around. The server will only have to process 1 “event” every 3 seconds. In short a multi-player strategy game that each player will have 3 seconds to move.
Think chess with a 3 second clock to move. In which I would like to use the dedicated server to connect the players. I only need to pass along which piece is moved, and where it is moved to. I have no need to pass the server how that piece is moving 10x every second.
And that 10x/second server spamming seems to be buried in the UE4 base classes. I would like to turn this off.
Use the Actor and see the appropriate replication & network variable to fit your needs.
Actor class is not spamming a lot of stuff unless you set it to do it.
For example, you can set the Network delay between update. If you set it to 5 seconds, replication will only occur every 5 sec. More, you can just use RPC calls and not variable replication. By doing this, replications will only occur once you do an action.
I don’t know where you found the “spamming stuff” in Actor, but you should look at it another time. And if it’s still too much… I would say that you should write your need and build your own C++ class bases on UObject and managed the network part (but that’s a big piece of work).
Thanks for your reply.
All I can tell you about the networking “Spamming” is that when I connected the 2 clients to the dedicated server, the network traffic was a lot. AND the 3rd person project models were together, and very much synched. Which would be GREAT if I was making that type of game.
I just assumed that it was inside the actor classes. Because I sure as heck don’t know enough to make that work at this point. However, after reading your reply, I will investigate more.
And your suggestion of RPC sounds even better then what i was planning.
As far as writing my own, well that’s a last ditch, I have absolutely tried everything else, including making another type of game thing. lol
Most of what you’re seeing is probably the functions in CharacterMovementComponent that deal with client/server position error correction, such as:
ServerMove
ClientAckGoodMove
These are sent at a high rate to reduce latency when movement occurs. You bring up an interesting case though, when players aren’t moving they probably don’t need to send it at such a rate (we already throttle it, but it could be throttled more I suppose).
Replication of variables only happens when the values actually change, so when objects aren’t moving or rotating then network traffic should be low.
I’m curious about your setup, because it sounds like you should don’t actually need a local player character (which would remove the network calls I mentioned above). You could get away with something more like the Puzzle template that only uses a PlayerController and no local pawn. All pawns would be on the server, and the local PC would send RPCs (from mouse events) indicating which pawns they want to move. Those pawns would move on the server and replication would occur when they move, but traffic would be low when they don’t. The pawns can still be characters-- the character traffic is only high when there is one possessed on clients.