←back to thread

Making Minecraft Spherical

(www.bowerbyte.com)
899 points iamwil | 2 comments | | HN request time: 0.411s | source
Show context
reactordev ◴[] No.45093496[source]
You should definitely have a look at space engineers. They have a similar spherical problem with their voxels and I don’t think they went half as far as you did when implementing “orbital bodies”.

As someone who is rather keen on space, gfx, and the algorithms that render them. Kudos. The problems were known to me, which is why I didn’t attempt it, however - the distortion correction, the chunking, I’m thinking if you just limit how far down you can dig (half way to the “core”) it will be fine. You won’t run into those tiny squished blocks that make up the core.

It’s also important to call out the quad-sphere. This is what makes it doable. Naive devs may just map lat long to sin cos spherical coordinates and call it a day, not realizing that their poles are jacked up. The cartography problem. I’m really glad to see that called out as people don’t realize WGS84 sucks for mapping a sphere.

replies(6): >>45093544 #>>45095325 #>>45096426 #>>45097275 #>>45100369 #>>45101586 #
lsaferite ◴[] No.45093544[source]
Not allowing excavation to the core solves weird gravity issue as well. Astroneer had super weird gravity at their planet core. You can get stuck oscillating there.
replies(4): >>45093570 #>>45093591 #>>45097449 #>>45127679 #
jacquesm ◴[] No.45093591[source]
That actually sounds pretty close to what I would expect to happen IRL. After all the mass is mostly all around you at that point and depending on how far you are towards the core you might build up speed, overshoot the target and then do it all over again.

But hollow planets are hard to come by so this is just my imagination, I'm sure someone has worked out exactly what would happen.

replies(1): >>45094934 #
1. gizmo686 ◴[] No.45094934[source]
Newton worked this out in what is now know as the shell theorem. If you have a hollow spherically symmetric body, then any point inside of the body experiences no net gravitational force. In contrast, points outside of the shell experience the same force as if the body were a point mass.

For ideal (spherically symmetric) planets where a point is underground, you can divide the planet into 2 regions. The shell of the planet "above" the point has no net effect, while the shell below has the full effect, resulting in the gravity falling towards 0 as you approach the center.

In practice, planets are not actually spherically symmetric, but are close enough for it to be a good approximation.

replies(1): >>45095770 #
2. jacquesm ◴[] No.45095770[source]
That's super interesting, thank you for posting this!