Make Player:GetNetworkPing() work with studio's IncomingReplicationLag setting

As a Roblox developer, it is currently too hard to program and test responsive features involving players interacting with each other (and the server) on high ping/latency.


In games where players interact with each other, especially ones where responsiveness is important, developers will often want to use the Player:GetNetworkPing() API to reduce the unresponsiveness that comes with high latency. For example in a fighting game you may want to use the API to reduce the delay on an attack on the server side so that players with high ping are not at a disadvantage.

The problem with the current implementation of the Player:GetNetworkPing() API however is that it does not take into account the IncomingReplicationLag setting available in studio. So in studio the API essentially always returns 0, making it pretty much useless and impossible to test features that rely on the API. You would have to test your features in live servers, which are horrible for debugging problems.

This problem is not new, as there have been bug reports before about this problem like this one which got some traction. And searching for ‘GetNetworkPing’ in the ‘scripting support’ category will reveal quite a few topics wondering why the API always returns 0.

This feature seems like relatively low-hanging fruit to implement from the outside, and it would also help the development experience a lot, so I am hoping this could be given some attention.

25 Likes