Photon problem

0 favourites
  • 7 posts
  • Hi, I'm making a multiplayer game using photon, but I have a big problem that occurs in most demo projects. So when I run the game in two windows to test multiplayer, sometimes everything works perfectly, and when I run the game again, the player's position updates every half a second and there is such lag that the game is completely unplayable. To be clear, I have good internet, I have about 30 ping on the photon server. Is this an addon bug or am I doing something wrong? I have included a screenshot of the eventsheet below

  • You should send all data needed in the same message not in separate messages.

    You should only send messages when something actually changes, not sending everything every tick. You should also send events timely and not by ticks, since ticks depends on the framerate.

    (In your example if you have a 144hz screen your game would post almost 600 messages every second, just for 2 players...!)

  • I think I did as you said, but 1 out of 2/3 games it still lags every 0.5 seconds,

    so nothing has really changed

  • I changed the region in the Photon addon to US from EU and the problem disappeared, which is strange because I live in the middle of Europe. Anyway, thank you fredriksthlm for the tips that helped me improve the game code :)

  • The eu server is in Amsterdam and the us is in DC. So that indeed seems odd for you, but yea, you can try the ping to them all and see which is best.

    I actually saw a comment from someone on the photon forum that claimed the ping and lag was unstable on the eu server. But it was a very old comment…

  • Looking at your screenshot,

    isConnectedToLobby is a normal condition, which gets checked every tick.

    You want OnConnectedToLobby which is a trigger condition.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Looking at your screenshot,

    isConnectedToLobby is a normal condition, which gets checked every tick.

    You want OnConnectedToLobby which is a trigger condition.

    When a user enters a room the user also leaves the lobby in the same time. So the condition "isConnectedToLobby" will be false directly when entering the room, which is the action for this condition.

    But it is true that the event will be checked every tick until the room is entered, which will maybe take a few ticks. so best to add a "trigger once" to it indeed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)