After some period of play (sometimes 30 minutes, sometimes 3 hours), the server will stop populating its log file and the clients will be disconnected with the following error:
[2020.03.31-11.22.32:013][679]LogNetSerialization: Error: FBitWriter overflowed! (WriteLen: -1, Remaining: 8110, Max: 8110)
[2020.03.31-11.22.32:015][679]LogNet: Warning: Closing connection. Can't send function 'ServerAim' on 'KPWeaponController /Game/Developer/Maps/BigTree/BigTree.BigTree:PersistentLevel.KPTruck_678.WeaponController': Reliable buffer overflow. FieldCache->FieldNetIndex: 7 Max 11. Ch MaxPacket: 1024.
I’ve been running some soak tests with bots on a dedicated (linux) server. My game is a vehicle physics game, and I was previously encountering a lot “Ensure Condition failed” messages, resulting in strange behavior (like universal overlaps due to -inf/inf transform values) and occasional crashes. In an effort to fix some of these issues, I’ve made the following changes:
- Cap physics body linear and angular velocities for vehicles and projectiles
- Enable Enhanced Determinism
- Reduce max depenetration velocity
When a vehicle or projectile exceeds its speed limit its velocity is immediately reduced to the max. If the transform contains a NaN, it’s reverted to the last known good value. If it happens more than twice consecutively, the object is destroyed. For what it’s worth, I haven’t seen a NaN in over 20 hours of soak tests since I enabled Enhanced Determinism.
I’ve been looking at the call site where SetOverflowed(-1)
is called, and it’s in DataBunch.cpp
:
// Reserve channel and set bunch info.
if( Channel->NumOutRec >= RELIABLE_BUFFER-1+bClose )
{
SetOverflowed(-1);
return;
}
I’m not yet what would cause the packets to pile up such that NumOutRec is exceeding that buffer size, and I haven’t found a way to debug it so I can get some insight. I’m also wondering if somehow enhanced determinism could contribute to this, or substepping, or some other physics setting, or if I’m just now exposing a deeper issue since resolving a more shallow one.
The network payloads are not optimized yet, but at the moment clients send about 5-6kb/s to the server and receive 8-20kb/s (depending on how populated the server is, of course).
In any case, any help would be appreciated. Thank you!