[Mod] Converter Minecraft world to Minetest world

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Converter Minecraft world to Minetest world

by Sokomine » Post

Schmeldric wrote: Besides, is there any "specs" "notice" "api" "datasheet" (I don't know the english word for that) that describes how Minetest maps are stored. I know it's by 80x80x80 chunks, but where can I find the details? (and is it a good idea?)
No, it's not a good idea. The 80x80x80 chunks are mapchunks - that is what mapgen throws at you if you use minetest.register_on_generated. The map itshelf is stored in a database (usually sqlite) in a very simple table structure that more or less boils down to an encoded position of the mapblock as id and the data as content. Each such entry contains 16x16x16 nodes. It's documented in world_format.txt.
Schmeldric wrote: The idea would be to create the map accordingly to my datas with an extern project (compiled in C for my case), which would avoid parsing huge data files in lua while running the game.
What kind of data do you have available? For import and export, the Minetest schematic format .mts is very practical and useful. You can parse and create it with your own tools far easier than the mapformat itshelf. Working directly on the map data only gives you a huge advantage if you're working on very large areas where .mts becomes inconvenient (say, something with a side length of 1000 or more meters).
A list of my mods can be found here.

Schmeldric
Member
Posts: 22
Joined: Sat Nov 01, 2014 15:38
In-game: Schmeldric

Re: [Mod] Converter Minecraft world to Minetest world

by Schmeldric » Post

Thanks for that file (world_format.txt).
I guess the best thing for me to do is to use sqlite library for two reasons :
- I'll have to convert "back" to MC, the more I learn on MT map format, the faster I'll be able to code it.
- my data are quite big (I wouldn't say huge).
What kind of data do you have available?
We're making a model of our city. We started with the school last year, I'm now automatising the process for other districts. We're not (yet) using data on 1000 meters x 1000 meters but the school is already 300m x 200m.
For information, the files I have :
- topographic : ground height on a 5m step grip. I have to compute the ground height between these points. Either in Minetest, either by an extern program that creates a "schematic" used by my mod.
- building's layout (a polygon per building).
- most of building's height.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Updated Converter

by sofar » Post

I've been updating mcimport.py in a github fork and eliminating missing blocks, and generally making it really friendly.

https://github.com/sofar/mcimport

Minecraft Test Patterns:

Image

Converted Result:

Image

(Note: a few saplings have grown since conversion, oops. Also, while there are some empty patches, almost all of the test pattern blocks convert with high precision and coverage).

I'm doing things a bit differently though - my focus isn't to "copy exact", but to create a playable, approximation of the MC world.

So I expect that things like doors, beds, furnaces just work, and blocks are useful and usable. But blocks that have no purpose or don't exist in minetest are removed or replaced with equivalents that make sense in MT gameplay. Rotation of blocks is carefully done and verified.

- emerald ore is converted to stone
- lapis ore is converted to stone
- redstone is as much possible converted to mese, with working pressure plates, wires, noteblocks, buttons, levers and a few more things
- flower pots are done a bit differently - they're all just plants sitting on top of a pot

I flat out refuse to add code that convert blocks to modules that purely exist to create a MC block.

When you convert a MC savegame or world, it's expected to be in MC 1.8 format. I'm not supporting old formats. The code also writes a few extra files needed to make it all play nice with mapgen, mainly fixing the waterlevel and allowing you to tweak mapgen to single node easily. Note: The map will be 180 degrees rotated (N in MC will end up S in MT), and offset by (1, -65,0) or so... can't help that at this point.

Mods: lots of mods required - none strange or obtuse, or hard to find mods, these are all very COMMON mods that most servers have, and most of them are contained within plantlife, mesecons, moretrees, moreblocks, homedecor and nether mods already

Required mods: (sorry for the long list)

Code: Select all

load_mod_biome_lib = true
load_mod_bushes_classic = true
load_mod_ferns = true
load_mod_flowers_plus = true
load_mod_homedecor = true
load_mod_junglegrass = true
load_mod_mesecons = true
load_mod_mesecons_button = true
load_mod_mesecons_commandblock = true
load_mod_mesecons_delayer = true
load_mod_mesecons_doors = true
load_mod_mesecons_lamp = true
load_mod_mesecons_lightstone = true
load_mod_mesecons_materials = true
load_mod_mesecons_mvps = true
load_mod_mesecons_noteblock = true
load_mod_mesecons_pistons = true
load_mod_mesecons_pressureplates = true
load_mod_mesecons_receiver = true
load_mod_mesecons_solarpanel = true
load_mod_mesecons_switch = true
load_mod_mesecons_torch = true
load_mod_mesecons_walllever = true
load_mod_moreblocks = true
load_mod_moretrees = true
load_mod_nether = true
load_mod_poisonivy = true
load_mod_quartz = true
load_mod_vines = true
load_mod_signs = true
load_mod_signs_lib = true
Note that you do not need to modify world.mt since the code writes out a perfectly usable version with the mod list. You just need to download these mods and install them in your mods folder.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Converter Minecraft world to Minetest world

by Fixer » Post

Basically they are those mods:
Biomes_lib - viewtopic.php?f=11&t=12999
Plantlife - viewtopic.php?f=11&t=3898
Home Decor - viewtopic.php?f=11&t=2041
Mesecons - viewtopic.php?f=11&t=628
Moreblocks - viewtopic.php?id=509
Moretrees - viewtopic.php?id=4394
Nether - viewtopic.php?f=11&t=5790
Quartz - viewtopic.php?f=11&t=5682
Signs - viewtopic.php?f=11&t=2736 or viewtopic.php?f=11&t=3289 (not sure with the signs, signs_lib is included in homedecor)

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Converter Minecraft world to Minetest world

by Sokomine » Post

sofar wrote: I've been updating mcimport.py in a github fork and eliminating missing blocks, and generally making it really friendly.
Hm. I've got some old MC Classic files. Importing those and making them available in a single MT world would be intresting (and also easier as there are mostly solid blocks there).
A list of my mods can be found here.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Converter Minecraft world to Minetest world

by sofar » Post

Sokomine wrote:
sofar wrote: I've been updating mcimport.py in a github fork and eliminating missing blocks, and generally making it really friendly.
Hm. I've got some old MC Classic files. Importing those and making them available in a single MT world would be intresting (and also easier as there are mostly solid blocks there).
I'm not looking at pre-1.8 files, there are lots of things that likely don't work. I suggest saving the world in 1.8 to a new folder and trying to convert that first.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Converter Minecraft world to Minetest world

by TheReaperKing » Post

sofar thank you so much for your version!! I was able to convert my brother's minecraft map for him when the initial mod in this thread wasn't working, something about not being able to open a database. I can post the exact message if it is actually interesting to someone. One thing I had to change though was making it python vs python3 for the command line code. I also used absolute paths to make life easier. I also skipped using any of those mods you had listed and it seems to come out pretty well but I'm glad to know what ones I'd need to do a more complete replica. Have a great night :)
-Mike
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Converter Minecraft world to Minetest world

by sofar » Post

TheReaperKing wrote:sofar thank you so much for your version!! I was able to convert my brother's minecraft map for him when the initial mod in this thread wasn't working, something about not being able to open a database. I can post the exact message if it is actually interesting to someone. One thing I had to change though was making it python vs python3 for the command line code. I also used absolute paths to make life easier. I also skipped using any of those mods you had listed and it seems to come out pretty well but I'm glad to know what ones I'd need to do a more complete replica. Have a great night :)
-Mike
I'd be happy to look at your issue, and feel free to post the changes you make it work with python2. You can post your code, log output or anything in here.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Converter Minecraft world to Minetest world

by TheReaperKing » Post

Just to be clear your mod didn't give me any errors except when it said unknown minecraft block type. It was using Nore's that I had the trouble. I can still post it though but I just wanted to mention that in case there was any confusion. I was actually using python 3.5, the latest one on their webpage but python3 didn't work but python alone in the command prompt.

Also you might want to make a separate post of your project as well! I had tried two others including Nore's without success until I found yours luckily buried in this thread. Thanks for all of your hard work! Take care :)
-Mike
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Christian9
Member
Posts: 338
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9
Location: Hell Creek

Re: [Mod] Converter Minecraft world to Minetest world

by Christian9 » Post

is there a simple set of instructions on how to use this?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Converter Minecraft world to Minetest world

by sofar » Post

Christian9 wrote:is there a simple set of instructions on how to use this?
not sure if you're talking about my mcimport.py here, but if you are, please look at the bottom of this post:

viewtopic.php?f=14&t=13709

mongus
New member
Posts: 3
Joined: Mon Apr 11, 2016 13:04

Re: [Mod] Converter Minecraft world to Minetest world

by mongus » Post

Hi, so I've had a bash at converting a fairly small map. It took a couple of minutes to install. There were a fair few Unknown Minecraft Block messages. I have downloaded and enabled the mods.

But, when I run the map I get nothing. I am in a completely empty world. I can look up and see the sun and clouds. All around I have blue and below there is a darker blue rectangle. It is as though none of the block got converted over.

I have tried the trick mentioned by dgm5555 an page 1 of this thread to show unknown blocks. No unknown blocks are shown.

I'm pretty sure it is a 1.8.9 map.

Any ideas what could be going wrong?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Converter Minecraft world to Minetest world

by sofar » Post

mongus wrote:Hi, so I've had a bash at converting a fairly small map. It took a couple of minutes to install. There were a fair few Unknown Minecraft Block messages. I have downloaded and enabled the mods.

But, when I run the map I get nothing. I am in a completely empty world. I can look up and see the sun and clouds. All around I have blue and below there is a darker blue rectangle. It is as though none of the block got converted over.

I have tried the trick mentioned by dgm5555 an page 1 of this thread to show unknown blocks. No unknown blocks are shown.

I'm pretty sure it is a 1.8.9 map.

Any ideas what could be going wrong?
Could you potentially send me a zip file with the world zipped up? If it's small enough you could even upload it to this forum.

EDIT: It's entirely possible that minecraft put your small world a few 100 blocks away from 0,0,0 and so your world is converted without problems, except there's nothing near the minetest spawn location. Load the world in MC and move to 0,0,0 and look around.

Also, please check that you're not just stuck inside the ground - enable noclip and free movement and try and move out of blocks. Maybe enabling the minimap helps, as well.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Converter Minecraft world to Minetest world

by sofar » Post

mongus wrote:Hi, so I've had a bash at converting a fairly small map. It took a couple of minutes to install. There were a fair few Unknown Minecraft Block messages. I have downloaded and enabled the mods.

But, when I run the map I get nothing. I am in a completely empty world. I can look up and see the sun and clouds. All around I have blue and below there is a darker blue rectangle. It is as though none of the block got converted over.

I have tried the trick mentioned by dgm5555 an page 1 of this thread to show unknown blocks. No unknown blocks are shown.

I'm pretty sure it is a 1.8.9 map.

Any ideas what could be going wrong?
If you're using my version (github.com/sofar/mcimport), can you please start a thread in this topic instead? -> viewtopic.php?f=12&t=13709&hilit=mcimport

While the original code base is the same it's better to have the discussion where it's relevant.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] Converter Minecraft world to Minetest world

by bosapara » Post

deleted

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests