Lag with only two players.

Hi, I have a problem in my online fps, I'm using Photon Unity Networking and the viking demo as a base for my game.

I notice a lot of lag in movements of only two players in my match, the movement of one players is received 5-6 seconds late that he moves, the some thing happens with all the other actions.

I'm using the Photon Cloud and I'm in Italy, but I don't think that this is the problem.

Comments

  • Are you using PUN 1.9 already? If not: Update.
    It could be regular lag, of course. But it could also be a problem when you send too much data. But in a FPS you should have a few PhotonViews and not be sending too much. Do you?
  • Yeah I don't send a lot of data, if you want I can share my project as unitypackage but I can't post the link in the public section. I really don't no because I'm not sending a lot of data.
  • For debugging you should display the ping you got in general: PhotonNetwork.GetPing().
    If this is high or extremely shaky (changing), you might simply have a bad connection to our servers.

    Let us know the results please.
  • The lag happens if I switch to my own host, too. This doesn't make sense.

    By the way the ping with the cloud is ~ 80-85.
  • I tried a lot of time, now I'm testing all in my local pc with photon server sdk installed on my abd there is lag, it seems that there 's a delay that send the data after 3-4 seconds.
  • That would imply that you either have a software firewall causing it or that you have code that is causing it but not photon itself as the local install has a millisecond latency
  • Yeah I don't send a lot of data, if you want I can share my project as unitypackage but I can't post the link in the public section. I really don't no because I'm not sending a lot of data.
    If you don't mind I could take a look at a repro project to find the culprit. You could PM a link to me/tobias.
    You can also first try if the 1.9.5 "beta" addresses your problems: http://forum.exitgames.com/viewtopic.php?f=17&t=1473
  • Ok, I sent you a PM with a link of the unitypackage of my game, tell me if something is wrong, thanks,


    Marco
  • I have not (yet) received any PM.
  • No I think you have received it.
  • I've run the project and found two related issues:
    This looks like PUN 1.6 or 1.7? In 1.8 we addressed an issue that would pile up network messages depending on your FPS..The lag would get bigger over time. Furthermore, you are using the photonviews "reliable delta compressed" option for the FPS player movement. Setting this to unreliable will improve performance/speed.

    So:
    1) Please update to the live 1.9 from the asset store (or even better: update to 1.9.5 - download)
    2) Set your player synchronization to Unreliable instead of reliable delta compressed.

    This will fix your problems.
  • Ok I try to upgrade all, thanks.
  • I also got extreme lag when i run 2 clients with photon. Any idea why?
  • I upgraded the PUN to 1-9-5 and set the photon views to unreliable, now it works, try it.
  • I tried to update but, When i have collisions with other players the game freezes some time, or crash on windows build. Is something changed on character collisions?
  • No, nothing it's changed about collisions I think.
  • I tried to update but, When i have collisions with other players the game freezes some time, or crash on windows build. Is something changed on character collisions?
    Nope PUN doesnt change stuff like collision at all. The only PUN related items could be if you somehow send a lot of network messages during collision events?
  • Hi,
    I got exact same problem as described here in the main topic but I'm trying to use it in Construct 2 rather than in Unity.

    I'm using this Realtime package and i got a really strong feel that this lag depends on the server (if I'm changing the region from eu to something else for example in that case situation comes to be worse).

    Do we have any tricks here as in PUN for Unity for example?