0
\$\begingroup\$

I'm interested in making a Minecraft-like voxel world that's spherical.

Idea is that there is a sphere which consists of cubes like in Minecraft but they are on the surface of it. The player can go around the world and come back to their starting point.

How can I build something like this?

\$\endgroup\$
2
  • \$\begingroup\$ Possible duplicate: gamedev.stackexchange.com/questions/45167/… \$\endgroup\$
    – House
    Jul 17, 2013 at 14:10
  • \$\begingroup\$ A minecraft youtuber named Jeija did this project recently as a proof of concept in minetest, an open-source voxel game engine. Here is his video demonstrating the math behind this: youtube.com/watch?v=joFWr3JzBOI You can download a built version of the version here: github.com/Jeija/spheretest/releases This is not a full version, however, and there are some bugs, but at first glance it works great, with just some minor rendering issues. EDIT: As stated in the comments, the world is not actually spherical but toroidal. \$\endgroup\$
    – sam1370
    Jul 6, 2019 at 4:45

3 Answers 3

2
\$\begingroup\$

You can't represent a sphere by cubes in a nice way. There is always going to be a distortion.

The 'best'/easiest way would probably be a cubemap approach. Check out this page for an interesting discussion about it. The image about halfway down of a cube and sphere shows the distortion of the squares. It is quite large.

If you are not constrained to cubes, then this question recieved a lot of useful information regarding spherical representatons. Triangles or hexagons are a slightly better fit than cubes.

\$\endgroup\$
2
  • \$\begingroup\$ Does anyone tried to "fold" minecraft-like world on sphere and calculated smallest distortion to make it look like flat? Anyway I mustn't go all down to center - just a layer. \$\endgroup\$
    – arseniuss
    Jul 17, 2013 at 8:59
  • \$\begingroup\$ You could try somethign like this to fake it: gamedev.stackexchange.com/questions/17567/… \$\endgroup\$
    – DaleyPaley
    Jul 17, 2013 at 9:04
1
\$\begingroup\$

After 9 years I found nicer solution.

Since the world do not need to be ideal we can a bit "cheat" by allowing some error from ideal cube. Jordan Peck has proposed solution like this:Structure

If we take just a splice of this solution we can create spherical worlds without "space folding".

Demo and more videos can be found here: Jordan Peck home page

\$\endgroup\$
0
\$\begingroup\$

If the player won't be able to ever see it as a sphere (eg. by going to high altitude), you can fake it. Make 'normal' voxel world, but wrap it at the borders. Trying to load chunk [-1, 5]? Return [MAX_CHUNK, 5]. Want to visit [MAX_CHUNK+1, 5]? Oh, you mean [0, 5].

This way you won't get nice "hills rising from above the horizon as you get closer" effect, but it can be seen by the player as a normal draw distance limitation. You also will not be able to dig a tunnel through the core of the planet. On the other side, programming it is pretty straightforward and it should work as fast as normal voxel world.

You can add shader warping the models as if the world was a sphere, but observed curvature might not match world's size.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Note that applying this wrapping on one axis gives you a cylindrical world, and applying it on both axes gives you a torus-shaped world. You can still display it bent like a sphere locally like a Sonic 3 special stage but if the player maps out the connections between distant locations, the map they get won't correspond to a sphere. \$\endgroup\$
    – DMGregory
    Aug 5, 2019 at 11:55
  • \$\begingroup\$ Tetrisphere used this, made it look like a sphere, and casual players didn't realize it wasn't a sphere :) \$\endgroup\$
    – user253751
    Dec 5, 2022 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .