Hi, I am trying to write a multiplayer networking game and I would like to make the game as deterministic as possible. If I use transition.to to move an object across the screen is this deterministic?
If not, what should I be using?
Hi, I am trying to write a multiplayer networking game and I would like to make the game as deterministic as possible. If I use transition.to to move an object across the screen is this deterministic?
If not, what should I be using?
Deterministic in what sense? Final position? Time?
Are you expecting two players who start a transition to the same point at the same time to end up at the same place at the same time? They probably will (assume one doesn’t suspend the game) but you can’t use dead reckoning in multiplayer games, you have to sync player positions constantly or they will drift due to small differences between devices and the fact that starting two operations “simultaneously” on two devices is essentially impossible.
Deterministic in final position and time if they started from the same point at the same time.
Say, if I have an object at position x1, y1 at time t1, and I move it to position x2, y2 over a duration of 1000 milliseconds using the method transition.to(…), will the final position be x2, y2 and final time be t1+1000 on every device I run it on? Or could this vary depending on processing power, resolution, etc?
Thanks,
Graham
Deterministic in what sense? Final position? Time?
Are you expecting two players who start a transition to the same point at the same time to end up at the same place at the same time? They probably will (assume one doesn’t suspend the game) but you can’t use dead reckoning in multiplayer games, you have to sync player positions constantly or they will drift due to small differences between devices and the fact that starting two operations “simultaneously” on two devices is essentially impossible.
Deterministic in final position and time if they started from the same point at the same time.
Say, if I have an object at position x1, y1 at time t1, and I move it to position x2, y2 over a duration of 1000 milliseconds using the method transition.to(…), will the final position be x2, y2 and final time be t1+1000 on every device I run it on? Or could this vary depending on processing power, resolution, etc?
Thanks,
Graham
Hi Graham,
The only thing transitions vary on is the framerate. Since the principle of transitions is to modify object parameters every frame, if you use a lot of objects the framerate will eventually drop. In that case you can expect some anomalies, such as non-linear parameter changes in the transition. In every other case, the transitions are respecting the input parameters (are deterministic).
In network-based scenarios however, you have to work a bit further than the simple use of transitions. Depending on the type of game you are building, you might have to go from simple prediction operations upto estimating trajectories and direction vectors, velocity and force.
If you need more info, don’t hesitate to ask.
A great day,
Alex
Hi Graham,
The only thing transitions vary on is the framerate. Since the principle of transitions is to modify object parameters every frame, if you use a lot of objects the framerate will eventually drop. In that case you can expect some anomalies, such as non-linear parameter changes in the transition. In every other case, the transitions are respecting the input parameters (are deterministic).
In network-based scenarios however, you have to work a bit further than the simple use of transitions. Depending on the type of game you are building, you might have to go from simple prediction operations upto estimating trajectories and direction vectors, velocity and force.
If you need more info, don’t hesitate to ask.
A great day,
Alex