Map unexplore python script
- lag01
- Member
- Posts: 321
- Joined: Sun Mar 16, 2014 03:41
- GitHub: AndrejIT
- IRC: lag01
- In-game: lag
- Contact:
Map unexplore python script
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.
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.
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Map unexplore python script
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.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.
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.
- lag01
- Member
- Posts: 321
- Joined: Sun Mar 16, 2014 03:41
- GitHub: AndrejIT
- IRC: lag01
- In-game: lag
- Contact:
Re: Map unexplore python script
Thanks for inspiration, today i tried to do something like this and added code to same Github (file domap.pySokomine 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?
I tried to make code simple and fast and result is like image bellow:
Be aware, that to work faster it only checks blocks where Y>-5*16 and Y<5*16.
- Attachments
-
- map.png (3.02 KiB) Viewed 1693 times
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Map unexplore python script
Looks promising already! Which map had it been used on?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:
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.lag01 wrote: Be aware, that to work faster it only checks blocks where Y>-5*16 and Y<5*16.
A list of my mods can be found here.
- 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
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...
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Map unexplore python script
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.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...
A list of my mods can be found here.
- lag01
- Member
- Posts: 321
- Joined: Sun Mar 16, 2014 03:41
- GitHub: AndrejIT
- IRC: lag01
- In-game: lag
- Contact:
Re: Map unexplore python script
You are right about scanning all blocks, i did full Y scan and map is looking much more complete, with cobble roads etc visible: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.
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) Viewed 1693 times
- 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
Very nice.
-
- 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
hm, if that is the "just test" server some of my areas of activity seem to be out of area ;-Plag01 wrote:...
i did full Y scan and map is looking much more complete, with cobble roads etc visible
...
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.
- lag01
- Member
- Posts: 321
- Joined: Sun Mar 16, 2014 03:41
- GitHub: AndrejIT
- IRC: lag01
- In-game: lag
- Contact:
Re: Map unexplore python script
Yes, it is this server. The image above is from 1600 nodes radius, with other areas cutted.twoelk wrote:hm, if that is the "just test" server some of my areas of activity seem to be out of area ;-Plag01 wrote:...
i did full Y scan and map is looking much more complete, with cobble roads etc visible
...
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.
I shrinked map last Saturday, but looks like no one has noticed :P
-
- 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
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.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
Spoiler
an older view of the upper part of said stream flowing down from my castle hill on the Just Test server
Re: Map unexplore python script
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.
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.
- lag01
- Member
- Posts: 321
- Joined: Sun Mar 16, 2014 03:41
- GitHub: AndrejIT
- IRC: lag01
- In-game: lag
- Contact:
Re: Map unexplore python script
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.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.
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...
-
- 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
lollag01 wrote:... of course, someone can build house from dirt or stone, and without torches and single cobble block...
"stealth" mode for Minetest architects .... maybe I should hide my buildings under a shield of stones ;-D
Re: Map unexplore python script
Dungeons get left behind because they're made of cobblestone.
- maikerumine
- Member
- Posts: 1420
- Joined: Mon Aug 04, 2014 14:27
- GitHub: maikerumine
- In-game: maikerumine
Re: Map unexplore python script
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
Who is online
Users browsing this forum: No registered users and 10 guests