Page 1 of 1

Map unexplore python script

PostPosted: Sat Oct 11, 2014 20:37
by lag01
Hi,
i wrote script to "unexplore" sqlite minetest map(v25).
It leaves only circle area around map center + blocks with nodes typically created by players. All other blocks are removed and are supposed to be regenerated by mapgen.
Also file mt_block_parser.py can be used independently to read data from blocks.

UPD. Improved parsing and reassembling. Tested it with new mirrormap.py script.
Now, mt_block_parser.py can be used as Python library to manipulate data of map blocks and nodes.

I put this on Github and i hope it's code is straightforward enough to be improved by others.

Re: Map unexplore python script

PostPosted: Thu Oct 16, 2014 01:40
by Sokomine
lag01 wrote:It leaves only circle area around map center + blocks with nodes typically created by players. All other blocks are removed and are supposed to be regenerated by mapgen.
Also file mt_block_parser.py can be used independently to read data from blocks.

That might come in very handy whenever a server map has grown into the GB range, with most of the surface around spawn having been explored, and some new plants or landscaping mods added.

Can you make it so that your script interacts with minetestmapper (or does its own maps)? Maps where only areas where players built something show up/get highlighted?

Re: Map unexplore python script

PostPosted: Thu Oct 16, 2014 21:12
by lag01
Sokomine wrote:Can you make it so that your script interacts with minetestmapper (or does its own maps)? Maps where only areas where players built something show up/get highlighted?


Thanks for inspiration, today i tried to do something like this and added code to same Github (file domap.py
I tried to make code simple and fast and result is like image bellow:
Image
Be aware, that to work faster it only checks blocks where Y>-5*16 and Y<5*16.

Re: Map unexplore python script

PostPosted: Fri Oct 17, 2014 02:24
by Sokomine
lag01 wrote:Thanks for inspiration, today i tried to do something like this and added code to same Github (file domap.py
I tried to make code simple and fast and result is like image bellow:

Looks promising already! Which map had it been used on?

lag01 wrote:Be aware, that to work faster it only checks blocks where Y>-5*16 and Y<5*16.

That might not be enough. There are sometimes underground cities which are close to impossible to find if there's no clue. Apart from the blocks placed by mapgen, also torches and cobble ought to be ignored. Torches are used to illuminate places and may be located in mines. Cobble is sometimes used as a helper/fill node where no actual building is present.

Re: Map unexplore python script

PostPosted: Fri Oct 17, 2014 02:33
by VanessaE
That may be true, but one doesn't want a large, complex mine to be destroyed/lost by running this program I wouldn't think...

Re: Map unexplore python script

PostPosted: Fri Oct 17, 2014 02:41
by Sokomine
VanessaE wrote:That may be true, but one doesn't want a large, complex mine to be destroyed/lost by running this program I wouldn't think...

Hm, it depends. If it's such an important mine, it might get saved manually. But in general...how often does one re-visit parts of the mine? It's usually seeking new areas in order to get more ores.

Re: Map unexplore python script

PostPosted: Fri Oct 17, 2014 19:26
by lag01
Sokomine wrote:That might not be enough. There are sometimes underground cities which are close to impossible to find if there's no clue. Apart from the blocks placed by mapgen, also torches and cobble ought to be ignored. Torches are used to illuminate places and may be located in mines. Cobble is sometimes used as a helper/fill node where no actual building is present.

You are right about scanning all blocks, i did full Y scan and map is looking much more complete, with cobble roads etc visible:
Image
Torches and cobble lets best stay as default in remap.py, some people may like exploring catacombs or starting their own mine from there.
Well, for mapper marking every lone torch or cobble block as built-up is not good, i think i will mark parts like that with different color.

Re: Map unexplore python script

PostPosted: Fri Oct 17, 2014 22:05
by rubenwardy
Very nice.

Re: Map unexplore python script

PostPosted: Wed Oct 22, 2014 19:43
by twoelk
lag01 wrote:...
i did full Y scan and map is looking much more complete, with cobble roads etc visible
...

hm, if that is the "just test" server some of my areas of activity seem to be out of area ;-P
I once tried to map bones in bright red, that might give interesting results on servers such as this with lots of bones lying around.
I noticed some players used torches or cobble blocks to mark paths, so I guess at least torches on the surface might add information about player roaming activity.

Re: Map unexplore python script

PostPosted: Wed Oct 22, 2014 20:26
by lag01
twoelk wrote:
lag01 wrote:...
i did full Y scan and map is looking much more complete, with cobble roads etc visible
...

hm, if that is the "just test" server some of my areas of activity seem to be out of area ;-P
I once tried to map bones in bright red, that might give interesting results on servers such as this with lots of bones lying around.
I noticed some players used torches or cobble blocks to mark paths, so I guess at least torches on the surface might add information about player roaming activity.


Yes, it is this server. The image above is from 1600 nodes radius, with other areas cutted.
I shrinked map last Saturday, but looks like no one has noticed :P

Re: Map unexplore python script

PostPosted: Wed Oct 22, 2014 21:49
by twoelk
lag01 wrote:...
Yes, it is this server. The image above is from 1600 nodes radius, with other areas cutted.
I shrinked map last Saturday, but looks like no one has noticed :P


Don't know if it is related but some of my mines had some regenerated layers, including ores, through some existing shafts (plus some other player activity), a stream I had carefully built down my castle hill is totaly reset just as the ponds it fed (I filled them with buckets of water of course) and some other stuff of my activity I can't remember now seems to have been undone. Nothing really important though.
+ some 2km from spawn


edit: Just noticed another mine with regenerated layers including ores near -170 and -208 depth some 3 or 4 nodes thick.

Re: Map unexplore python script

PostPosted: Sat Nov 29, 2014 21:00
by aldobr
Map format has no support to know if the node was created by mapgen or by user, so, i think it is very dangereous to be used...

We need a modified map file format (sqlite schema) that stores info about chunk modification. A simple flag to be stored into the database allowing to detect if a chunk was merely created by the mapgen without being changed or if it was changed by some player. THEN we can have that kind of application.

Re: Map unexplore python script

PostPosted: Sat Nov 29, 2014 21:54
by lag01
aldobr wrote:Map format has no support to know if the node was created by mapgen or by user, so, i think it is very dangereous to be used...

We need a modified map file format (sqlite schema) that stores info about chunk modification. A simple flag to be stored into the database allowing to detect if a chunk was merely created by the mapgen without being changed or if it was changed by some player. THEN we can have that kind of application.


Well, there already is block last modification date field and i hawe taken some steps to read it. But mods, like lava cooling and plants growing, are also modifying map blocks if player is near.

For simple, just for fun map, current script is enough i think... of course, someone can build house from dirt or stone, and without torches and single cobble block...

Re: Map unexplore python script

PostPosted: Mon Dec 01, 2014 13:23
by twoelk
lag01 wrote:... of course, someone can build house from dirt or stone, and without torches and single cobble block...


lol
"stealth" mode for Minetest architects .... maybe I should hide my buildings under a shield of stones ;-D