Page 1 of 1

Generating a world from existing XML

PostPosted: Sun May 31, 2015 16:18
by hughbar
Hi folks,

I'm a computer person but new to Minetest, looks great. I'd like to take an existing load of XML that 'could' define nodes and build a rough world with it.

From my limited understanding, I think I probably need to build a schem.mts file from my XML to get my starter world. I could also add API access to WorldEdit and drive that using the XML. One problem is that I can't see a specification for the schem file, if that is what I need?

Does all this sound ridiculous, is there a simpler way, has anyone else tried something like this with an external format (json would be OK too!)?

Thanks in advance Hugh

Re: Generating a world from existing XML

PostPosted: Sun May 31, 2015 18:48
by Sokomine
The .mts format is documented in the source code of Minetest, specificly mg_schematics.h. My handle_schematics mod reads and writes .mts files, specificly in analyze_mts_file.lua. Using voxelmanip directly might also be a solution for you. The mapgen version requires that you can reproduce your landscape exactly for a given mapchunk. The non-mapgen version depends a bit on available memory. Voxelmanip basicly allows you to manipulate a more or less 3d array of mapdata directly.

Re: Generating a world from existing XML

PostPosted: Mon Jun 01, 2015 07:47
by hughbar
Thanks very much for this. I'll take all the advice! If I make any progress with this, I'll make the code/process available.

Re: Generating a world from existing XML

PostPosted: Mon Jun 01, 2015 09:51
by kaeza
Not sure if this will be of much help, but my imageloader mod (repo link) loads 2D maps from image files. The algorithms are not particularly... *ahem* efficient, but can give you another example of how to create a schematic "table" (i.e. no need for intermediate files).