What would be the best way to achieve synchronization of dynamic values across all running servers of an experience?
E.g. A dynamic economy where prices rise and fall depending on player interaction, the value of this economy would need to be in sync across every server to avoid players rejoining new servers in order to achieve lower or higher prices
And to add to this; how could you synchronise random world events the same way?
I don’t know how to do any of that.
There is 2 main ways of fixing this problem.
-
Use a seed algorithm. It would give you a price back depending on the number you give. Math.Sound can work if you use it right. I would then recommend using time since game launched to be the number. That way all the values will always be the same and no risk of servers lagging and other problems involving servers not having players in them.
-
Have datastore that tells you if your server is the price setter. If it is then you either store it, or you global message it. If the server hasn’t been selected yet (players left or new update) then I would recommend a global message and the first server to put their server id as the the server is the new price setter.
I recommend 1 personally