4
\$\begingroup\$

This is sort of a multidisciplinary question, so I'm asking it here rather than on one of the other Stack Exchange sites.

I've been toying with the idea of making a game that's a mix between Minecraft and Kerbal Space Program, where the world is actually a planet and can be traveled around (either on the ground or in orbit) seamlessly, yet still consisting entirely or mostly of cubes à la Minecraft. It turns out this is actually incredibly difficult to wrap my head around!

There are a few requirements and concessions.

Requirements

  1. Must be able to travel and build on all parts of the planet seamlessly (poles included)
  2. Every tile must be able to be mapped exactly or roughly to a spherical coordinate.

Concessions

  1. Planet's perceived 'radius' at varying depths can be uniform.
  2. Depth of buildable area can (and should) be limited, meaning you don't need to be able to tunnel into the center of the planet and you don't need to be able to make an absurdly large tower.

Those are the main points, and the problem is open to interpretation and more concessions are able to be made so long as the illusion of being on a planet is maintained.

Initial Idea

Here is an I've had that may have some merit but I'm not sure if it'd actually work.

Tesselated Platonic Solid

enter image description here

The idea here is to create a 'virtual' sphere made of a patchwork of faces of a platonic solid (e.g. cube, icosahedron, octahedron). The faces represent a plot of flat land, with each edge being the 'portal' to another faces and so on. In this way the world is always 'flat' and you are basically traveling over a 2D unwrap of the original shape.

One of the problems with this method is that with some tesselated platonic solids (such as the cube above), the tesselated faces are warped and the surface area of each face is not uniform. A little bit of this is acceptable, but not too much.

The Question

The real question here is ultimately "is this possible?" and if so, what would be the best method to achieve all of the requirements. If not, what kind of concessions would I need to make to make a believable world?

\$\endgroup\$
5
  • \$\begingroup\$ Possible duplicates/related: gamedev.stackexchange.com/questions/45167/… gamedev.stackexchange.com/questions/59273/… \$\endgroup\$
    – House
    Aug 27, 2013 at 1:19
  • 1
    \$\begingroup\$ The hand-wavy "a little bit of this is acceptable, but not too much" criteria kind of makes this impossible to answer in any meaningful way. It all comes down to each individual's personal opinion about what trade-offs are fair. As you've already noted in the answer below, where the answerer's suggestion was apparently okay according to his own opinions, but rejected by you as "not acceptable behaviour". \$\endgroup\$ Aug 27, 2013 at 2:26
  • 1
    \$\begingroup\$ I don't think that it is 'hand-wavy' to reject things that have obvious flaws as opposed to more subtle ones. I was trying to convey that I'm not looking for a perfect solution, just a good one. \$\endgroup\$ Aug 27, 2013 at 4:27
  • \$\begingroup\$ Well.. will this fit the bill? en.wikipedia.org/wiki/Geodesic_dome \$\endgroup\$
    – teodron
    Aug 27, 2013 at 13:30
  • 1
    \$\begingroup\$ If you need to understand why it won't work with quad patches, you must understand what a non-parallelizable manifold is and that the sphere, having a constant positive Gaussian curvature everywhere cannot be developed onto a plane without distortions. The best you can get are either equiareal or harmonic projections. \$\endgroup\$
    – teodron
    Aug 27, 2013 at 13:33

3 Answers 3

5
\$\begingroup\$

I would cheat, and represent each planet as a flat plane in terms of "cubelets" and graphically wrap the plane around the sphere for distance POV. This will work as long as you don't have tiny planets (IE: from the surface, the planet is big enough to appear flat).

The other option is to simply construct the entire planet out of cubes, including the interior. Which would use an extraordinary amount of memory/disk/etc.

When in doubt, cheat :)

\$\endgroup\$
2
  • \$\begingroup\$ The issue with the first method proposed is that it is highly subject to distortion at the poles and about the equator. This means it would take just as long to circle the equator as it would the north or south pole, which is not an acceptable behavior. The second method is out for the obvious reason of memory limitations, but also because the planet's gravity normal wouldn't be paralell to the blocks' 'up' vector, so you would start to 'lean' as you moved around the planet. \$\endgroup\$ Aug 27, 2013 at 1:23
  • \$\begingroup\$ The other option is to just use polar co-ordinates for on surface blocks but you will always have slight gaps between blocks. Might be a better idea to mix approaches and simply "cheat" for the poles. \$\endgroup\$
    – Matt D
    Aug 27, 2013 at 1:26
2
\$\begingroup\$

Would you be amenable to using a triangular grid as opposed to a square one? If so, I think the worst-case distortion can be reduced, relative to using a square grid.

If your planet is "really" an icosahedron before your rounding effect is applied, then each face can be covered with a grid of equilateral triangles, as densely as you like. The icosahedron approximates a sphere more closely than any other platonic solid. The only distortion occurs at the 12 vertices of the icosahedron, where you'd have 5 triangles joining instead of 6. (A shortfall of 60 degrees, a third less than you'd get with squares).

If you can control where the continents end up, you can ensure these 12 problem points are located in the middle of oceans, so they don't impact typical gameplay. (See, for instance, the points of the Dymaxion projection)

Your unit of construction would then be a triangular prism, rather than a cube. These are a bit trickier to work with, but you may be able to make that a natural part of your game's aesthetic.

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

Make a variable Scale of the Planet,and a variable Distance and Position,distance receives a relativity of Position(x,y,z) of block and the Center of Mesh. And make a if(Distance <= Scale) { MakeVoxel(x,y,z,Material); } Ok.

\$\endgroup\$

You must log in to answer this question.

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