Hi guys, I have run into a critical issue with netcode 4. I haven’t tested on 5 because I have never managed to get that to run smoothly with the netcode sample.
Issue 1 is that ALL destroyed entities are sent in an entire frame which can exceed the max packet size and result in the error “It is not possible to send packets larger than {0} bytes with this pipeline and driver. Trying to send {1} bytes.” This happens to me quite often as I have a large amount of projectiles that despawn frequently. If too many despawn at once the error happens. I can mitigate this by buffering out my entity.destroy events, only registering a certain amount per tick (which is not great).
Issue 2 is that entities hidden by SetGhostRelevancySystem seem to run Destroy on the client entity and once again this can exceed the packet size if the camera moves to quickly and makes too many entities irrelevant at once. I guess I could buffer irrelevancies out as well by rewriting SetGhostRelevancySystem.
Issue 3 is the most critical. Even if EVERY entity is marked as irrelevant, and the client should have nothing, the client still gets notified about Destroy events. So if I move my camera away from every projectile, and no projectiles are being sent to the client, and the client has never ever had a single projectile - it is still getting 5k destroy events in a single frame - about entities it never knew about. And this of course raises the same error about packet size being exceeded. You can see this issue illustrated in the attached screenshot where (1) the clientworld only has only 2 ghosts, and you can see in netdbg (2) the client never had any entities sent yet (3) there are 5k destruction events sent and (4) the error occurs.
Issue 4 is how destruction hogs bandwidth when there is lag. It appears as though destruction messages are resent each frame until they are acked. If the lag is large (say 500ms) then the destruction messages end up building up and consume all bandwidth, leaving no room for anything else.
In my project issue 2 is so bad that it crashes 100% of the time when SetGhostRelevancy is enabled for projectiles. If I just send all projectiles to all clients all of the time, it runs well, but I need that bandwidth for other things.
@timjohansson do you guys know anything that can help?
Thanks for your help!