Protect existing blocks, but allow building.

Protect existing blocks, but allow building.

Postby wziard » Mon Mar 25, 2019 10:49 am

Is there any mod which supports this? I've looked through the forums, but couldn't find anything.

My guess would be that it should be possible (though expensive, server wise), by storing the protected status in the metadata of each block.

I'd very much like something like this, and I might try to create a mod like this myself, but that would be a waste of time of it already existed.

For example, on my server I built (together with some other kids) a village for our youngest members to 'live' in. The youngest ones still think the building to be tedious, but they love furnishing existing houses. One problem I encountered is that I now get inundated by requests to make repairs to the houses because one of the small kids ('accidentally') destroyed parts. I can't just protect the whole area, because that would make it impossible for them to build furniture/flowers etc. So I'd really like to protect the existing structures, but not disallow building new stuff.

I hacked the areas mod to allow building in a protected area, but that has the disadvantage that anything built is protected immediately, so you can't remove it anymore. my kids didn't like that either because they like to rearrange the furniture all the time :-)
wziard
Member
 
Posts: 131
Joined: Mon Oct 29, 2018 7:12 pm

Re: Protect existing blocks, but allow building.

Postby DrFrankenstone » Mon Mar 25, 2019 1:07 pm

I don't know of a mod, but I can offer another reason someone might like to make one...

It allows a city where anybody can build a house and "own" their parts, but anyone else can build hallways and buildings and bridges next to and on top of other people's buildings. Allowing a slum basically, a more poorly planned version of Kowloon Walled City. Each new building - and sometimes even roads - built on top of older or abandoned buildings, and with no 256 block height limit.

+ Spoiler

err...and because it helps the youngest players' enjoyment...
DrFrankenstone
Member
 
Posts: 103
Joined: Tue May 24, 2016 5:36 am
GitHub: treer

Re: Protect existing blocks, but allow building.

Postby Sokomine » Mon Mar 25, 2019 3:34 pm

There was the permafy mod on linuxgaming.us which stored protection status in metadata. It worked to a degree but had limitations, in particular with nodes that change their status (doors etc.). Empty air was also protected. In general, protection mods need to protect all in the given area in order to be save from griefers. Griefers don't always steal. They sometimes drop unwanted water and lava sources or other rubbish before you can ban the griefer.

For this particular case here, a mod like permafy (just using more modern methods) might really help. Just store in metadata of blocks that are not air that they're owned_by (ought to be something diffrent from the owned entry so that you can remove the protection without trouble) - and check in minetest.is_protected if that meta value is set. Won't be terribly efficient for servers, and it does not cover all the edge cases - but that hardly matters in your particular situation. Maybe you'd want to exclude nodes that drop dirt, sand, gravel and the like as well - after all some gardening may fall under the decoration aspect :-)
Sokomine
Member
 
Posts: 3750
Joined: Sun Sep 09, 2012 5:31 pm
GitHub: Sokomine

Re: Protect existing blocks, but allow building.

Postby twoelk » Mon Mar 25, 2019 4:04 pm

wouldn't it be easiest to either turn the building blocks into blocks you need certain privs to be able to interact with? or maybe restrict interact to certain groups like deco mods or flora ....

I assume you could restrict interact by having interact privs by mod name or node group
some servers do make use of bucket privs or restrict the ability of placing certain nodes to specific hights.
twoelk
Member
 
Posts: 1312
Joined: Fri Apr 19, 2013 4:19 pm
GitHub: twoelk
In-game: twoelk

Re: Protect existing blocks, but allow building.

Postby wziard » Mon Mar 25, 2019 4:30 pm

Sokomine wrote:TWon't be terribly efficient for servers, and it does not cover all the edge cases - but that hardly matters in your particular situation. Maybe you'd want to exclude nodes that drop dirt, sand, gravel and the like as well - after all some gardening may fall under the decoration aspect :-)

That's what I mean. I wonder what the hit on my server would be. Maybe I should first check an area and only if it's inside an area do the extra metadata checks.

Could be a nice idea to exclude dirt and gravel etc from protection as well..

I'll do some experiments (time allowing...)
wziard
Member
 
Posts: 131
Joined: Mon Oct 29, 2018 7:12 pm

Re: Protect existing blocks, but allow building.

Postby Fixer » Mon Mar 25, 2019 7:05 pm

Try this viewtopic.php?t=2800 (read the topic entirely before use, it is very old, there might be better alternatives), try looking content database or search the mods via https://krock-works.uk.to/minetest/modSearch.php
Fixer
Member
 
Posts: 891
Joined: Sun Jul 31, 2011 11:23 am
In-game: Fixer

Re: Protect existing blocks, but allow building.

Postby wziard » Mon Mar 25, 2019 9:21 pm

Thanks fixer. That first one is nearly what I need. I can use that as a starting point.
wziard
Member
 
Posts: 131
Joined: Mon Oct 29, 2018 7:12 pm

Re: Protect existing blocks, but allow building.

Postby ShadMOrdre » Tue Mar 26, 2019 12:49 am

I use cornernotes' node_owner mod. It essentially adds an "owner" property to spawned nodes, and prevents non-owners from destroying or building upon "owned" nodes. It also allows sharing, though I don't remember the exact mechanism.

This has helped me to limit the ability of my 7yo from damaging builds.
ShadMOrdre
Member
 
Posts: 297
Joined: Mon Dec 29, 2014 8:07 am
GitHub: ShadMOrdre
In-game: shadmordre

Re: Protect existing blocks, but allow building.

Postby Festus1965 » Tue Mar 26, 2019 1:00 am

I used two areas, the bigger one (1 node) to keep walls, windows, doors work, and an inner area for the inside of a room shared to kids, problem here sometime to add new as can nut stick to wall ...
Festus1965
Member
 
Posts: 966
Joined: Sun Jan 03, 2016 11:58 am
In-game: Thomas Explorer

Re: Protect existing blocks, but allow building.

Postby Astrobe » Wed Mar 27, 2019 7:26 pm

FWIW I use a variant of ProtectorRedo with a radius of 1; protection blocks are made relatively common but not craftable: they are stone brick/blocks that can be dug freely in ruins or dungeons (they become "protective" once placed by a player). I think it is very close to what you want - the perimeter (walls) is protected but not the volume (inside) - and relatively cheap (the protection mod just has to check for the presence of nodes with the "protected" group in a 1 block radius) but it has limitations and constrains.
Astrobe
Member
 
Posts: 232
Joined: Sun Apr 01, 2018 10:46 am

Re: Protect existing blocks, but allow building.

Postby sorcerykid » Mon Apr 01, 2019 5:29 am

I actually developed a mod last year that does. exactly what you want. It's a half working prototype, forked from protector redo, but entirely rewritten with tons of additional features. For what you need, the mod employs a bitmap mask for efficiently validating dig positions in a 3d area to determine if they are protected. I'll take a look and see if I can prepare it for release as a standalone mod. I believe all that remains is o add customizable permissions for shared chests and doors. And of course testing for 5.0 compatibility.
sorcerykid
Member
 
Posts: 1031
Joined: Fri Aug 26, 2016 3:36 pm
GitHub: sorcerykid
In-game: Nemo

Re: Protect existing blocks, but allow building.

Postby wziard » Wed Apr 03, 2019 10:38 am

interesting. I didn't yet get around to creating my own mod. I'll first look into yours if you can find the time time dump it somewhere :-)
wziard
Member
 
Posts: 131
Joined: Mon Oct 29, 2018 7:12 pm

Re: Protect existing blocks, but allow building.

Postby sorcerykid » Fri Apr 05, 2019 9:02 pm

Yes, I'll go ahead and send you a link to the source and assets later tonight. I can strip out the portions that are untested. But it should still work for your needs. Here's a quick rundown of the two types of protectors:

    Image
    Shared Protector
    Restricts building and mining within an 11m cubic area except by the owner or designated members. Digging and mining by members can be further restricted according to the bitmap mask of the area (see below). Shared Protectors can be useful for creating apartments and shared tree farms.

    Image
    Public Protector

    Restricts building and mining within an 11m cubic area according to the bitmap mask of the area (see below). Public Protectors can be useful for creating public tree farms and sandbox playgrounds.
The bitmap mask of shared protectors can be manually engaged or disengaged by right-clicking the protector and clicking "Lock Area" or "Unlock Area" respectively. Locking the area stores a "snapshot" of all non-air and non-liquid nodes as a bitmap into the metadata of the protector (compressed for space efficiency) . For public protectors, the bitmap mask is automatically engaged at all times.

Image

I also resolved the long-range dig exploit, whereby hackers could dig nodes adjacent to unloaded mapblocks to evade protection. The server operator, of course, can bypass this restriction.

Tip: If there are overlapping protected areas owned by the same player, then the most restrictive bitmap mask is used to determine whether any given node is protected from mining or building.

Tip: When engaging a bitmap mask, only air and liquid nodes are unmasked and all other nodes are masked. To protect an open area (like a hallway), it should be filled temporarily beforehand.
sorcerykid
Member
 
Posts: 1031
Joined: Fri Aug 26, 2016 3:36 pm
GitHub: sorcerykid
In-game: Nemo

Re: Protect existing blocks, but allow building.

Postby wziard » Wed Apr 17, 2019 12:09 pm

Did you get around to putting this somewhere? It looks like exactly what I planned on making myself.
wziard
Member
 
Posts: 131
Joined: Mon Oct 29, 2018 7:12 pm

Re: Protect existing blocks, but allow building.

Postby ShadMOrdre » Wed Apr 17, 2019 10:23 pm

wziard,

I had somehow overlooked that I had updated the node_owner mod.

Here is my fork, on git, node_owner. The issue with the original, was that a function call in the code omitted a newer parameter for that function, accommodating param2.

My copy has worked for me since at least v0416. It is currently in use on my server, running MTv501. Maybe this can help. It adds an _owner property to nodes in world, and whoever places a node, owns that node.
ShadMOrdre
Member
 
Posts: 297
Joined: Mon Dec 29, 2014 8:07 am
GitHub: ShadMOrdre
In-game: shadmordre

Re: Protect existing blocks, but allow building.

Postby sorcerykid » Fri Apr 19, 2019 10:52 pm

wziard wrote:Did you get around to putting this somewhere? It looks like exactly what I planned on making myself.


Yes, my sincerest apologies. Some other priorities came up last week, so it completely slipped my mind to send you the URL. Here is the repository: https://bitbucket.org/sorcerykid/protector

There are only two dependencies, both very lightweight:
This version adds support for copying and pasting of bitmap masks as well. So if you are creating very large tree farms, public mines, etc. then you can construct a template of the region that you want to protect in a staging area, and then apply a snapshot of that region to any number of other protectors.

Also the shared protector has options to prevent unwanted griefing of public areas with undiggable nodes (locked chests or steel doors).

Image

I might go ahead and make video demonstrating the various features. Hope it's helpful!
.
sorcerykid
Member
 
Posts: 1031
Joined: Fri Aug 26, 2016 3:36 pm
GitHub: sorcerykid
In-game: Nemo



Return to General Discussion



Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests