[Mod] Real Terrain [0.1.0] [realterrain]

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

[Mod] Real Terrain [0.1.0] [realterrain]

by bobomb » Post

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

This mod is currently broken
Spoiler
YOU MUST enable insecure mode by including the line "setting secure.enable_security = false" in your minetest.conf.

Disabling mod security greatly reduces the security of your system, and should never be done
thanks to paramat for the skeletal mapgen mod code: https://gist.github.com/paramat/389ee65ce9378d9dad25
Last edited by rubenwardy on Tue Oct 01, 2019 07:08, edited 22 times in total.
Reason: Warn about disabling security

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

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

by TG-MyinaWD » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

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

by Krock » Post

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

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

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

by paramat » Post

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: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

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

by Minetestforfun » Post

Awesome 0_o !

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

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

by cd2 » Post

looks great :D

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

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

by Gael de Sailly » Post

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).
Just realize how bored we would be if the world was perfect.

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

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

by Diamond knight » Post

this will tottaly be in ultimatetest (viewtopic.php?f=50&t=11901) when it is done

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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/ ... -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/squareCel ... ?theme=DDP

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

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

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

by Gael de Sailly » Post

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 :/
Just realize how bored we would be if the world was perfect.

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

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

by ExeterDad » Post

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: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

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

by Gael de Sailly » Post

I've tried to upload it, but they're too large (36 MB).
Just realize how bored we would be if the world was perfect.

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

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

by ExeterDad » Post

Gael de Sailly wrote:I've tried to upload it, but they're too large (36 MB).
Wow! Okay! Disregard that request.
Thanks anyway :)

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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 » Post

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

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

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

by Splizard » Post

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: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

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

by Don » Post

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: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

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

by MineYoshi » Post

Looks good and is good is awesome than can make maps
Have a nice day! :D

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

Image

working on strata as discussed in the original thread:

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

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: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

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

by Gael de Sailly » Post

How could I install luarocks imlib2 ?
Just realize how bored we would be if the world was perfect.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

install imlib2
install luarocks
then

Code: Select all

luarocks install lua-imlib2

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests