Is there an existing issue for this?
Describe the bug
Multiplayer::PlayerPing() returns correct values on the host but never updates on non-host clients. The host computes ping via heartbeat RTT and includes updated playersInfo in heartbeats sent to peers, but the non-host handler in messageManager.ts (around line 2042-2112) reads messageData.playersInfo for join/leave detection only - it never writes the received ping values into the local _playersInfo store. The initial ping value from connection setup is returned forever.
TLDR: Non-host players will see the same ping for themselves and others indefinitely after the initial heartbeat.
Suggested fix
In the non-host heartbeat handler (~line 2042-2112), after processing joins/leaves but before return, add something like:
// Update local playersInfo with latest ping data from host
for (const playerNumber in messageData.playersInfo) {
_playersInfo[playerNumber] = messageData.playersInfo[playerNumber];
}
I'm happy to raise a PR for this myself if nobody has the time but agrees with the fix.
Cheers!
Ryan
Steps to reproduce
- Create a multiplayer game with PlayerPing() displayed for all players
- Host the game and have another player/client join
- On host: ping values for all players update continuously
- On non-host: ping values load once and never change.
GDevelop platform
Desktop
GDevelop version
5.6.266
Platform info
Details
OS (e.g. Windows, Linux, macOS, Android, iOS)
macOS
OS Version (e.g. Windows 10, macOS 10.15)
Version 26.4.1 (25E253)
Browser(For Web) (e.g. Chrome, Firefox, Safari)
Chrome
Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)
Galaxy S21 Ultra
Additional context
The fix appears to be adding a copy of messageData.playersInfo into the local _playersInfo in the non-host branch of handleHeartbeatsReceived.
Reference: Extensions/Multiplayer/messageManager.ts, non-host heartbeat handler.
Is there an existing issue for this?
Describe the bug
Multiplayer::PlayerPing()returns correct values on the host but never updates on non-host clients. The host computes ping via heartbeat RTT and includes updatedplayersInfoin heartbeats sent to peers, but the non-host handler inmessageManager.ts(around line 2042-2112) readsmessageData.playersInfofor join/leave detection only - it never writes the received ping values into the local_playersInfostore. The initial ping value from connection setup is returned forever.TLDR: Non-host players will see the same ping for themselves and others indefinitely after the initial heartbeat.
Suggested fix
In the non-host heartbeat handler (~line 2042-2112), after processing joins/leaves but before return, add something like:
I'm happy to raise a PR for this myself if nobody has the time but agrees with the fix.
Cheers!
Ryan
Steps to reproduce
GDevelop platform
Desktop
GDevelop version
5.6.266
Platform info
Details
OS (e.g. Windows, Linux, macOS, Android, iOS)
OS Version (e.g. Windows 10, macOS 10.15)
Browser(For Web) (e.g. Chrome, Firefox, Safari)
Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)
Additional context
The fix appears to be adding a copy of
messageData.playersInfointo the local_playersInfoin the non-host branch ofhandleHeartbeatsReceived.Reference:
Extensions/Multiplayer/messageManager.ts, non-host heartbeat handler.