playMaker

Author Topic: Photon Network delay problem  (Read 2450 times)

NewTo

  • Playmaker Newbie
  • *
  • Posts: 12
Photon Network delay problem
« on: April 08, 2019, 07:04:10 AM »
Hello,

I would need some help with my game, Im using playmaker and Photon network.
Im a total noob and I have no knowledge about coding, as you will notice Im not an expert at english too ... ^^
I uploaded 2 videos in case Im do not give clear explanations.

So, Im trying to make something like chuchu rocket. The game takes place on a checkerboard, some game objects move from the center of a tile to the center of another tile in a straight line.
Players can put arrows on the board to interact with the moving objects and change the path they take.
Each players can put 3 arrows on the field and they "fight" to bring the more game objects they can to a certain point. It will give them points but in the current state the game is unfair due to the one sided delay.

Lets call the players blue one and green one because of they put blue/green arrows.
They both connect to photon network.

When Green one puts an arrow on the field there is a little delay due to the ping and all that.
Also the game objects are a bit delayed on his screen.
My problem is linked to the delay, it seems to be too much on the green side. When Green one puts an arrow on the field at the last moment 4 game objects will go thro the green arrows which feels very bad.

When blue one puts an arrow on the field everything is instant, it's like he has 0ms delay, in fact he has 60ms with the server just like green one.
No moving object go thro any of the blue arrows, the interaction is always perfect just like in a solo game.
Blue one is the one that spawns the board and the moving game objects.

You can see all that in the videos.
Blue one has no delay, green one has all the delay.

What I would like is to have less moving objects able to go thro the green arrows but I do not know what to do, something like sharing the delay.
I think that I need a good balance,like both players to have a little delay and not one that has no problem and the other that have them all.

What do you guys think about that ?
Is it possible to find a solution using Playmaker and photon network or shall I abandon my project ?

-------------------
here are the files:

Here green one have too much game objects that go thro his arrow, you will also see what happens on the blue one screen
https://ufile.io/rggdp

Here you see what happens when blue one is putting arrows on the field, everything is perfect.
https://ufile.io/32fjh
-------------------

Thanks for reading ^^
« Last Edit: April 08, 2019, 07:41:29 AM by NewTo »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Network delay problem
« Reply #1 on: April 09, 2019, 03:08:02 AM »
Hi,

 I am failing to see the delay in the video, how did you measure 60ms? also, 60ms is not that bad to be honest.

but indeed since your game is very dependant on timing, enforcing this properly is going to be tricky with photon because photon logic is run on each client, so this is problematic, even if you would be down to 20ms for delay.

how do you work with photon? are you sending rpc to have these arrows setup?

 Exitgames has another multiplayer solution that paliates this, but it's using ECS and is expensive, but it enforces true synchronisation and has 0 lag! and such a game would be doable with this tech:

https://www.photonengine.com/en-US/Quantum#pricing


Bye,

 Jean


NewTo

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Photon Network delay problem
« Reply #2 on: April 09, 2019, 04:48:12 AM »
Hello Jean,

60ms is good I agree. I measured it with the action "photon get ping".

How do I work with photon ?
For the moment I put arrows on the board by using the "Photon Network Instantiate" action.
I use this same action to create everything, the board, the moving game objects, the players... I hope it answers your question.

I don't use RPC and I did not try it yet, do you recommend me to ?

About photon Quantum, it's really too expensive for me.

See you !

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Network delay problem
« Reply #3 on: April 11, 2019, 02:49:04 AM »
Hi

 for your moving pieces yes, you can create a prefab you instantiate and synch position with them, but for arrows, a simple RPC telling where to put the arrow and where it looks would be more than enough since it's not doing anything after.

 also, make sure that only one instance is running the simulation, else you will have deterministic issues and client will get out of sync, so use the Masterclient to control everything, and your players only send rpcs to the master, so all objects should be scene objects, and clients only reflect the current state of the game.

It's as far as you can go with PUN the simple way for a deterministic simulation.

 Bye,

 Jean