#Photon PUN2 high latency
1 messages · Page 1 of 1 (latest)
using Photon.Pun;
using TMPro;
public class NetworkStats : MonoBehaviour
{
public TextMeshProUGUI pingText;
public TextMeshProUGUI sentText;
public TextMeshProUGUI receivedText;
public TextMeshProUGUI resentText;
private void Update()
{
// Update the text of the TextMeshProUGUI components
pingText.text = "Ping: " + PhotonNetwork.GetPing() + " ms";
sentText.text = "Sent: " + PhotonNetwork.NetworkingClient.LoadBalancingPeer.BytesOut;
receivedText.text = "Data Received: " + PhotonNetwork.NetworkingClient.LoadBalancingPeer.BytesIn;
resentText.text = "Data Resent: " + PhotonNetwork.NetworkingClient.LoadBalancingPeer.ResentReliableCommands;
}
}```
This is basically how I am getting the ping and some other network stats
Also sorry, I got a Lil busy and didn't get time to reply. Also I thought I'd just make a thread so it's easier to reply and check messages
Also about data resends, there are hardly any. And the ping remains high still even with 0 resends
Also sorry, I got a Lil busy and didn't get time to reply.
No worries.
Is this a recent PUN version (update, if possible)? And which transport protocol do you use?
Yes it's the latest version, and I'm sorry I am kinda new to the networking, whats a transport protocol here? @chilly jasper
There are different protocols to chose from. UDP is the default which you will be using.
I see it, I am using the default Udp.
@chilly jasper
Just today I have been getting around 100 ms, on both client and host. But I still think it's much higher than it should be I guess
I think optimal ping is around 60?
Lower is always better, yes.
So what could be the issue here @chilly jasper
I hardly know anything new about the case, really.
Ok, so UDP and not so many re-sends. I would prefer some numbers for this but ...
I would possibly enable the SupportLogger (in the PhotonServerSerttings) and increase the logging levels to Info. Then run it and send the log file.