About the world coordinate system

For a voxel game like mechaenetia, it could be easy to consider a Cartesian coordinate, and use fp32(float) for positions and movements, like in many games including Minecraft. Could other coordinate systems be better for such a game?

Here are some thoughts about it

  • Integer-based system
    For an irl planet it would have a typical scale of 1E7m, so a local coordinate with int32 could reach a resolution of centimeter, which should be enough for such kind of game.

  • Mixed type coordinates
    If int16 is used, it can represent positions of large chunks, with a size less than 1km. Then inside a chunk the planet’s curvature is neglect-able, and another int16 or float can be used inside the chunk.

  • Position-dependent coordinates
    Like the way in this topic Trying to map a 2d array into a disk - #53 by Fyrstikkeske , draw non-Euclidean coordinates based on the planets’ shape. Could be simple for islands/caves, but may need some algorithms for customized planets, and the rendering system if it’s based on the octree structure.

  • Fixed-direction voxels
    Every voxel on a planet have the same facing direction, so it would be easy after planet initialization. But things like fluid simulation might be a little complex.

1 Like

Also remember that the further away regions are very simplified in their rendering, making it much easier to render them since you have low level of detail.

There wont be any need to render any planetary curvature around the player. The Game will be a Flat World pretending to be a Torus to say it in simple terms.

Coordinates themselves will be “offset from each regions bottom left corner” or so, so negative Coordinates are not going to be a thing (if they are negative, you warp into the next Region, hopefully seemlessly)

Block Positions will likely be 16 bit unsigned integers. and also per Region.

Entity Positions will be some form of floating point most likely. Also offset from the Regions Point of Origin