#TimeManager.TicksToTime(TimeManager.GetPreciseTick(TickType.LocalTick)) is not linear!

11 messages · Page 1 of 1 (latest)

undone kayak
#

It is my understanding that LocalTick increases linearly on the client and server. Shouldn't TicksToTime on a PreciseTick constructed using local tick always increase linearly? I logged the result of the above code on my server and got the results seen in the attached image. As you can see, this time does not increase linearly.

scarlet valve
#

@undone kayak it should always be incremental for localtick.

undone kayak
#

@scarlet valve Could you possibly try logging the line of code that I put in my title? To me, it doesn’t appear to be incremental. Perhaps there is a bug in the
Time Manager? LocalTick is always incremental, I was able to confirm that. But there’s something weird going on when you get a PreciseTick using LocalTick, and then covert it to a time. You would think the time would increment linearly, but it doesn’t appear to.

scarlet valve
#

That is interesting then... it could be rounding

#

although I guess that doesnt make sense because that would also be linear

#

Can you file a bug report please.

undone kayak
scarlet valve
#

ty

scarlet valve
#

Correct method

        public double TicksToTime(PreciseTick pt)
        {
            double tickTime = TicksToTime(pt.Tick);
            double percentTime = ((pt.Percent / 100) * TickDelta);
            return (tickTime + percentTime);
        }```
undone kayak
#

Awesome, thank you! Yeah, I thought that might have been the issue after debugging it further.