Page 1 of 2

Minetest on a spherical planet

PostPosted: Thu Oct 06, 2016 19:59
by Jeija
I have made two YouTube videos on the (im)possibility of making the minetest world look and behave somewhat like a spherical planet. I thought I might share them with you. The title says Minecraft (because that is the more commonly known game and the math applies to both games), but this is acutally minetest. Click these pictures to watch them:


Image

Image

Download
You can get this game from my GitHub page with additional resources in the releases section.
You can also get a precompiled Windws build.

The planet_radius setting
The planet's radius is the number of mapblocks (=16x16x16 nodes) below sea level. So if
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
planet_radius = 2

then you can dig down to max. y = -planet_radius * 16 = -2 * 16 = -32 before falling through the center.

The planet's circumference is then calculated as ceil(planet_radius * Pi) * 16 * 2 (basically 2 * Pi * r, but rounded up to mapblocks). The flat plane is centered at the origin (x = 0, z = 0), so you the map wraps around to the other side at x/z=+/- planet_circumference / 2. For planet_radius = 2 that means you will "teleport" at ceil(2 * 3.14) * 16 * 2 / 2 = ceil(6.28) * 16 = 7 * 16 = 112.

Does the the server or the client need the planet settings?
Both server AND client need to have the SAME settings to make the planet work. Connecting with a spheretest client to a minetest server generally works, but things like active blocks and objects (other players, items, mobs) close to planet edges will be broken. This is of course far from ideal (ideally, the radius should be defined at world creation and synced from the server to the client), but that is because spheretest is only a demo.

The center of the planet and planet_keep_scale
If planet_keep_scale is true, aspect ratios of blocks are preserved. Since there is the same density of blocks close to the core like on the surface, this implies that there is no center point, there will always be a empty space underneath you.
If planet_keep_scale is false, aspect ratios are not preserved. The further down you go, the narrower the blocks get. This means there will be a center point, but the world gets very glitchy down there.

I can't see across the edges. It just teleports the player!
You are propably on a very large planet. Spheretest has only ever really been tested with planet_radius <= 5. If you can't see across planet edges, please make the planet small enough and adjust your viewing range to 500 or more (smaller planets will also work fine with smaller viewing ranges):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
viewing_range = 500


How do you like it?

Re: Minetest on a spherical planet

PostPosted: Thu Oct 06, 2016 21:25
by Krock
<3 it.

Image

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 00:43
by lightonflux
Great work. With a map gen that is aware of the sphere setting it would make an astonishing feature that afaik no other voxel game has. Would really help to "sell" minetest.

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 10:06
by Naj
That reminds me maps on freeciv. The settings allow to have a cylinder (East-west wrapped) or donut world (E/W and N/S wrapped). The maps stays flat, but you can go around the world.

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 11:11
by azekill_DIABLO
Jeija wrote:I have made two YouTube videos on the (im)possibility of making the minetest world look and behave somewhat like a spherical planet. I thought I might share them with you. The title says Minecraft (because that is the more commonly known game and the math applies to both games), but this is acutally minetest. Click these pictures to watch them:


Image

Image

You can get this game from my GitHub page.

How do you like it?


Hail Jeija. this is. AWESOME§§§§§§§§!!!!!

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 11:16
by azekill_DIABLO
Is there a compiled version? im a noob with compiling

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 11:44
by Krock
azekill_DIABLO wrote:Is there a compiled version? im a noob with compiling

For the case you're on Windows or have Wine installed:

Download 1: Override pack for a dev_MSVC installation (Dropbox, 7z archive, ~ 1.36 MiB)
Download 2: Megapack (GitHub, zip archive, ~31.3 MiB)
Source: https://github.com/SmallJoker/minetest/ ... SPHERETEST

Otherwise you can compile it yourself from the source link in the main post ;)

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 11:47
by azekill_DIABLO
ok i think i will need even more detailed explanation, in french if possible (don't know what do we talk in switzerland)

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 15:26
by firefox
=(0.0)= incredible

is it possible to create multiple planets in 1 world? guess not... but what about paramats skyland and layers mapgens? are they compatible?

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 18:37
by minos
azekill_DIABLO wrote:Is there a compiled version? im a noob with compiling

Me too :p
And wine don't want to launch the windows version (just nothig happen)...

Re: Minetest on a spherical planet

PostPosted: Fri Oct 07, 2016 20:32
by azekill_DIABLO
welcome to the forums ;P

you know, everything wih windows involved will bug.

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 11:49
by Jeija
I have now updated the first post with a precompiled Microsoft Windows version of the game, including all necessary changes to minetest.conf to make the planet happen as well as minetest_game, the satellite mod and several other mods and the demo world from the videos.
Thanks to sfan5 and Krock who helped make this happen!

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 12:14
by maikerumine
Your videos are very detailed and very well made. I foresee this project of yours opening the door to a nee future in voxel games. :D

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 13:24
by maikerumine
If anybody is interested, I set up a temp server at: 23.28.87.79 port 30003 Running ESM game on a 200meter radius world. :)

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 13:59
by taikedz
Haha Maikerumine you beat me to it :-)

I'm running a server for this too, albeit a very basic one ;-)

minetest.ducakedhare.co.uk : 31000 ; it's minimal and on low resources, since it really is only a proof of concept for now.

For anybody interested, you can also get a compiled run-in-place Linux binary here, http://helpuse.com/spheretest

Just do

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
git clone https://github.com/Jeija/spheretest
git clone https://github.com/minetest/mintetest_game minetest/games/minetest_game
cd minetest
mkdir bin
curl  http://helpuse.com/spheretest > /bin/spheretest
chmod 755 bin/spheretest
curl http://helpuse.com/minetest.conf > minetest.conf
nano minetest.conf # set your planet_radius to match that of the server!!
bin/spheretest


Quick vid:

https://www.youtube.com/watch?v=wMulYMzcKD8

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 14:24
by ExeterDad
@Jeija this is so amazing! I'm also impressed with your video presentations. You did a amazing job illustrating the math (even though it was above me for the most part).
I'm hoping we will see this go further so we can have a alternate way to play MT. Maybe even see the landscape tile with a mapgen other than flat.
Thanks for your work!

Edit: @taikedz... Oooops! Typo in your github urls! Loved your demo video as well :)

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 17:45
by taikedz
Thanks ExeterDad - took the opportunity to also change the minetest URL to Jeija's

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 21:21
by Fixerol
This is very cool. I like that shader effect, I'm a bit confused about planet radius setting, if I want planet radius with 16000 nodes, which number I need to set? Watched your videos too, a lot of explanation. This game explains earth curvature like a boss.

Re: Minetest on a spherical planet

PostPosted: Sat Oct 08, 2016 22:45
by taikedz
the planet radius is expressed in "blocks" - where there are 16 voxel nodes per block side, a block being a section of map 16x16x16.

I forget where I read about the block size, but I'm sure it's somewhere in the dev wiki....


It should also be noted that you can connect to any Minetest server with the Spheretest client ; it's the client that decides the size of the world used, nothing you set on the server will change that.

Probably for the next version

Also a wee bit o feedback - it could be of interest to cause the client to take the server's value (intergate it to the connection protocol?) And to possibly add a field to the "create" screen for local worlds to specify a radius at that point... Dunno how easy this is to do or not....

But being able to turn on "sphere mode" when the server exposes it, or during a world creation setting, would be fantastically awesome - and I would love to see this variant become an option in the official client.....!

I noted some were noticing that if you get to the "centre" (bottom) of the world, it looks like a core central sphere is missing from the botom.... it might be useful to incorporate the explanation at some point of this phenomenon, many still are seeing this as a sphere where there would be an actual "centre". Rather, I would explain it as a wormhole at the bottom of the world...

Re: Minetest on a spherical planet

PostPosted: Sun Oct 09, 2016 08:50
by Jeija
I have updated the first post to answer some of your questions, like what the planet_radius setting really does. If you can't see across the planet "edges", the first post should also explain how to fix that.

Unfortunately, I don't think I can continue working on spheretest or integrating spheretest into upstream minetest, just because I don't really have the time for it. If anyone wants to help out with spheretest, pull requests are very welcome. If you want to integrate spheretest into upstream minetest, then please go for it and use any spheretest code you like. Feel free to ask any questions you may have about my code / the maths / ...

Re: Minetest on a spherical planet

PostPosted: Sun Oct 09, 2016 10:09
by minos
Hi !

Thanks jeija (i am hydargos123), with your help i have compile this version for linux:
https://drive.google.com/open?id=0B2YZv ... 1JNNDdiNm8
I dont know if it work between differents computers, but you just have to extract the .zip and run ./bin/Minetest
I have added the mods "Sky night, Mesecons, Satellites and Torches".*Dont forget you can tweak settings in Minetest.conf! ;)

minos

Re: Minetest on a spherical planet

PostPosted: Sun Oct 09, 2016 10:13
by Onyx
Wow! More fun in Minetest, thanks for sharing. ;)

Re: Minetest on a spherical planet

PostPosted: Sun Oct 09, 2016 10:39
by azekill_DIABLO
not flat mapgen bugs ;0;

Re: Minetest on a spherical planet

PostPosted: Sun Oct 09, 2016 10:48
by taikedz
I have never learned C++ nor are my math skills up to scratch.... but i feel compelled to learn all of a sudden....

Thankfs for starting the POC Jeija and for all the explanations!

Anyone else here interested, and possibly with greater skills on all fronts than mine?

Re: Minetest on a spherical planet

PostPosted: Wed Oct 26, 2016 13:11
by toby109tt
Jeija wrote:I have made two YouTube videos on the (im)possibility of making the minetest world look and behave somewhat like a spherical planet. I thought I might share them with you. The title says Minecraft (because that is the more commonly known game and the math applies to both games), but this is acutally minetest. Click these pictures to watch them:


Image

Image

Download
You can get this game from my GitHub page with additional resources in the releases section.
You can also get a precompiled Windws build.

The planet_radius setting
The planet's radius is the number of mapblocks (=16x16x16 nodes) below sea level. So if
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
planet_radius = 2

then you can dig down to max. y = -planet_radius * 16 = -2 * 16 = -32 before falling through the center.

The planet's circumference is then calculated as ceil(planet_radius * Pi) * 16 * 2 (basically 2 * Pi * r, but rounded up to mapblocks). The flat plane is centered at the origin (x = 0, z = 0), so you the map wraps around to the other side at x/z=+/- planet_circumference / 2. For planet_radius = 2 that means you will "teleport" at ceil(2 * 3.14) * 16 * 2 / 2 = ceil(6.28) * 16 = 7 * 16 = 112.

Does the the server or the client need the planet settings?
Both server AND client need to have the SAME settings to make the planet work. Connecting with a spheretest client to a minetest server generally works, but things like active blocks and objects (other players, items, mobs) close to planet edges will be broken. This is of course far from ideal (ideally, the radius should be defined at world creation and synced from the server to the client), but that is because spheretest is only a demo.

The center of the planet and planet_keep_scale
If planet_keep_scale is true, aspect ratios of blocks are preserved. Since there is the same density of blocks close to the core like on the surface, this implies that there is no center point, there will always be a empty space underneath you.
If planet_keep_scale is false, aspect ratios are not preserved. The further down you go, the narrower the blocks get. This means there will be a center point, but the world gets very glitchy down there.

I can't see across the edges. It just teleports the player!
You are propably on a very large planet. Spheretest has only ever really been tested with planet_radius <= 5. If you can't see across planet edges, please make the planet small enough and adjust your viewing range to 500 or more (smaller planets will also work fine with smaller viewing ranges):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
viewing_range = 500


How do you like it?

This Is Amazing!! I Can't wait to see what you will make in the Future (Keep Up The Awesome work)

Re: Minetest on a spherical planet

PostPosted: Sun Nov 06, 2016 08:28
by Prot
Very awesome, but "stitch problems" present..
https://youtu.be/OmJ2UNU-3P0

Re: Minetest on a spherical planet

PostPosted: Mon Nov 07, 2016 12:52
by paramat
You just need a mapgen that blends across the wrap-edges, it could be done with a lua mapgen or a custom core mapgen.

Re: Minetest on a spherical planet

PostPosted: Fri Nov 11, 2016 23:05
by D00Med
This looks incredible!
edit: it is incredible!

Re: Minetest on a spherical planet

PostPosted: Tue Nov 15, 2016 04:43
by BlueTangs Rock
Cool!

Re: Minetest on a spherical planet

PostPosted: Tue Nov 15, 2016 04:44
by BlueTangs Rock
Is it compatible with mods that add extra biomes,or mods that add new terrain blocks?