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.
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.
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: