-
what are ur player doing , if is position, any new message from a player override the position, BTW the message are order according the time they were received.
did you try the example named "Test MultiPlayers" try add 8 gamer and see how it work.
see that message are coded by you so they won't be mixed and loose them.
-
I've already set up the system and it works nicely,
(congrats for the great suite of GPG objects you provided us, btw! :D)
I'm just looking to understand the whole process to make sure I'm using the best possible way
to minimize lag and optimize gaming experience
(es. I'm already interpolating positions when predicted movement is off by a number of pixels etc.)
Of course I'm not sending raw x,y positions every frame cycle,
otherwise I would flood the communication with a huge data stream,
I'm sending direction and acceleraion changes,
(whenever a player starts/stops moving, whenever a player changes direction)
works quite nicely, minimum lag so far.
However, I'm only able to test on two devices, two players, currently.
So I was thinking at possible issues on additional players.
Another "extreme" example:
say I have an event (which I don't have XD, but just to explain)
always >>> send my X,Y position to all
each player would be always (30 times x second) sending a datastring like ID|X|Y
to all other players
so the "on data received" of each player,
polling the received data at the same frequency of 30 times x second,
even if there is a "push", that's anyway the max frequency the app can poll,
so it would easily receive something like this,
from all (or let's say "some" of the) other peers in the same frame cycle:
1|X|Y
2|X|Y
3|X|Y
4|X|Y
5|X|Y
6|X|Y
7|X|Y
in short, it would find a number >1 of datastrings when it polls for new data
...am I wrong?
then what would it output?
a random datastring among the ones received?
would buffer datastrings? (but how to buffer if the stream is constant?? some package has to be lost)
Again, my system obviously does not work like this, always sending data,
so this scenario is far less likely to happen,
but unless there's some logical flaw in my understanding of the process,
I can see as some overlap among received data (more than 1 message received at the same time) could occur
..and was wondering what would happen in such cases.
-
mm, don't know if I get your idea, hope I do, but this amount of data is not much really, hard is how you as dev handle this data, (your example is the best "always") guess that if you receive a message and stop everything to attend the position this will cause a problem, what is pain in real player is if one or two of the gamer have slow connection and that for the others user will delay their position or any information from them.
the way you are conceptualizing your game for movement, using somehow a vector and speed is a wise manner to handle this, and each game will certainly require a specific way to do it
here is something that I always said through all post, use "always" wisely.
-
I think I've failed to explain myself clearly X) - sorry.
But nevermind - there's high chance this can be considered nitpicking I guess.
I'm fine with what I'm having so far, if I ever get into the problems I was speculating above,
I will come back and try to explain myself better, and provide some real-use example/data.
Thank you very much for you time, informations and tips :)