Is it possible to convert an image into a minetest map?
- 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?
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.
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
- VanessaE
- Moderator
- Posts: 4655
- Joined: Sun Apr 01, 2012 12:38
- GitHub: VanessaE
- IRC: VanessaE
- In-game: VanessaE
- Location: Western NC
- Contact:
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.
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)
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Sure, you could do that but it would be quite limited and probably rather slow.sfan5 wrote:You could convert the image to a worldedit schematic and import it
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.
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
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.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Do you mean the c++ mapgen or lua?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.
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.
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
C++. The file size shouldn't be any bigger than an image.... ;-)stu wrote:Do you mean the c++ mapgen or lua?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.
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.
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.
- BrandonReese
- Member
- Posts: 839
- Joined: Wed Sep 12, 2012 00:44
- GitHub: bremaweb
- IRC: BrandonReese
- In-game: BrandonReese
- Location: USA
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.
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.
My Twitch Channel - https://www.twitch.tv/brandonreese81/profile
-
- New member
- Posts: 3
- Joined: Fri Jun 07, 2013 18:40
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.
-
- New member
- Posts: 3
- Joined: Fri Jun 07, 2013 18:40
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
-
- New member
- Posts: 3
- Joined: Fri Jun 07, 2013 18:40
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: 35
- Joined: Fri Jul 06, 2012 10:40
- GitHub: severak
- In-game: Severak
- Location: Kudowa-Zdroj
- Contact:
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
- Mossmanikin
- Member
- Posts: 599
- Joined: Sun May 19, 2013 16:26
- Location: where we don't speak english.
I like this idea a lot.
(I know google translate results aren't always satisfying.)
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.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.
(I know google translate results aren't always satisfying.)
- rubenwardy
- Moderator
- Posts: 6972
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
- severak
- Member
- Posts: 35
- Joined: Fri Jul 06, 2012 10:40
- GitHub: severak
- In-game: Severak
- Location: Kudowa-Zdroj
- Contact:
@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.
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
- Dan Duncombe
- Member
- Posts: 904
- Joined: Thu May 09, 2013 21:11
- Location: In the unknown depths of Earth
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.
My Games: Nostalgia Realtest Revamped
Servers: See above games.
Re: Is it possible to convert an image into a minetest map?
Realterrain mod does exactly this.
viewtopic.php?f=11&t=12666
viewtopic.php?f=11&t=12666
Who is online
Users browsing this forum: No registered users and 4 guests