Map unexplore python script

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

Map unexplore python script

by lag01 » Post

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: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Map unexplore python script

by Sokomine » Post

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: 321
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
Contact:

Re: Map unexplore python script

by lag01 » Post

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
map.png (3.02 KiB) Viewed 1692 times

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

Re: Map unexplore python script

by Sokomine » Post

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: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: Map unexplore python script

by VanessaE » Post

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: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Map unexplore python script

by Sokomine » Post

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: 321
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
Contact:

Re: Map unexplore python script

by lag01 » Post

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
map1.png (4.16 KiB) Viewed 1692 times

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

Re: Map unexplore python script

by rubenwardy » Post

Very nice.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: Map unexplore python script

by twoelk » Post

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: 321
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
Contact:

Re: Map unexplore python script

by lag01 » Post

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: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: Map unexplore python script

by twoelk » Post

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.
Spoiler
Imagean older view of the upper part of said stream flowing down from my castle hill on the Just Test server
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 » Post

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: 321
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
Contact:

Re: Map unexplore python script

by lag01 » Post

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: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: Map unexplore python script

by twoelk » Post

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

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

Re: Map unexplore python script

by Khyota » Post

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

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: Map unexplore python script

by maikerumine » Post

VanessaE wrote:
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...
If it helps with server integrity then OK, right?
It also regenerates ore so it is very good.

Was this an old post, I am mistaken by the libations. Sorry.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
goats
Member
Posts: 212
Joined: Thu Nov 21, 2019 05:29

Re: Map unexplore python script

by goats » Post

maikerumine wrote:
Sat Jan 09, 2021 06:17
Was this an old post
:D

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests