hi....
didn't know where else i could ask for help on this... i need some sharp brains to help me out....
the problem:
i'm building a multiplayer billiards flash game.... the game is simple enough, just point and shoot... anyways, i got all that sorted out and the game is running fine
but now, i'm delving into developing it for multiplayer....
i've created a little server in C++ using the Qt library - works and all, no problems there... it's just a big bumb relay, anyways...
the problem is trickier....
my first approach, which i'm currently using is this:
when a player shoots the cue ball, the X and Y vector components of his shot are wired over through the server onto the other player...
this works, to an extent... i can replicate shots on both sides without much fuss....
but look at this:
after a number of shots - de-sync occurs... even though there are absolutely NO random or non-deterministic factors of ANY kind, and numerical rounding errors being corrected with RK4 integration - there's still a large difference in the outcome of an identical shot in two different instances.....
i figured it was a matter of a small error that would accumulate over a series of shots, so i devised a correction system that would match the position of all balls according to the positions on the shooting player's side....
correction does work.... but only to an extent.... sometimes, the disparancy between the two is so severe, that i get balls falling into pockets on one side and not on the other... all this within the course of a single shot :facepalm:
i don't wanna have to run the entire shot in advance then relay the movements to the other side... this would force a player to wait for the other end to completely stop before he can see what the other guy did....
no, that's unacceptable....
so i need ideas....
how do i ensure synchrony on both sides without having to wait for a complete stop?
didn't know where else i could ask for help on this... i need some sharp brains to help me out....
the problem:
i'm building a multiplayer billiards flash game.... the game is simple enough, just point and shoot... anyways, i got all that sorted out and the game is running fine
but now, i'm delving into developing it for multiplayer....
i've created a little server in C++ using the Qt library - works and all, no problems there... it's just a big bumb relay, anyways...
the problem is trickier....
my first approach, which i'm currently using is this:
when a player shoots the cue ball, the X and Y vector components of his shot are wired over through the server onto the other player...
this works, to an extent... i can replicate shots on both sides without much fuss....
but look at this:
after a number of shots - de-sync occurs... even though there are absolutely NO random or non-deterministic factors of ANY kind, and numerical rounding errors being corrected with RK4 integration - there's still a large difference in the outcome of an identical shot in two different instances.....
i figured it was a matter of a small error that would accumulate over a series of shots, so i devised a correction system that would match the position of all balls according to the positions on the shooting player's side....
correction does work.... but only to an extent.... sometimes, the disparancy between the two is so severe, that i get balls falling into pockets on one side and not on the other... all this within the course of a single shot :facepalm:
i don't wanna have to run the entire shot in advance then relay the movements to the other side... this would force a player to wait for the other end to completely stop before he can see what the other guy did....
no, that's unacceptable....
so i need ideas....
how do i ensure synchrony on both sides without having to wait for a complete stop?
Last edited:
