So I’ve done a bunch of optimization on replication properties and RPC’s. I’ve drastically reduced the size of properties and RPCs, and in some cases completely removed properties, favoring other solutions. If anyone’s interested I’ll do a post detailing the things I did to reduce network usage. Here’s a new profiling file as well. I’m quite proud of one RPC that used to require 396 bits of data. It’s been reduced to 73 bits.
The good news is that the game behaves better than it did. You can now play at 200ms lag. It’s still got problems but it’s an improvement. It starts to get unplayable again at about 500ms of lag. But until then it’s playable and improved.
I have another problem that I’d like advice on though. Starting at around about 300ms of lag. And getting worse as the lag increases, clients are often just disconnected for no apparent reason. At 300ms the game is playable, and at 500 it’s quite laggy, but just barely playable. But it doesn’t matter if the engine just kicks the client.
Why is this happening and how can I prevent it?
For reference. Here’s a log of a server during the kick.
[2016.03.21-14.33.34:456][676]LogNet:Warning: UNetConnection::TrackLogsPerSecond instant FAILED. LogsPerSecond: 71.996994, RemoteAddr: 192.168.0.21
[2016.03.21-14.33.34:456][676]LogNet: UNetConnection::Close: Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, PC: BoxmanPlayerControllerKing_C_1, Owner: BoxmanPlayerControllerKing_C_1, Channels: 127, RemoteAddr: 192.168.0.21:50549, Time: 2016.03.21-14.33.34
[2016.03.21-14.33.34:456][676]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_0
[2016.03.21-14.33.34:456][676]LogRep:Error: Rejected too many unwanted functions ServerMoveOld in BBCharacterMovementComponent /Game/BoxmanBegins/DataDrive/Maps/Ambush.Ambush:PersistentLevel.BP_Trooper_C_4.CharMoveComp
[2016.03.21-14.33.34:456][676]LogNet:Error: UActorChannel::ProcessBunch: Replicator.ReceivedBunch failed. Closing connection. RepObj: BBCharacterMovementComponent /Game/BoxmanBegins/DataDrive/Maps/Ambush.Ambush:PersistentLevel.BP_Trooper_C_4.CharMoveComp, Channel: 109
[2016.03.21-14.33.34:477][677]LogNet: NotifyAcceptingConnection: Server Ambush accept
[2016.03.21-14.33.34:477][677]LogNet: Open Ambush 03/21/16 14:33:34 192.168.0.21
[2016.03.21-14.33.34:477][677]LogNet: Added client connection. Remote address = 192.168.0.21:50549
[2016.03.21-14.33.34:478][677]LogNetTraffic:Warning: High single frame packet loss: 1139
[2016.03.21-14.33.34:478][677]LogSecurity:Warning: 192.168.0.21:50549: Malformed_Packet: UNetConnection::ReceivedPacket: Received control channel close before open
[2016.03.21-14.33.34:478][677]LogSecurity:Warning: 192.168.0.21:50549: Closed: Connection closed
[2016.03.21-14.33.34:478][677]LogNet: UNetConnection::Close: Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_0, PC: NULL, Owner: NULL, Channels: 2, RemoteAddr: 192.168.0.21:50549, Time: 2016.03.21-14.33.34
[2016.03.21-14.33.34:478][677]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_1
[2016.03.21-14.33.34:490][678]LogNet: NotifyAcceptingConnection: Server Ambush accept
[2016.03.21-14.33.34:490][678]LogNet: Open Ambush 03/21/16 14:33:34 192.168.0.21
[2016.03.21-14.33.34:490][678]LogNet: Added client connection. Remote address = 192.168.0.21:50549
[2016.03.21-14.33.34:490][678]LogNetTraffic:Warning: High single frame packet loss: 1140
[2016.03.21-14.33.35:040][711]LogNet: UNetConnection::Cleanup: Closing open connection. Name: IpConnection_2, RemoteAddr: 192.168.0.21:50549 Driver: GameNetDriver, PC: NoPC, Owner: No Owner
[2016.03.21-14.33.35:040][711]LogNet: UNetConnection::Close: Name: IpConnection_2, Driver: GameNetDriver IpNetDriver_0, PC: NULL, Owner: NULL, Channels: 1, RemoteAddr: 192.168.0.21:50549, Time: 2016.03.21-14.33.35
This is the log from the client
[2016.03.21-14.45.20:327][902]LogNetTraffic:Warning: High single frame packet loss: 18
[2016.03.21-14.45.20:327][902]LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
[2016.03.21-14.45.20:327][902]LogNet: UChannel::CleanUp: [GameNetDriver] [BoxmanPlayerControllerKing_C_0] [BoxmanPlayerControllerKing_C_0]. ChIndex == 0. Closing connection.
[2016.03.21-14.45.20:327][902]LogNet: UNetConnection::Close: Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, PC: BoxmanPlayerControllerKing_C_0, Owner: BoxmanPlayerControllerKing_C_0, Channels: 73, RemoteAddr: 192.168.0.21:7777, Time: 2016.03.21-14.45.20
[2016.03.21-14.45.20:327][902]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_0
[2016.03.21-14.45.20:327][902]LogSecurity:Warning: 192.168.0.21:7777: Invalid_Data: Received a packet with an Acked PacketID
[2016.03.21-14.45.20:327][902]LogNet:Warning: Network Failure: GameNetDriver[ConnectionLost]: Your connection to the host has been lost.
[2016.03.21-14.45.20:327][902]LogNet: NetworkFailure: ConnectionLost, Error: 'Your connection to the host has been lost.'