About P2P performance and about P2P in general

Hello. Recently I was testing out P2P in GDevelop, with a use of example found on this forum I managed to create a simple multiplayer game. I implemented some events and came up with this.

Sender

Receiver

Basically I’m trying to synchronize the game on both instances.
What do you guys think? Is this the correct way of making sure data is the same on both clients?

I’ve noticed that it definitely decreases the performance of the game. But it could be the case of running two game instances on one machine, idk.

Some people use methods like this one:

Sender

Receiver

But in my opinion that’s not really effective, the game would basically desynchronize after few minutes of playing.

What are your takes on P2P, how does your game do it? It would be awesome if anybody could share their knowledge.

1 Like

Hi,

Is that a guess or something you noticed?

The data loss setting is here to avoid desynchronization, I believe. Try toggling it to yes if you run into issues.

Nah this is something that obviously will lead to desynchronization, because the behavior of a key press depends on variables that are client specific, like TimeDelta, and high variability variables, like the current velocity of the object. Since frame rate differs and the network is always slow and irregular, meaning it will always arrive at different moments a bit later on every client.

Data loss is to avoid data losses, not help with desynchronization. All that it does is, when turned in “no data loss mode”, when receiving an event twice in the same frame, the other will be queued for being handled next frame. In data loss, only the last event trigger is kept, which is useful when sending for example a position, where older ones doesn’t matter, only the current one does.


I think that take of mine is still pretty to the point:

1 Like