Optimizing Latency using non-authoritative Clouds.

Hey guys,

well I'm working on my first multiplayer implementation ever for an action game, think Zelda or Oblivion. I'm learning from the start so I chose the easy solution of a non-authoritative server where players basically only update their status and send events now and then. I'm using Photon Clouds and everything works great, except I'm having a concern about latency.

I'm constantly monitoring PhotonNetwork.networkingPeer.RoundTripTime and it usually stays around 130 but it seems like it fluctuates up to as much as 750 - which totally breaks the gameplay. I realize networking is a wild beast and that lag and jitter will always occur but I'm wondering if perhaps the problem is me?

What happens is I'll get 2 or 3 computers from work to connect together using Photon and we basically just run around, not doing - nor sending - much data. Every player has one(1) PhotonView and one(1) NetworkInterpolation script and that's pretty much it, so I'm at a loss.

Is there anything else I can do to stabilize my players' latency as low as possible while keeping the server non-authoritative? Or is my networking model doomed to be instable? Any tips, help, hint, info is more than appreciated, I'm just a lone programmer trying to figure networking here - thanks a lot! :D

Comments

  • The photon view and especially its message limits (300 per second and room) is very low for realtime.

    You believe to not send much but if you didn't change the send rate, you are sending at a massive frequency messages and are pretty surely running close to the limits already (with default send rates you could have 5 at maximum and thats if you only have 1 photon view per object running around, not doing any rpcs etc)

    To stabilize the jitter etc you would likely use something like the networkrigidbody in the Unity Networking Example project on the unity page - resources section and integrate interpolation, extrapolation and a 'pushback' of all sends to get a consistent state for all users not just your own while the rest is delayed
  • Thank you dreamora for a fast and helpful answer.

    The networking example project is exactly what I want, I remember I had seen this stuff somewhere but I couldn't find it again, extrapolation and delayed message are a simple-yet-brilliant idea that'll probably do much help. I'll [do my best to] implement that, along with 'prediction' - I may do more harm than good but its worth trying.

    Well i had tried tweaking the sendRate but I see now that I probably only made the matter worse as I actually reduced sendInterval, instead of sendRate, which I hadn't noticed. I'll play again with those values and keep the 300 message limit in mind. Which gets me wondering where did you learn about the message limit? And if photonview are typically not fast enough for realtime, what would be the ideal solution? Drop all photonview and make massive use of event then synchronize everything myself?

    Thanks again for the answer and sorry for the multiple questions, there's just so much I need to learn and I wouldn't know where to ask! I'll post update, if any :P .
  • The messagelimit might not be implemented / activated at the time but it was listed on the ExitGames blog about pricing of the cloud ( http://blog.exitgames.com/2011/12/photo ... -feb-2012/ ) though it seems the numbers were changed to be a tad higher now depending on your subscription.