First i need to call srand( server_seed );
System srand() is one of those sources of nondeterminism you cannot control yourself.
Implement your own pseudo-random generator, such as linear congruential (super simple,) XOR feedback register (slightly harder,) hash-based (also simple,) or even the Mersenne Twister (probably overkill.)
Then you can know that it always gives the same results everywhere, assuming everyone calls the same generator in the same order.
How to sync start game properly?
That's why I said you have to worry about latency.
Generally, the goal is not to make everything happen "at the same time" across the globe -- that concept ends up being meaningless in the presence of the speed of light (!)
Instead, the goal is to make sure everything happens "in the same order" across all participants.
This means you treat game simulation using well-defined simulation time (usually, 'tick numbers')
You still have the trade-off that you either have to wait for getting the inputs from everybody for tick T before you can simulate/show tick T (input latency)
OR you have to display other people "behind" the local player, and try to fix up any interactions that would disagree because of this
OR you have to try to forward-extrapolate other people on the local device, and try to fix up any interactions that would disagree because of this.
First i need to call srand( server_seed );
System srand() is one of those sources of nondeterminism you cannot control yourself.
Implement your own pseudo-random generator, such as linear congruential (super simple,) XOR feedback register (slightly harder,) hash-based (also simple,) or even the Mersenne Twister (probably overkill.)
Then you can know that it always gives the same results everywhere, assuming everyone calls the same generator in the same order.
How to sync start game properly?
That's why I said you have to worry about latency.
Generally, the goal is not to make everything happen "at the same time" across the globe -- that concept ends up being meaningless in the presence of the speed of light (!)
Instead, the goal is to make sure everything happens "in the same order" across all participants.
This means you treat game simulation using well-defined simulation time (usually, 'tick numbers')
You still have the trade-off that you either have to wait for getting the inputs from everybody for tick T before you can simulate/show tick T (input latency)
OR you have to display other people "behind" the local player, and try to fix up any interactions that would disagree because of this
OR you have to try to forward-extrapolate other people on the local device, and try to fix up any interactions that would disagree because of this.