playMaker

Author Topic: [SOLVED] Photon PUN2 multiplayer updating is choppy  (Read 3420 times)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
[SOLVED] Photon PUN2 multiplayer updating is choppy
« on: July 30, 2019, 03:20:11 PM »
Hiya, Playmakers!

I've just started implementing multiplayer into our VR project.

I started with tcmeric's fantastic tutorials:

And also this series by Romi Fauzi:
https://www.youtube.com/playlist?list=PLYYCDVRRWC7cbFGWckVXgAl5i8MRq9zVc

And since this is an Oculus VR project, I adapted some of the techniques from this one (spawning an avatar and making it a child of the CenterEyeAnchor):

^These are great tutorials if you've never dealt with multiplayer setup, like me!

Everything is working as I'd hoped. However, while each player has a great framerate themself, the 'Other' player's movements are noticeably choppy.

I've set all the Photon viewers in the scene to 'Unreliable', as suggested in this post:
https://forum.unity.com/threads/reliable-delta-compressed-vs-unreliable.167050/

My debug info shows the ping staying around 150-200.

I've attached an image of my NetworkedPlayer setup. It is a slight variation from the solution in this tutorial:
(EDIT: DO NOT FOLLOW THIS TECHNIQUE. It is outdated and the cause of my problem. See the thread below)

I'd appreciate any suggestions, and will report back with results!

NOTE: The get/set Rotation is set up identically to the get/set Position
« Last Edit: July 31, 2019, 02:22:07 PM by ToxicFrog »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Photon PUN2 multiplayer updating is choppy
« Reply #1 on: July 30, 2019, 09:28:27 PM »
Hi, its best not to try and send/get the rotation manually if not necessary. Better to use the photon transform view (sync) component instead. Lerping should be applied under the hood, as even at the best of times, only 10 messages are being sent per second. I also found this asset to be pretty great to replace the transform view sync component.

https://assetstore.unity.com/packages/tools/network/simple-network-sync-134256

Not only does it apply the lerp and other fail safes (such as jumping forward to catch lag if nesesary), it also has bit packing. It basically means it takes long numbers and makes them shorter. (For example, floats are usually longer than they need to be internally). This can save on RPC/sync data.

I am 'hoping' my next tut should be out in the next 3 days :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon PUN2 multiplayer updating is choppy
« Reply #2 on: July 31, 2019, 03:01:32 AM »
Hi,

 When you have this kind of problem, make sure you test with the actual PUN2 demos, not the one made with PlayMaker, and check that they work properly or not regarding that choppiness, you'll likely find that it's the same and is related to a bad region selection ( a region too far from you will have lots of latency), or that you badly implemented synchronization, PlayMaker simply send datat and receive data the usual way and that's not the bottleneck for choppiness, it's either the network, or the photonView setup or a bad/buggy smoothing logic.

Bye,

 Jean

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Photon PUN2 multiplayer updating is choppy
« Reply #3 on: July 31, 2019, 01:54:00 PM »
As tcmeric suggested, Photon Transform View was what I needed to fix the problem. Manually getting/setting was the cause of the choppiness.

Thanks, Eric and Jean!

starkido

  • Playmaker Newbie
  • *
  • Posts: 1
Re: [SOLVED] Photon PUN2 multiplayer updating is choppy
« Reply #4 on: April 03, 2020, 11:46:34 PM »
I have followed this with varying success but I was wondering has anyone done this with VR and the Camera Rig?