gnembon / fabric-carpet

Fabric Carpet
MIT License
1.72k stars 275 forks source link

Effect timers always run at the same speed visually, causing large desyncs with "/tick" #262

Closed James103 closed 4 years ago

James103 commented 4 years ago

I don't know if this is already been fixed, but as of Carpet Mod 1.3.20 in Minecraft 1.15, effect timers do not visually tick down faster or slower than normal even when the game is running faster or slower than normal due to lag, /tick warp, /tick rate, and /tick superHot.

For example, if you give yourself 20 minutes of an effect, then do /tick warp 24000, it's possible for the effect to run out even when the timer is at 19:30. And no, a command is not clearing the effect, it's just the timer hitting zero.

Ghoulboy78 commented 4 years ago

Behaviour is still there in most recent release (1.3.22)

It may be related to how gnembon pointed out in one of his vids that the game skips certain calculations that it considers not crucial when running faster or slower. This may be in the vanilla game as whenever the game goes more slowly for a while, it then speeds back up for a while to compensate for the lost ticks, and then the timer is technically still accurate. See: "How to kill a tango using invisible creepers and cod AI" to see what I mean

gnembon commented 4 years ago

not sure how to replicate that: 2020-05-12_20 47 14

gnembon commented 4 years ago

seems like effects tick down like world ticks

James103 commented 4 years ago

The screenshots you attached show the internal data, which is stored in the player NBT server-side. The following shows both the server-side effect time (in the form of a bossbar where each notch represents one minute) and the client-side effect time (as numbers on the inventory screen):

Before tick warping: image

After /tick warp 6000 (5 minute desync): image

4 real-life minutes later (the effect will run out server-side within 5 seconds): image

I believe this is a vanilla bug that is more easily exposed here due to the /tick warp command.

gnembon commented 4 years ago

ok, seems like its only a cosmetic bug - when effect runs out, server clears it. Client can track if the effect is running out slower when server lags out, but when the server runs faster - it keeps real life pace of seconds. I will try to find a reason for that but it doesn't seem to be that important

gnembon commented 4 years ago

ok, won't fix. Client status effects are ticked down according to client speeds. Part of the appeal of tick methods is that client handling is capped at 20tps, so clients won't be going crazy slow/fast as tick rate, but at normal speeds. Ticking down potions is part of it. potions are cleared / applied from the server anyways, so practically this has no difference.