2 ms·
I think in practice you eventually reset the "time" variable to 0 and just accept that one weird discontinuity, if you care about it at all. Plenty of time the
by mrguyorama 4y ago
I think in practice you eventually reset the "time" variable to 0 and just accept that one weird discontinuity, if you care about it at all.
Plenty of time the "time input becomes too large" only happens after tens of hours of nonstop play.
- Joker_vD 4y agoYes, but again, if you care about accuracy, it's not as easy as "time = fmod(time, 1e6)" or something: take look at any "accurately rounding" implementation of sin(x) (e.g. in gcc) to see weird floating-math tricks used in the range reduction. Also, it is not always about time, sometimes it is about position in space! Generating an (almost) infinite world is usually done in the "animation" style (using a noise generator or some such) and with rounding/overflow errors you get e.g. Minecraft's so called "Far Lands" [0] — game physics used to break there as well. [0] https://minecraft.fandom.com/wiki/Far_Lands https://minecraft.fandom.com/wiki/Far_Lands