Add proper sleep for physics enabled objects to allow dynamic worlds with optimized network

As a Roblox developer, it is currently too hard to use a lot of non-anchored objects in a game without messing up the network traffic.

If Roblox is able to address this issue, it would improve my development experience because we could build more dynamic worlds without having players disconnect due to high network traffic.

Our example:
We have 49 objects in the workspace that are signs and lanterns, example:
image

The world would feel more alive if we let these lanterns have physics by attaching them using a BallSocketConstraint, so the players could push the lantern around. But testing shows that it is not viable.

Testing method:

  • Start the game in studio, single player
  • Stand still and wait for the initial network traffic to cool down to see what the average idle network traffic is

Outcome with BallSocketConstraint on the lanterns and sign: 20KB/s network receive

Outcome with anchored lanterns and signs: 0.1KB/s network receive

These differences in network traffic are unexpected since nothing in the game is affecting the physics of the signs & lanterns, they are just hanging there idle.

In other game engines there is something called sleeping state (Unity example) for physics objects that causes them to use almost network traffic and CPU when they are idle.

Adding this properly to Roblox would make games way more optimized across the board and probably save Roblox a lot in bandwidth costs.

2 Likes

Roblox does have physics sleep. In fact, it’s recently been improved.

In studio settings, you can choose to highlight awake parts. Enable that and see if all the lanterns are highlighted red. If they are not highlighted, they are sleeping and your issue lies elsewhere.

9 Likes

Thank you for the info!

I went back and reviewed our lanterns and noticed that we did not have enough friction on the BallSocketConstraint causing the lantern to never go 100% idle - so it was there the problem lied.

So this was very much my mistake.

6 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.