Minetest on a spherical planet

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

Minetest on a spherical planet

by Jeija » Post

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

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):

Code: Select all

viewing_range = 500
How do you like it?
Last edited by Jeija on Sun Oct 09, 2016 08:40, edited 3 times in total.

User avatar
Krock
Developer
Posts: 4510
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Minetest on a spherical planet

by Krock » Post

<3 it.

Image
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
lightonflux
Member
Posts: 384
Joined: Mon Nov 11, 2013 07:22
In-game: lof
Location: Germany

Re: Minetest on a spherical planet

by lightonflux » Post

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.

User avatar
azekill_DIABLO
Member
Posts: 7494
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Minetest on a spherical planet

by azekill_DIABLO » Post

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§§§§§§§§!!!!!

User avatar
azekill_DIABLO
Member
Posts: 7494
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Minetest on a spherical planet

by azekill_DIABLO » Post

Is there a compiled version? im a noob with compiling

User avatar
Krock
Developer
Posts: 4510
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Minetest on a spherical planet

by Krock » Post

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 ;)
Last edited by Krock on Sun Oct 09, 2016 09:09, edited 2 times in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
azekill_DIABLO
Member
Posts: 7494
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Minetest on a spherical planet

by azekill_DIABLO » Post

ok i think i will need even more detailed explanation, in french if possible (don't know what do we talk in switzerland)

User avatar
firefox
Member
Posts: 1550
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: Minetest on a spherical planet

by firefox » Post

=(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?
building inspiration: viewtopic.php?f=3&t=15550 --- my game: viewtopic.php?f=49&t=15860 --- =(^.^)= nyan~

User avatar
minos
New member
Posts: 2
Joined: Fri Oct 07, 2016 18:34
IRC: minos or hydargos123
In-game: minos

Re: Minetest on a spherical planet

by minos » Post

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)...

User avatar
azekill_DIABLO
Member
Posts: 7494
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Minetest on a spherical planet

by azekill_DIABLO » Post

welcome to the forums ;P

you know, everything wih windows involved will bug.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

Re: Minetest on a spherical planet

by Jeija » Post

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!

User avatar
maikerumine
Member
Posts: 1364
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: Minetest on a spherical planet

by maikerumine » Post

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
Extreme Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
maikerumine
Member
Posts: 1364
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: Minetest on a spherical planet

by maikerumine » Post

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. :)
Extreme Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
taikedz
Member
Posts: 692
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: Minetest on a spherical planet

by taikedz » Post

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

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
Last edited by taikedz on Sun Oct 09, 2016 12:14, edited 2 times in total.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: Minetest on a spherical planet

by ExeterDad » Post

@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 :)

User avatar
taikedz
Member
Posts: 692
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: Minetest on a spherical planet

by taikedz » Post

Thanks ExeterDad - took the opportunity to also change the minetest URL to Jeija's

User avatar
Fixer
Member
Posts: 895
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: Minetest on a spherical planet

by Fixer » Post

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.

User avatar
taikedz
Member
Posts: 692
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: Minetest on a spherical planet

by taikedz » Post

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...

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

Re: Minetest on a spherical planet

by Jeija » Post

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 / ...

User avatar
minos
New member
Posts: 2
Joined: Fri Oct 07, 2016 18:34
IRC: minos or hydargos123
In-game: minos

Re: Minetest on a spherical planet

by minos » Post

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

User avatar
Onyx
Member
Posts: 115
Joined: Fri Sep 25, 2015 08:36
In-game: onyx58
Location: Steinheim-NodesNation
Contact:

Re: Minetest on a spherical planet

by Onyx » Post

Wow! More fun in Minetest, thanks for sharing. ;)
"Science sans conscience n'est que ruine de l'âme."
-----------------------------------------------------------------------------------------
Steinheim NodesNation : steinheim-minetest.servegame.com Pt : 28000

User avatar
azekill_DIABLO
Member
Posts: 7494
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Minetest on a spherical planet

by azekill_DIABLO » Post

not flat mapgen bugs ;0;

User avatar
taikedz
Member
Posts: 692
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: Minetest on a spherical planet

by taikedz » Post

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?

User avatar
toby109tt
Member
Posts: 648
Joined: Sun May 29, 2016 23:42
GitHub: tobyplowy
In-game: Toby109tt
Location: Belgium menen

Re: Minetest on a spherical planet

by toby109tt » Post

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

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):

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)
i'm the co-dev and lead artist of farlands

User avatar
Prot
Member
Posts: 36
Joined: Thu Apr 02, 2015 13:20
GitHub: EuPhobos
In-game: EuPhobos
Location: SaratOFF

Re: Minetest on a spherical planet

by Prot » Post

Very awesome, but "stitch problems" present..
https://youtu.be/OmJ2UNU-3P0

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest