[Mod] Moon mapgen [0.17] [moon]

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

[Mod] Moon mapgen [0.17] [moon]

by arpruss » Post

A little mapgen mod that generates lunar terrain based on actual moon terrain data from NASA's LRO spacecraft.

Code: MIT License

Background textures: Non-commercial use

Mod dependencies: None

Download: zip file from github.

You control the generation by editing settings.conf. The defaults are:

Code: Select all

land_node_meters = 150
height_multiplier = 1
This means that each node (at least near latitude 0 and longitude 0) represents about 150 meters of lunar terrain, and the heights of the terrain are not exaggerated. You can play with these numbers.

You can also go to a specific location on the nearside of the moon with:

Code: Select all

/goto feature name
(e.g., /goto plato or /goto moltke or /goto mare tranq) or with:

Code: Select all

/goto latitude longitude
(positive is north or east; negative is south or west).

If you want to see your current lat/long, you can do:

Code: Select all

/where
Image
Last edited by arpruss on Tue Dec 08, 2015 15:05, edited 4 times in total.

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

Re: [WIP][MOD] Moon mapgen

by Krock » Post

Impressive. How many square kilometers of the moon terrain did you upload there?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP][MOD] Moon mapgen

by Don » Post

Nice.
You could make it a subgame. Change gravity so it is like the moon. Teachers could use this to show kids what the moon is like.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

Krock wrote:Impressive. How many square kilometers of the moon terrain did you upload there?
Everything: the whole moon, with 64 data points per degree of longitude/latitude, in 8-bit resolution. But because of how I flatten things, currently only the near side is supported.

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

Don wrote:Nice.
You could make it a subgame. Change gravity so it is like the moon. Teachers could use this to show kids what the moon is like.
Great idea! But given that the heights are distorted, and the scale isn't 1-1 (or the moon will be too big to fit in a Minetest world), the educational value will be limited.

I have a Python-based grenade-throwing script (for the Raspberry PI Minecraft API, which works with my RaspberryJuice mods for Minetest and Minecraft; but the animation works better with Minecraft) that lets you specify what solar system body you're throwing the grenade on. That would be a nice thing to play with.

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [WIP][MOD] Moon mapgen

by Ferk » Post

Nice mapgen idea :)
arpruss wrote: given that the heights are distorted, and the scale isn't 1-1 (or the moon will be too big to fit in a Minetest world), the educational value will be limited.
I don't think that this would matter too much.
You could even say that the player is a giant exploration robot that is 1 kilometer tall (2 nodes), then the scale would be correct (the resolution woulnd't be that good but well..). Since the parameters are configurable I guess it would be possible to mitigate the height distortion as well.

Regardless, changing the gravity to be the same as the moon sounds like a cool idea.
Also change the sky for full effect (even better if you added textures from actual lunar skybox with the earth in there).

Code: Select all

minetest.register_on_joinplayer(function(player)
    player:set_physics_override( { gravity = 1.622 / 9.8 } )
    player:set_sky({r=0, g=0, b=0}, "plain")
end)
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

I put up 0.04. Includes:
- lower gravity
- black sky
- farside (/goto 0 180 will go to the center of the dark side; or for a more interesting location, try /goto Abbe); the farside is also a flattened disc and is located about 5000 nodes below the nearside.

Thanks for the set_sky() idea. The docs say that this shouldn't go in on_joinplayer(), but it works fine.

Too bad that the sun and moon (which could stand in for earth!) don't show up in "plain" mode. Any ideas how to fix that?
Attachments
screenshot of Abbe crater
screenshot of Abbe crater
screenshot_20151010_042501.png (532.04 KiB) Viewed 1759 times

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [WIP][MOD] Moon mapgen

by paramat » Post

You can use my skybox textures if you want, if you credit me and share alike (license CC BY-SA)
https://github.com/paramat/moonrealm/tr ... r/textures
How to use:
https://github.com/paramat/moonrealm/bl ... t.lua#L187

User avatar
GJH105775
Member
Posts: 106
Joined: Thu Sep 27, 2012 16:11
Location: Ohio, USA
Contact:

Re: [WIP][MOD] Moon mapgen

by GJH105775 » Post

If there is a way to make the sky black (without making everything dark), and to add the earth in the sky THAT would be pretty cool hahaha.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [WIP][MOD] Moon mapgen

by Hybrid Dog » Post

GJH105775 wrote:If there is a way to make the sky black (without making everything dark), and to add the earth in the sky THAT would be pretty cool hahaha.
do you mean like it's done in the moontest game?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
GJH105775
Member
Posts: 106
Joined: Thu Sep 27, 2012 16:11
Location: Ohio, USA
Contact:

Re: [WIP][MOD] Moon mapgen

by GJH105775 » Post

I don't know haha, I have not played or been active since 2013-maybe 2014.

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

I might generate an accurate starry night texture and stick the earth in. I'm not sure I know how exactly to orient the earth.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [WIP][MOD] Moon mapgen

by Hybrid Dog » Post

arpruss wrote:I'm not sure I know how exactly to orient the earth.
ldk, l think the moon isn't oriented in the same direction every night (the moon face has different rotations)

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

Hybrid Dog wrote:
arpruss wrote:I'm not sure I know how exactly to orient the earth.
ldk, l think the moon isn't oriented in the same direction every night (the moon face has different rotations)
The moon rotates on its axis once every twenty-nine earth days.

I think I should be able to generate textures using Space Engine (non-commercial use only).

User avatar
GJH105775
Member
Posts: 106
Joined: Thu Sep 27, 2012 16:11
Location: Ohio, USA
Contact:

Re: [WIP][MOD] Moon mapgen

by GJH105775 » Post

You start adding to many features such as this and you'll have a laggy program with a lot of overhead, you need to prioritize this how you see fit. For example one side of the mood in completely black, you need to ask just how much realisim is needed. You could have the earth as an animation that did a full rotation every 29 minetest days and that would not have too much overhead, but rendering it to get it exact may not be needed for what you are doing..

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP][MOD] Moon mapgen

by Don » Post

I agree. Realism is not necessary in a game that is unrealistic. It is nice to try but not at the cost of game play.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

Version 0.05:
- added sky textures (generated with SpaceEngine; alas, this forces a non-commercial-only license on this component; you can always remove the textures, set the sky black and use the MIT license that everything else is under). I didn't try hard to align the textures with the compass directions, but it's roughly aligned (anyway, the moon's polar axis changes over time. You'll see the earth if you look straight up. You'll be surprised how disappointingly small it looks like. That's the price of realism.
- save scale settings in the world folder to avoid problems when you change settings.conf in mod and go back to a world generated with different values

Image

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP][MOD] Moon mapgen

by Don » Post

Wow. That looks awesome!
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

Dorje
Member
Posts: 109
Joined: Sun Oct 04, 2015 21:19
In-game: gryphon + MajesticBird
Location: South Africa, Cape Town, Observatory, MINECRAFT!

Re: [WIP][MOD] Moon mapgen

by Dorje » Post

WOW THAT LOOKS COOL! (the sky) :-) .
Btw this is 5 days away from my birthday! :D .
Give me some EXTREME HARDCORE xD

i have to say this sad thing viewtopic.php?f=3&t=13458&p=195719#p195719

User avatar
GJH105775
Member
Posts: 106
Joined: Thu Sep 27, 2012 16:11
Location: Ohio, USA
Contact:

Re: [WIP][MOD] Moon mapgen

by GJH105775 » Post

arpruss wrote:Version 0.05:
- added sky textures (generated with SpaceEngine; alas, this forces a non-commercial-only license on this component; you can always remove the textures, set the sky black and use the MIT license that everything else is under). I didn't try hard to align the textures with the compass directions, but it's roughly aligned (anyway, the moon's polar axis changes over time. You'll see the earth if you look straight up. You'll be surprised how disappointingly small it looks like. That's the price of realism.
- save scale settings in the world folder to avoid problems when you change settings.conf in mod and go back to a world generated with different values

Image

Definitely worth it hahah, beautiful hahaha

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

I released a new version which compresses the terrain data, reducing the disc-space needed from about 240 mb to about 65 mb.

I think I will eventually also make this compatible with ore generation, by letting a built-in mapgen run below the surface of the moon (maybe three nodes down).

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

By the way, this is compatible with my Raspberry Jam Mod, so one can run python scripts against it.

Here's what happens if you run /py render 1701d with both Moon Mapgen and Raspberry Jam Mod active, near the Abbe crater.

Image

Dorje
Member
Posts: 109
Joined: Sun Oct 04, 2015 21:19
In-game: gryphon + MajesticBird
Location: South Africa, Cape Town, Observatory, MINECRAFT!

Re: [WIP][MOD] Moon mapgen

by Dorje » Post

arpruss wrote:By the way, this is compatible with my Raspberry Jam Mod, so one can run python scripts against it.

Here's what happens if you run /py render 1701d with both Moon Mapgen and Raspberry Jam Mod active, near the Abbe crater.

Image
O.O
Give me some EXTREME HARDCORE xD

i have to say this sad thing viewtopic.php?f=3&t=13458&p=195719#p195719

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [WIP][MOD] Moon mapgen

by Ferk » Post

The new skybox looks awesome!
I'm surprised that the Earth is so small.. how come the Moon looks bigger from here than the Earth from there? It's interesting nonetheless.
arpruss wrote:I think I will eventually also make this compatible with ore generation, by letting a built-in mapgen run below the surface of the moon (maybe three nodes down).
A built-in mapgen? You mean Minetest mapgen or your own?

Maybe it would make sense to turn this into a subgame instead of just a mod and add your own ores and stuff.. most of vanilla minetest_game is useless in this mapgen anyway, since there's no way to obtain wood, you won't be able to craft tools to begin with.

A different texture for lunar rock, instead of the stone from Minetest might also be nice. Even if it was just a brightened version of the stone texture. You could have a node that is a low-light light_source for the near side of the moon and one that doesn't have any light for the far side. Use the same texture so that the only difference between dark and bright is the emitted light which will make the transition from one side to the other smoother than if it was a change in the texture.

Paramat's moonrealm looks also quite cool, I didn't see it before. Maybe you can draw inspiration from it.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

arpruss
Member
Posts: 39
Joined: Sat Sep 26, 2015 14:01
GitHub: arpruss

Re: [WIP][MOD] Moon mapgen

by arpruss » Post

Ferk wrote:I'm surprised that the Earth is so small.. how come the Moon looks bigger from here than the Earth from there?
It's not that small compared to the size of the player. That said, I read that there is a visual illusion whereby the brain magnifies the size of bright things against a dark background, making the moon look larger than it is against the background of the night sky.
Maybe it would make sense to turn this into a subgame instead of just a mod and add your own ores and stuff.. most of vanilla minetest_game is useless in this mapgen anyway, since there's no way to obtain wood, you won't be able to craft tools to begin with.
Or I can just leave it as is, for use in creative. (I don't actually play almost at all in Minecraft/Minetest myself, except in creative, and even then I generate almost everything procedurally, typically using python code.)
A different texture for lunar rock, instead of the stone from Minetest might also be nice. Even if it was just a brightened version of the stone texture.
The moon is actually not all that bright when you're on it. Here are some photos of real moon rocks. It just looks bright against the night sky. The photos of moon rocks seem to match the stone texture pretty well.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests