Ping and Data Spikes When Respawning

I don’t really think this is a code error. In fact, I’m not sure what kind of error it is, but it seems to only happen to my projects, despite the fact that it’s not related to anything I’ve been able to find.

The issue:

Every time a client’s character is loaded using :LoadCharacter() the client’s received data jumps up to above 100 KB/s. It also causes a decent ping spike of 50+ ms while re-spawning. I have no idea what’s causing this, but I haven’t noticed it on any other games on the platform. Only my own projects. Has anyone else had any experience with this issue as well?

I’d like to start making 50+ player games, and I have some really efficient netcode for it, but if this issue persists, I fear there may be some network throttling and major issues when respawning.

1 Like

See if any of your plugins are interfering that’s the only thing I could think of.

I don’t use any plugins, and it spikes both in studio, in-game, and even in-game on separate accounts. Yet as I said, the only thing consistent in all games is that they are MY projects. Aside from that, the netcode is different, the storage is different, etc.

1 Like

From what you have written, I would suspect that it is “your code”, that introduces this ‘data jumps to +100KB/s when spawning character’.

You have not illustrated what you have coded or put into “a player’s character when it spawns”, so that would be my first place to look into, getting an idea of “what actually happens when spawning a character [in the game].”

Perhaps you have objects/parts/events/localscripts that are being created (or destroyed) with every “character spawn”?

In the LoadCharacter documentation, it does state: “It also clears the player’s Backpack and PlayerGui.” - So if you have many objects in the Backpack which needs to be transmitted from server to the client…

Also, what kind of “efficient netcode” do you have? - When I look at the Roblox framework/API, it does all this ‘netcode’ behind the scenes, where I, as a Roblox-user/game-developer, just have to know/create the objects in Workspace/ReplicatedStorage that I want to use between server and clients.

My “netcode” is just how the server handles information back and forth. So by efficient I mean, in my FPS game, for example, the sent data size doesn’t exceed 3 KB/s while moving and shooting simultaneously (the most constant sent information you can achieve by yourself).

I’ve eliminated all my code by simply disabling all of my own scripts and turning on “characterautoloads” in the player service. The data jump didn’t improve even in doing that.

You do bring up an interesting point in PlayerGui… I do have quite a few UIs that reset on spawn, so I’ll try removing them and let you know how that goes.

Ah yes, Decker was correct, having items in StarterGui that have “ResetOnSpawn” enabled causes massive spikes in received data while re-spawning.

3 Likes