Is it possible to convert an image into a minetest map?

Post Reply
User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Is it possible to convert an image into a minetest map?

by 12Me21 » Post

I was wondering if it is possible to convert an image into a minetest map, where one pixel is one block, and have different colors mean different heights and maybe transparency could be what type of block it is. that would be cool because I want to make a minetest map be like earth, (except not round) by finding a map where different colors mean different heights and converting it to a minetest map.
Example: (with smaller numbers/less colors so it's easier)
blue= -10 - -1
green= 0 - 9
yellow= 10 - 19
orange= 20 - 29
red= 30 - 39

Height could be generated the way it is now, but only within the limits of the color, like for green, there would be anything from 0 - 9.

It would also be cool if you could convert a map to an image, either in black and white (lighter=higher) or color, and instead of colors like "red" "yellow" "blue"... it would probably use hexadecimal colors (or RGB, but with hexadecimal it is easier because it's only one number, and you could just make it higher for higher elevations), which would allow for a height range of 16,777,216 ,which is WAY more than enough for the height range of 62000 (31000 in each direction) we have in minetest now.

The transparency could mean different blocks, like transparency 200 (out of 255) could mean grass, or something. the only problem is that it would only work for 256 types of blocks (at the most), but you could use RGB colors and have red and green mean height and blue+transparency mean type of block.
Shoutouts to Simpleflips

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

If one were to do this, I would suggest that saturation be the height of the map at any given point, normalized to say zero saturation being 100m below sea level, and full saturation being 100m above sea level. Then, hue would be linked to the block to place at the surface, since you would only need a few block types, with the assumption that everything below the surface would be stone or desert stone.

That way the image file would still be more or less human readable.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

+1

I am currently working on something very like this. Essentially what you are describing here is known as a 'height map'.
Re: converting a minetest map to an image, see minetestmapper.py in /minetest/util

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

You could convert the image to a worldedit schematic and import it
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

sfan5 wrote:You could convert the image to a worldedit schematic and import it
Sure, you could do that but it would be quite limited and probably rather slow.

What I am thinking of is basically reversing the mapper process to generate the sqlite map from an image.
It really shouldn't be that difficult...If only I could get my head around the db structure and the zlib stuff.
Last edited by stu on Fri Mar 29, 2013 21:37, edited 1 time in total.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Post

Looking at the mapgen code, I think it would be pretty easy to create a new mapgen that just pulls from a file. Then you could just change the mapgen settings in minetest.conf while creating the world, or just insert them into a map_meta.txt file for a new world directly, of course. I might give that a try at some point.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

prestidigitator wrote:Looking at the mapgen code, I think it would be pretty easy to create a new mapgen that just pulls from a file. Then you could just change the mapgen settings in minetest.conf while creating the world, or just insert them into a map_meta.txt file for a new world directly, of course. I might give that a try at some point.
Do you mean the c++ mapgen or lua?
This is another approach I have considered, however, for very large maps like the poster is suggesting, I fear file size may become something of a problem.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Post

stu wrote:
prestidigitator wrote:Looking at the mapgen code, I think it would be pretty easy to create a new mapgen that just pulls from a file. Then you could just change the mapgen settings in minetest.conf while creating the world, or just insert them into a map_meta.txt file for a new world directly, of course. I might give that a try at some point.
Do you mean the c++ mapgen or lua?
This is another approach I have considered, however, for very large maps like the poster is suggesting, I fear file size may become something of a problem.
C++. The file size shouldn't be any bigger than an image.... ;-)

Anyway, if you require that the image file be saved in a simple format (raw image tuples, for example) you wouldn't have to suck the whole thing into memory; just skip to the parts corresponding to the chunk you are currently loading.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

I've been wondering about this myself since discovering Minecraft Worldpainter, I don't have Minecraft so I immediately tried to figure out if there was a way to use it with Minetest.

http://www.minecraftforum.net/topic/231 ... generator/

It exports directly to minecraft files, or it can export a height map, and a color image of the map. I thought combining the height map and color image somebody could write something that would directly create a SQLight map database for minetest.

Marya Clare
New member
Posts: 3
Joined: Fri Jun 07, 2013 18:40

by Marya Clare » Post

Finally, someone other then me has seen world painter and plays minetest! I have world painter on my computer, I think that it may be possible to do this provided you nix the other realms (end, nether). I am aware there is a nether mod but I don't think it would be stable enough or too complicated to put in at the moment. Also to be nixed are minecraft textures from said realms along with the mushroom ones. All these things can be added once an established stable recreation can be found. So at best it would be good to remove and replace all textures with minetest ones. Alter the code to except the new ones. Also give credit to original creator of world painter and hopefully get permission so that someone can alter it and release to minetest players. I see lots of potential with this thing. I suck at coding at the moment but I can see if I can configure it to accept minetest textures. Yes, I will also email creator.

Marya Clare
New member
Posts: 3
Joined: Fri Jun 07, 2013 18:40

by Marya Clare » Post

Also I know the above post sounds a tad bit ambitous, I think this can work if the world painter is done over like minetest, update by update starting with minetest textures first. I don't currently own minecraft unfortunatley so I can't test my created worlds yet. This would give me the opportunity:) Sorry for the TL; DR:P

Marya Clare
New member
Posts: 3
Joined: Fri Jun 07, 2013 18:40

by Marya Clare » Post

Ok...bad news the guy who made is from the netherlands and I am not sure if he knows english or had someone translate it for him to release to minecraft players. I think he may actually english but I can't be sure. I found his website http://www.pepsoft.org/index.html which has his email, you may have to use google translate to help navigate through it.

User avatar
severak
Member
Posts: 35
Joined: Fri Jul 06, 2012 10:40
GitHub: severak
In-game: Severak
Location: Kudowa-Zdroj
Contact:

by severak » Post

Great Idea. It will be fine to generate realistic terrain with rivers etcetera from heightmap of real terrain. I will watch progress here :-)
back in Mintest after 10 years | my old mods

User avatar
Mossmanikin
Member
Posts: 599
Joined: Sun May 19, 2013 16:26
Location: where we don't speak english.

by Mossmanikin » Post

I like this idea a lot.
Marya Clare wrote:Ok...bad news the guy who made is from the netherlands and I am not sure if he knows english or had someone translate it for him to release to minecraft players. I think he may actually english but I can't be sure.
Although I'm quite sure the author speaks English, I'd like to offer my help, just in case a readable translation of more complex text is needed.
(I know google translate results aren't always satisfying.)

Noob 4 life!
My stuff

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

You could have two images.

One is grey scale, and is a height map.
The other is coloured and represents the type of block.

1 pixel = one block.

Of course you would only be able to do one layer thick maps this method.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
severak
Member
Posts: 35
Joined: Fri Jul 06, 2012 10:40
GitHub: severak
In-game: Severak
Location: Kudowa-Zdroj
Contact:

by severak » Post

@rubenwardy: good idea about two images

I feel that there should be some inteligence in converting.

For example if you have ocean, you probable have some sand on the ocean floor and under the sand there is usually stone.
The same comes with "dirt_with_grass" on hills. Usualy there are two or three blocks of plain dirt under it and later there is stone under it all.

Unfortunately, minetest map format seems to be bit hard for me to convert in it.
back in Mintest after 10 years | my old mods

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

This would be cool if you could convert real life maps (eg ordnance survey) to this kind of image then import it
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

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

Re: Is it possible to convert an image into a minetest map?

by bobomb » Post

Realterrain mod does exactly this.
viewtopic.php?f=11&t=12666

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests