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

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

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

by 12Me21 » Fri Mar 29, 2013 17:52

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.
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Fri Mar 29, 2013 18:09

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 (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Mar 29, 2013 18:12

+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
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Fri Mar 29, 2013 21:10

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: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Mar 29, 2013 21:35

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: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Fri Mar 29, 2013 21:45

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: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Mar 29, 2013 22:00

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: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sat Mar 30, 2013 00:52

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: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Sat Mar 30, 2013 03:24

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/231255-worldpainter-v124-graphical-interactive-map-creatorgenerator/

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 » Fri Jun 07, 2013 18:47

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 » Fri Jun 07, 2013 18:49

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 » Fri Jun 07, 2013 19:01

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.
 

severak
Member
 
Posts: 24
Joined: Fri Jul 06, 2012 10:40

by severak » Fri Jun 07, 2013 21:44

Great Idea. It will be fine to generate realistic terrain with rivers etcetera from heightmap of real terrain. I will watch progress here :-)
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Sat Jun 08, 2013 18:23

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
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Sat Jun 08, 2013 18:30

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.
 

severak
Member
 
Posts: 24
Joined: Fri Jul 06, 2012 10:40

by severak » Sun Jun 09, 2013 17:55

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

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Sun Jun 09, 2013 22:30

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.
 

bobomb
Member
 
Posts: 101
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 » Sun Dec 20, 2015 22:37

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


Return to Minetest Features

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

cron