Cubyz icon indicating copy to clipboard operation
Cubyz copied to clipboard

Replace f32 with f64 in terrain generation

Open OneAvargeCoder193 opened this issue 1 year ago • 5 comments

Screenshot 2024-06-16 145521 It causes very buggy terrain far out

OneAvargeCoder193 avatar Jun 16 '24 18:06 OneAvargeCoder193

I think a better solution would be to only use relative coordinates, or maybe store some fixed point format.

related issue: #311

IntegratedQuantum avatar Jun 16 '24 18:06 IntegratedQuantum

I think a better solution would be to only use relative coordinates, or maybe store some fixed point format.

related issue: #311

We could store a u64 fixed point, which could get all the way up to the integer limit but also would have 1 over the integer limit precision

OneAvargeCoder193 avatar Jun 16 '24 19:06 OneAvargeCoder193

We could also try a i32 fixed point, where the top 16 bits are cut off. Then only for seeds and stuff we'd get the top 16 bits from another variable.

IntegratedQuantum avatar Jun 16 '24 19:06 IntegratedQuantum

And in some places, like the biome generation, it might just be enough to use a normal i32 with one block of precision

IntegratedQuantum avatar Jun 16 '24 19:06 IntegratedQuantum

I think a better solution would be to only use relative coordinates, or maybe store some fixed point format.

Using relative coordinates would also fix a similar issue in collision detection. Currently both collision detection and biome generation crash near/at the integer limit.

ITR13 avatar Sep 05 '24 19:09 ITR13

I don't think buggy farlands are something that we should bother about. Honestly it might even be considered more of a feature than a bug.

IntegratedQuantum avatar Nov 24 '24 20:11 IntegratedQuantum