Map unexplore python script

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Map unexplore python script

by lag01 » Sat Oct 11, 2014 20:37

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.
Last edited by lag01 on Thu Mar 17, 2016 21:49, edited 1 time in total.
 

Sokomine
Member
 
Posts: 3978
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Map unexplore python script

by Sokomine » Thu Oct 16, 2014 01:40

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?
A list of my mods can be found here.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Map unexplore python script

by lag01 » Thu Oct 16, 2014 21:12

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.
Attachments
map.png
(3.02 KiB) Not downloaded yet
 

Sokomine
Member
 
Posts: 3978
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Map unexplore python script

by Sokomine » Fri Oct 17, 2014 02:24

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.
A list of my mods can be found here.
 

User avatar
VanessaE
Moderator
 
Posts: 4484
Joined: Sun Apr 01, 2012 12:38
Location: Western NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: Map unexplore python script

by VanessaE » Fri Oct 17, 2014 02:33

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...
 

Sokomine
Member
 
Posts: 3978
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Map unexplore python script

by Sokomine » Fri Oct 17, 2014 02:41

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.
A list of my mods can be found here.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Map unexplore python script

by lag01 » Fri Oct 17, 2014 19:26

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.
Attachments
map1.png
(4.16 KiB) Not downloaded yet
 

User avatar
rubenwardy
Moderator
 
Posts: 6022
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

twoelk
Member
 
Posts: 1353
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: Map unexplore python script

by twoelk » Wed Oct 22, 2014 19:43

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.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Map unexplore python script

by lag01 » Wed Oct 22, 2014 20:26

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
 

twoelk
Member
 
Posts: 1353
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: Map unexplore python script

by twoelk » Wed Oct 22, 2014 21:49

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.
 

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Re: Map unexplore python script

by aldobr » Sat Nov 29, 2014 21:00

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.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Map unexplore python script

by lag01 » Sat Nov 29, 2014 21:54

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...
 

twoelk
Member
 
Posts: 1353
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: Map unexplore python script

by twoelk » Mon Dec 01, 2014 13:23

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
 

User avatar
Khyota
New member
 
Posts: 3
Joined: Wed Feb 05, 2014 17:35
In-game: Maliku

Re: Map unexplore python script

by Khyota » Sat Dec 29, 2018 01:15

Dungeons get left behind because they're made of cobblestone.
 


Return to Minetest-related projects



Who is online

Users browsing this forum: No registered users and 10 guests