Minecraft Transit Railway (Automated trains, planes, and more!)

Minecraft Transit Railway (Automated trains, planes, and more!)

1M Downloads

Rails get weird when x or y is really big

TSStudio opened this issue · 3 comments

commented

2022-05-04_14 43 05
(Ignore the effect particle, not related to the issue)
Tracks just get messy, which I guess is caused by the precision of float/double.

commented

Thanks, for bringing up this issue. I'll tell the creator about this. Though, We dont really recommend builds that are in extremely far areas, though there are servers with stations around the 100k mark;.

commented

So I viewed the code and this may caused by common/src/main/java/mtr/render/RenderRouteBase.java, in which the methods include variables with float type. And in IEEE754 standard, float(32bit) contains 23 fraction bits, however, the position of the rails are 3x10^7. And log2(3*10^7)≈24.838>23, causing precision lost.

Possible solution: replace "float" with "double". This may need to rewrite the whole render system(including train renderer) and will be a big task.

commented

This should be fixed in 4.0.0. Please reopen this bug if you still encounter this issue with 4.0.0, thanks!