Lag with only two players.

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Lag with only two players.

marf
2012-02-29 13:47:39

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

Tobias
2012-02-29 17:14:03

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?

marf
2012-02-29 21:21:32

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.

Tobias
2012-03-01 12:14:59

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.

marf
2012-03-01 14:15:59

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.

marf
2012-03-06 09:21:04

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.

dreamora
2012-03-06 09:26:19

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

Leepo
2012-03-06 10:27:17

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

marf
2012-03-06 14:46:32

Ok, I sent you a PM with a link of the unitypackage of my game, tell me if something is wrong, thanks,

Marco

Leepo
2012-03-06 16:02:23

I have not (yet) received any PM.

marf
2012-03-06 16:16:50

No I think you have received it.

Leepo
2012-03-06 16:46:08

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.

marf
2012-03-06 17:00:55

Ok I try to upgrade all, thanks.

BulleTTime
2012-03-12 13:38:36

I also got extreme lag when i run 2 clients with photon. Any idea why?

marf
2012-03-12 13:40:46

I upgraded the PUN to 1-9-5 and set the photon views to unreliable, now it works, try it.

BulleTTime
2012-03-12 15:15:46

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?

marf
2012-03-12 15:43:12

No, nothing it's changed about collisions I think.

Leepo
2012-03-13 10:53:43

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?

Lex
2017-07-01 10:22:51

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?

Aygo
2022-07-10 09:12:22

Tobias 2012-03-01T12:14:59+00:00
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. i am getting that problem how can i resolve it

Back to top