Hey, I’ve never used Peer-to-peerq and have it all hooked up but a lot of the time one of my players will end up in a different location on one screen than he is on the other. Is there and easy way to occasionally correct the entities location so both players see the same thing? Or just a way to limit the differences.
My games P2P does not need to be perfect but it is a two person platformer.
Synchronization is a mechanism that you make in P2P. If desynchronization happens, then that means you must have done your synchronization logic in a bad way. Please share your events for us to tell you what it is you’ve done wrong.
I don’t think I ever have posted such an example, and if I did, please tell me where so that I can delete that. Simulating key presses is not a way of keeping games in sync. Instead, you should send for example the position of an object, since with that you are guaranteed that the mutation to the state of a game you make will make it reflect the other game’s state.
If it is not smooth enough, use tweens instead of setting the position to the newly sent one to still have some movement until the next position update.
hey, i know this is very crude and morally questionable but i downloaded that example and copied it into my project. I don’t understand any of this at all and I’m just doing this for learning purposes. i was wondering if you could tell me what I’m doing wrong.
I’m trying to make a 1v1 arena game and so I have two players at the start of each scene. I applied your code to “player1” and essentially changed every “enemy” to “player1” also both players are already created so i removed that.