I’ve been working on multi-purpose networking for synchronizing visual elements such as sounds, effect activation, animation sequences and more, but I saw that :GetServerTimeNow() is very expensive and I’ve been searching for alternatives which are better.
I’ve made simple DateTime implementation of this, but I’ve also realized that it can be very flawed because of the possibility of time not being synchronized properly.
I’ve thought about the possibility of simply kicking players which do not meet these demands, but that could negatively affect player traction to my game.
I’ve been considering just simply having counter where :GetServerTimeNow() synchronizes it occasionally and I will most likely have to do this.
If anyone has any additional ways of doing this feel free to mention it here!
you can try creating NumberValue at ReplicatedStorage, it less expensive than :GetServerTimeNow() because you just handle builtin signal NumberValue.Changed
also u can try ping pong system with remote functions but i think it will be expensive for network
Please don’t reinvent the wheel.
You are on a right path with your original solution.
Althrough you don’t need syncronizing it that often.
You can do it like every hour just to be sure but doing it only once is more the enough to get right offset.
He is talking about creatin NumberValue instance inside the Replicating storage and updating it on server.
He doesnt account to the fact that we live in 3D world and not 4D world and that recive time exists.
I will be doing this solution, however I’m interested why should it be updated only once per hour? I know it is in unix miliseconds, but how would you count this accurately?
My idea was using RunService Stepped loop while using deltaTime which should work fine? But deltaTime could be imprecise because of, yet again float-point precision
Client can simulate time too.
You only need to know offset as since it should not change at all (unless windows randomly decides to syncronise your clock out of nowhere)