How does the grid system work?


  • I've been fascinated by how this game works since I got it. I play games that use grid-based building a lot, and all of them handle worlds as flat, endless worlds (minecraft, 7 days to die, etc) or the worlds are so large that they can use square grids within them (Space Engineers).

    But this game...This is different. Now, if you project a grid onto a sphere you get a lot of issues normally. For example, bunching at poles, or distortion on Z-axes.
    I'm super curious how the latter problem is handled.
    I'm not a programmer, or a game designer by any stretch of the imagination. It seems to me to make a grid on a sphere you'd have to project evenly spaced lines out from the center (as z-axes) but then you'd run into a huge issue that at different elevations, blocks would be different sizes. I imagine the issue isn't a big deal as planets get larger and the difference between sizes at different elevations gets smaller, but for small planets this seems like a huge hurdle.

    Capture.JPG

    Of course, if it's a trade secret how it is done, all well and good. Hopefully I've opened the eyes of some people who might not recognize what a technically daunting concept this seems...at least to a development moron like me :P


  • 11
    Posts
    2601
    Views
    Log in to reply


  • I believe the trick they use is that the world is actually flat (thus each voxel is a perfect cube) and when you run to the end of the +x dimension, you wrap over to x=0. (This is why there are certain discontinuities, like carts having trouble passing the boundary.) The curvature of the planet would then be just an illusion, a purely visual distortion of the voxels on the horizon. The minimap might be a different story, I haven't really given thought to how they do that.



  • @Xelotath said:

    I believe the trick they use is that the world is actually flat (thus each voxel is a perfect cube) and when you run to the end of the +x dimension, you wrap over to x=0. (This is why there are certain discontinuities, like carts having trouble passing the boundary.) The curvature of the planet would then be just an illusion, a purely visual distortion of the voxels on the horizon. The minimap might be a different story, I haven't really given thought to how they do that.

    IT'S AN ILLUSION?!
    My childhood dreams are shattered :'(

    Though, that makes a LOT more sense that it works so fluidly (from a block-size consistency perspective)



  • Magic is only magic until you know how they do the trick =P



  • If I said it was ancient alien magic, would you believe me?

    • Ecoylent is not intended to replace every meal, but it can replace any meal


  • We got this code on a USB stick from the future. We dont know how it works, and we dont ask....

    Love the graph by the way!



  • @Xelotath said:

    I believe the trick they use is that the world is actually flat (thus each voxel is a perfect cube) and when you run to the end of the +x dimension, you wrap over to x=0. (This is why there are certain discontinuities, like carts having trouble passing the boundary.) The curvature of the planet would then be just an illusion, a purely visual distortion of the voxels on the horizon. The minimap might be a different story, I haven't really given thought to how they do that.

    That is right =) its how its done, btw space engineers does not do it ether as shown in the first image . dont think there is any game that does it this way.



  • I've been meaning to do a blog post about this for a while, as it has a lot of interesting (and sometimes frustrating) implications for numerous aspects of the world... I should get around to that...



  • @craig.jong said:

    If I said it was ancient alien magic, would you believe me?

    Honestly? Yess

    @JohnK said:

    Love the graph by the way!

    Thanks, I'm a draftsman by trade, I figured it'd be easier to illustrate the issue I though the grid system would cause rather than try to type it out.

    @NoBlackThunder said:

    That is right =) its how its done, btw space engineers does not do it ether as shown in the first image . dont think there is any game that does it this way.

    I didn't think SE did that, I think the just use a plain static grid on the world, but the planets are so large it doesn't cause an issue.

    @Metachronism said:

    I've been meaning to do a blog post about this for a while, as it has a lot of interesting (and sometimes frustrating) implications for numerous aspects of the world... I should get around to that...

    I would enjoy that. This is probably one of the coolest ways I've seen a grid-based game handled. Building a bridge, or carving a tunnel and seeing it curve away from you is mesmerizing.



  • @urb4n0ninj4 said:

    I didn't think SE did that, I think the just use a plain static grid on the world, but the planets are so large it doesn't cause an issue.

    space engineers is doing it the only other way currently available i know off .. they don wrap the world. and they dont use square voxel but diamond shaped voxels.. this way they can build a round world .. but that has also an issue. depending on where you are on the world voxels don change rotation, so building the exact same way down or strait path is way harder to impossible



  • Some technical detail on how this sort of thing is done: http://gamedev.stackexchange.com/questions/45167/square-game-map-rendered-as-sphere


11
Posts
2601
Views
Log in to reply

Internal error.

Oops! Looks like something went wrong!