Discussion regarding Minecraft map to Minetest world conversion.

Post Reply
talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Discussion regarding Minecraft map to Minetest world conversion.

by talamh » Post

    It seems that there has been an increase in interest in writing minecraft map to minetest world converters of late, possibly spurred on by the fact that de facto converter mcimport cant convert maps made with the latest versions of minecraft (version 1.14.4+).

    Since I am working on an (unreleased) converter myself I thought it might be a good idea to share ideas, and ask for ideas, about what exactly a converter should do and how it should do it.

    Here are a few things that I consider essential features (feel free to differ):

    [*] Ease of use for non technical users.

    [*]Support all existing minecraft map formats - not difficult as the minecraft map format has only had minor changes over the years.

    [*]Fast conversion - there are limits to how fast we can convert since minecraft region files need to be decompressed, and minetest mapblocks have their node data and meta data compressed, however conversion times can be reduced if we avoid lots of needless calculations. For example if the minecraft block x,y,z in a minecraft section should be translated to a certain position in a minetest mablock, well the block x,y,z in all sections will have the same translation, calculate once then in future just look up the answer.

    [*]Support minetest game and mineclone 2 - I consider this the absolute minimum level of support, funny thing is mineclone 2 is easier to support than minetest game but tends to get ignored for some reason.

    Things that would be nice to have:

    [*] First time you load the converted map you should spawn at a sane location, this is generally quite simple as the spawn position is stored in minecraft's level.dat file, the values in level.dat can be overridden but that's quite rare in my experience and can be detected anyway.

    [*] Fix the water level. Sea level is at 62 in minecraft which is a tad awkward as it's not a multiple of 16 (size of sections and mapblocks). Fixing to within 2 nodes is trivial, fixing sea level exactly is a little more involved but doable with only a small impact on conversion times - is it something that's worth doing?

    [*] Chest contents. Should the contents of chests be converted, again not difficult to implement and has only a small impact on conversion times but is it really needed?

    Anyway, any features you think a converter should have etc let me know here.

    Starbeamrainbowlabs
    Member
    Posts: 66
    Joined: Sat May 26, 2018 11:25
    GitHub: sbrl
    Location: Nowhere, Everywhere, and Somewhere inbetween
    Contact:

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by Starbeamrainbowlabs » Post

    Ah, thanks for starting this thread!

    Yeah, there are lots of different features that would be nice to have. Perhaps it would be an idea to prioritise them, and have a minimum set of features that would allow it to work, and then have some extras that can be worked on incrementally?

    For instance, I'd suggest that these are essential:
    • Ease of use
    • Support for all existing MC formats
    • Fast conversion (maybe the region files could be decompressed in parallel or something?
    • Support either minetest-game or mineclone2
    Perhaps these would be nice to have?
    • Signs
    • Support both minetest-game and mineclone2
    • Sane spawning location
    • Chest contents
    • Fixing water level
    • Support for extending the conversion table with extra mods
    Also, I discovered recently that schematics are a thing. They are apparently stored as NBT, and there's some sort of a spec here: https://minecraft.gamepedia.com/Schematic_file_format

    Once you open-source it, I might try and work on adding support for these schematics too (so many ideas! it's terrible deciding which one to choose to implement first...).

    Either way, I'm excited about the prospect of a better conversion program :D

    talamh
    Member
    Posts: 156
    Joined: Sun Nov 12, 2017 18:24

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by talamh » Post

    Region files can be converted in parallel, actually since region files are independent of each other you could use multiple machines to do the conversion and merge the outputted map databases. Might be losing a bit of the "ease of use" in that case though :)

    Signs yes, I forgot to mention those. The nbt parser I am using https://github.com/Hugobros3/Enklume has a class called SignParseUtil, I have not tried it as yet, or even looked at it's code, but it's name seems promising!

    Conversion tables are currently hardcoded, but I intend to have them in external files so adding support for other mods wont be a problem.

    Haven't really considered schematics, just had a look at the page you linked and it seems straight forward. Will need to look at a few using nbt explorer at some point.

    I'm off to attempt to fix the water level properly, should keep me amused for a while.

    Starbeamrainbowlabs
    Member
    Posts: 66
    Joined: Sat May 26, 2018 11:25
    GitHub: sbrl
    Location: Nowhere, Everywhere, and Somewhere inbetween
    Contact:

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by Starbeamrainbowlabs » Post

    talamh wrote:
    Sat Jun 20, 2020 14:38
    Region files can be converted in parallel, actually since region files are independent of each other you could use multiple machines to do the conversion and merge the outputted map databases. Might be losing a bit of the "ease of use" in that case though :)
    Nice! Yeah, I think multi-threading is probably enough :P
    talamh wrote:
    Sat Jun 20, 2020 14:38
    Signs yes, I forgot to mention those. The nbt parser I am using https://github.com/Hugobros3/Enklume has a class called SignParseUtil, I have not tried it as yet, or even looked at it's code, but it's name seems promising!
    That does sound promising! Definitely a nice-to-have there - and a cool little mostly self-contained project PR there I think.
    talamh wrote:
    Sat Jun 20, 2020 14:38
    Conversion tables are currently hardcoded, but I intend to have them in external files so adding support for other mods wont be a problem.
    Awesome!
    talamh wrote:
    Sat Jun 20, 2020 14:38
    Haven't really considered schematics, just had a look at the page you linked and it seems straight forward. Will need to look at a few using nbt explorer at some point.

    I'm off to attempt to fix the water level properly, should keep me amused for a while.
    Ah, cool. I originally found a download option for one on planetminecraft.com. That NBTExplorer looks very cool, and also seems to be backed by an amazing .NET library too!

    Good luck!

    User avatar
    Sharpik
    Member
    Posts: 28
    Joined: Tue Feb 04, 2020 21:27
    GitHub: Sharpik
    Location: Prague, Czech Republic

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by Sharpik » Post

    talamh wrote:
    Sat Jun 20, 2020 14:38
    Hi, any news abou progress with Yours MC to MT map converter?
    Thanks

    talamh
    Member
    Posts: 156
    Joined: Sun Nov 12, 2017 18:24

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by talamh » Post

    Sharpik wrote:
    Tue Sep 15, 2020 20:24
    talamh wrote:
    Sat Jun 20, 2020 14:38
    Hi, any news abou progress with Yours MC to MT map converter?
    Thanks
    Unfortunately I have not really had much time to put a lot of work into it lately, but I have the end of this week and all of next week free so I will work on it then.

    Current status is it can convert about 5x or 6x faster than mcimport when running on a single thread. Default # of threads used is (#CPUs * 2) - 2 so on my test machine I tend to get about 30 to 35 times faster conversion, this will certainly get slower as I try to convert in greater detail (chest contents etc). At the moment I can only convert older maps but compatibility is the next thing I intend to work on. Also need to work on the GUI as easy to use is one of my top goals.

    User avatar
    Sharpik
    Member
    Posts: 28
    Joined: Tue Feb 04, 2020 21:27
    GitHub: Sharpik
    Location: Prague, Czech Republic

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by Sharpik » Post

    talamh wrote:
    Sat Jun 20, 2020 14:38
    Unfortunately I have not really had much time to put a lot of work into it lately, but I have the end of this week and all of next week free so I will work on it then.

    Current status is it can convert about 5x or 6x faster than mcimport when running on a single thread. Default # of threads used is (#CPUs * 2) - 2 so on my test machine I tend to get about 30 to 35 times faster conversion, this will certainly get slower as I try to convert in greater detail (chest contents etc). At the moment I can only convert older maps but compatibility is the next thing I intend to work on. Also need to work on the GUI as easy to use is one of my top goals.
    Thanks for response.
    Are You going to share it on public for testing? :)
    If so I gladly test it for you. Especially when it will support custom block settings.

    Thank You for Your work

    bzt
    Member
    Posts: 217
    Joined: Tue Sep 24, 2019 14:26

    Re: Discussion regarding Minecraft map to Minetest world conversion.

    by bzt » Post

    Hi,
    Starbeamrainbowlabs wrote:
    Sat Jun 20, 2020 14:14
    Support both minetest-game and mineclone2
    This only means to use different node names, that's all. MCL2 has almost every nodes which might appear in MC, but for MTG you'll need mods. I have created a (not full) cross-reference for these. My schematic editor use this csv to convert between different games. Second coloumn is the MC block id, third is the MC block name, sixth is MCL2 name finally seventh coloumn is the MTG name. Example:

    Code: Select all

    Acacia_Fence,192,minecraft:acacia_fence,,,mcl_fences:acacia_fence,default:fence_acacia_wood
    Starbeamrainbowlabs wrote:
    Sat Jun 20, 2020 14:14
    Also, I discovered recently that schematics are a thing. They are apparently stored as NBT, and there's some sort of a spec here: https://minecraft.gamepedia.com/Schematic_file_format
    Actually those are already obsolete. Most schematics you can find on the net use Sponge Schematic 2.0 format (which is also NBT encoded), here I wrote about it.
    Starbeamrainbowlabs wrote:
    Sat Jun 20, 2020 14:14
    Once you open-source it, I might try and work on adding support for these schematics too (so many ideas! it's terrible deciding which one to choose to implement first...).
    I've already implemented an Open Source converter which can import virtually all schematic and voxel formats. Feel free to use my source! MIT licensed.

    Cheers,
    bzt

    Post Reply

    Who is online

    Users browsing this forum: No registered users and 4 guests