[Mod] Real Terrain [0.1.0] [realterrain]

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

[Mod] Real Terrain [0.1.0] [realterrain]

by bobomb » Mon Jun 22, 2015 07:40

Use an image as a heightmap, use another image as a biome map, edit map settings and even biomes in-game, overlay river and road layers, do raster analysis. Effectively this is a WorldPainter mod. You can use spatial files for elevation and landcover or you can paint your own using any paint program. You can also persist structures using in-game tools.

use a grayscale image as a heightmap:
Image

use in-game settings tool (r,g,b color band overlay shown in background)

Image

configure biome interpretation in-game:
Image

results:
Image

perform on-the-fly raster analysis such as slope and aspect:
Image

overlay an image onto the map (here a grayscale version of the same image is used as the heightmap) in 216 colors:
Image

dependencies: requires mod security disabled, for more specific and advanced features an image library will be required, see below...

download latest zip: https://github.com/bobombolo/realterrain/archive/master.zip
github: https://github.com/bobombolo/realterrain
youtube tutorial: https://www.youtube.com/watch?v=66pehrH6Bh0

license: original content is WTFPL

includes several lua libraries including: magick, imagesize, imlib2, graphicsmagick, lua-socket, lunatic-python (not all are used). ImageMagick is the most tested library for this mod, and until recently was a requirement. GraphicksMagick is recommended for speed and automatic bit-depth detection and handling of strange GIS rasters.

YOU MUST enable insecure mode by including the line "setting secure.enable_security = false" in your minetest.conf.

thanks to paramat for the skeletal mapgen mod code: https://gist.github.com/paramat/389ee65ce9378d9dad25
Last edited by bobomb on Sun Oct 14, 2018 19:35, edited 21 times in total.
 

User avatar
TG-MyinaWD
Member
 
Posts: 356
Joined: Thu May 08, 2014 21:22
Location: Far Eden
GitHub: Maddie-Myina
IRC: Maddie-Myina
In-game: .

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by TG-MyinaWD » Mon Jun 22, 2015 16:22

Oh my that is crazy.
Very nicely done to.
Might be interesting to see on an server.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
 

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

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Krock » Mon Jun 22, 2015 16:29

Whoa, that's a great mod!
It would be interesting to generate ores and trees automatically to make it look even better.

I looked at the source code and just want to point out, the chunk/mapblock size is not fixed to 80x80x80 nodes, use "local sidelen" instead.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by paramat » Mon Jun 22, 2015 21:09

Krock, I wrote the basic code assuming a large image or heightmap would be pre-prepared by splitting into 80x80 arrays, although that's not how it currently works.
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun
 

User avatar
cd2
Member
 
Posts: 562
Joined: Mon Jun 01, 2015 06:30
Location: Linux
GitHub: cdqwertz
In-game: cd cd2
 

User avatar
Gael de Sailly
Member
 
Posts: 659
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Gael de Sailly » Sat Jun 27, 2015 09:40

How can I get this kind of tiff images for a given region ?
I would like to have a Minetest world that represents the Vosges region (in France, between Nancy and Mulhouse).
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

User avatar
Diamond knight
Member
 
Posts: 436
Joined: Sun Apr 19, 2015 19:50
Location: stalker...
GitHub: Diamondknight
In-game: Ferrumprinceps
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by bobomb » Sun Jun 28, 2015 16:39

Gael de Sailly wrote:How can I get this kind of tiff images for a given region ?
I would like to have a Minetest world that represents the Vosges region (in France, between Nancy and Mulhouse).

look for a Digital Elevation Model of your region in GeoTIFF format, then just take it into photoshop and reduce the color mode to 8 bit, save as TIFF with no compression.

here is a low resolution dem of most of europe, however it has been colorised and the pallete would need to be restored to a grey scale http://www.eea.europa.eu/data-and-maps/data/digital-elevation-model-of-europe

anyway most countries have websites for obtaining this data, here is a site that might help, i can't get the map interface to work but maybe it will for you: https://www.ngdc.noaa.gov/dem/squareCellGrid/map?theme=DDP

finally try this software (there is a tutorial) http://www.usna.edu/Users/oceano/pguth/website/microdem/microdem.htm
 

User avatar
Gael de Sailly
Member
 
Posts: 659
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Gael de Sailly » Mon Aug 03, 2015 21:56

I've found how to proceed, with free softwares (I have not Photoshop) :
  1. Download the maps from SRTM Data Search
  2. Open the map with ImageMagick
  3. Go to "Enhance ~> Brightness" and set it to 200. You will need to do it several times (at least 3 times) until the map is light enough (or else it will be too flat).
  4. Save the image
  5. Open it with GIMP. It will convert it into 8-bits image. You can "stick" several images and select the desired zone.
  6. The map is distorted by the projection. You can correct this problem by changing the length of the image. Resize the length to old_length × cos average_latitude (take your calculator). Not needed if you're close to the equator or if you don't expect a good precision.
  7. Save it into .tif image without compression, even lossless !

So after this adventure I've finally got my map of the Vosges. But I haven't found how to use it :/
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by ExeterDad » Tue Aug 04, 2015 01:23

Gael de Sailly would you please post both images (before and after) so we can get a idea what we need to achieve if we were to make one of our own?
 

User avatar
Gael de Sailly
Member
 
Posts: 659
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Gael de Sailly » Tue Aug 04, 2015 12:20

I've tried to upload it, but they're too large (36 MB).
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by ExeterDad » Wed Aug 05, 2015 00:39

Gael de Sailly wrote:I've tried to upload it, but they're too large (36 MB).

Wow! Okay! Disregard that request.
Thanks anyway :)
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by bobomb » Mon Aug 24, 2015 16:36

imageloader mod now has a pure lua png library that I am working on integrating, this should allow for 16 bit images... as well as png and bmp support also lifted from imageloader.
 

Ryster
New member
 
Posts: 4
Joined: Thu Sep 10, 2015 18:08

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Ryster » Thu Sep 10, 2015 19:05

bobomb wrote:imageloader mod now has a pure lua png library that I am working on integrating, this should allow for 16 bit images... as well as png and bmp support also lifted from imageloader.


very nice!

please let us know when you have 16bit support, so I can gen maps higher than 256 :)
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by bobomb » Wed Oct 14, 2015 20:45

https://trac.osgeo.org/gdal/wiki/GdalOgrInLua

using gdal we can stop worrying about image formats and use proper GIS raster formats complete with spatial metadata such as projection, real world extent, pixel scale, elevation scale, etc.
 

User avatar
Splizard
Member
 
Posts: 224
Joined: Wed Jan 25, 2012 07:20
Location: New Zealand
GitHub: Splizard
IRC: Splizard
In-game: Splizard

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Splizard » Sat Oct 17, 2015 03:09

Trying to get this to work, really nice mod here, but I get an error.. (latest git minetest)
Code: Select all
minetest/mods/realterrain/init.lua:125: attempt to index a nil value
--This line is not working.
return demtiff:read(1):byte() - 32, covertiff:read(1):byte()
Games: The Hungry Games Mods: Lifters (Simple Lifts), Snow Biomes and Gates. Also checkout my texture pack Gridtoon!
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by bobomb » Sat Oct 17, 2015 15:55

maybe your cover.tif is not present? there should be one in the dem folder, if you don't want to use cover replace that line with

return demtiff:read(1):byte() - 32, 0

this mod is under heavy development right now so there will be improvements to the "cover" system
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by bobomb » Mon Oct 19, 2015 22:46

this mod is now moving towards using external libraries to enable the use of any image file format including 16-bit color depths. that means that mod security has to be disabled for this mod in minetest.conf and you must have luarocks installed as well as the lua-imlib2 library.

next steps in development will include better land cover, and an in-mod menu system for tweaking scale settings and reloading the map (which will destructively reset the map.sqlite file). Now that the mod has access to external lua libraries, I will also begin experimenting with downloading DEM tiles and/or other data directly from the internet using luasocket.

Image

16 bit tiff used
Last edited by bobomb on Tue Oct 20, 2015 03:43, edited 1 time in total.
 

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

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by Don » Mon Oct 19, 2015 23:39

That is awesome. I can't imagine the maps this could make.
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
 

User avatar
MineYoshi
Member
 
Posts: 5354
Joined: Wed Jul 08, 2015 13:20

Re: [Mod] Real Terrain [0.0.1] [realterrain]

by MineYoshi » Tue Oct 20, 2015 00:40

Looks good and is good is awesome than can make maps
nire patata zurea da, kide :-)
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.2] [realterrain]

by bobomb » Tue Oct 20, 2015 19:16

Image

working on strata as discussed in the original thread:
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.2] [realterrain]

by bobomb » Tue Oct 20, 2015 22:29

biome, water and road "painting"

Image

Image
this branch has switched to using luarocks magick library (from imlib2) for true 16-bit support

https://github.com/bobombolo/realterrain/tree/sixteen
 

User avatar
Gael de Sailly
Member
 
Posts: 659
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Real Terrain [0.0.2] [realterrain]

by Gael de Sailly » Thu Oct 22, 2015 12:39

How could I install luarocks imlib2 ?
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

bobomb
Member
 
Posts: 115
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Real Terrain [0.0.2] [realterrain]

by bobomb » Fri Oct 23, 2015 03:08

install imlib2
install luarocks
then
Code: Select all
luarocks install lua-imlib2
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: Google [Bot] and 9 guests