[Mod] BlockProtectNodes [2020-03-30][blockprotectnodes]

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

[Mod] BlockProtectNodes [2020-03-30][blockprotectnodes]

by AlexYst » Post

There are so many different protection mods, all mostly seeking to do the same thing: prevent vandalism. I'm not going to pretend my protection is any better than the others; it's just a different brand of the same thing. The existing mods didn't have quite what I was looking for though, so I built my own.

I really enjoy Glomie-style protection. Mods that offer it include Glomie's original version, as well as Zeg9's and TenPlus1's more modern versions. I like that they provide a cost to protection. You must craft the nodes using the materials you've gathered. I love that they put protection in the hands of the people, so reliance on administrative staff is minimised. However, they include a fatal flaw. They rely on the nodes around a protected node to be loaded, so the protector node can be found. This has led to a glitch in at least the earlier versions of this protection, in which sometimes, the protection could be mysteriously bypassed for a second or two while the nearby block containing the protector node was loading. It's an artefact of the way the Minetest engine loads the map. One annoyance of this was that one might place a node, then be unable to pick it back up because it was protected. This could be fixed (and likely *has* been fixed in later versions, I haven't looked at the code) by treating all unloaded nodes as protectors. However, you then have the problem in the other direction, that some unprotected nodes can't be used, at least not right away.

The other major style of protection uses "areas", stored as coordinate pairs in a file external to the map file. I've never really been ecstatic with this type of protection, but I have worked with a very functional version of it at one point. Usually, administrative staff are required to set the protected areas, which has always rubbed me the wrong way (both when I'm an administrator and when I'm a player); I've always wanted that power directly in the hands of the players. Some more-modern implementations do allow players to set their own protected areas though. However, there's often no cost to protecting anything, and sometimes even worse, there's a limit to how many areas you can protect. The limit seeks to keep players from going nuts and protecting a bunch of stuff they won't use, but it prevents big-time builders from getting much done without administrative intervention. This same effect could be achieved without the negative aspects if a cost for protection were introduced.

Both styles also suffer from a strange quirk, in which if protected regions are close together, but not touching, there's an unprotectable gap between them. It makes sense, given their design, but it seems like something we can fix. Enter BlockProtectNodes.

BlockProtectNodes is simply my brand of protection, an attempt to remove the issues that bother me, introducing other issues in the process. In particular, BlockProtectNodes isn't the easiest to work with, as it can be difficult for the less mathematically-inclined to understand what will be protected by a protector node and what won't be.

BlockProtectNodes borrows heavily from the concept of Glomie-style protection. It might even be Glomie-style's estranged cousin. The basic premise is that you place protector nodes, and those node protect the *map block* they are placed in. As a result, if any nodes a given protector protects are loaded, they're guaranteed to *all* be loaded, including the protector node itself. It not only accounts for the way the map is loaded, but outright *depends on it and puts it to work*.

Image

Protection nodes glow slightly, and thanks to the magic of modern dying technology, they come in over a dozen colours.

Image

If enabled, BlockProtectNodes can add a page to the player inventory menu explaining protection nodes and showing their crafting recipe, but this is disabled by default.

Image

Dependencies: default, dye, and (only if you want to enable the inventory menu page) sfinv
Code license: GNU LGPLv2+
Resource license: CC BY-SA 3.0

Download: <https://notabug.org/y.st./blockprotectn ... master.zip>
Repository: <https://notabug.org/y.st./blockprotectnodes>
Attachments
29.palette.png
29.palette.png (114.46 KiB) Viewed 1044 times
screenshot_20200329_141414.png
screenshot_20200329_141414.png (160.96 KiB) Viewed 1044 times
screenshot_20200329_140507.png
screenshot_20200329_140507.png (108.35 KiB) Viewed 1044 times
Last edited by AlexYst on Mon Mar 30, 2020 19:34, edited 8 times in total.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by azekill_DIABLO » Post

*clap clap clap*

What can I say? +1
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Lone_Wolf » Post

This is great!
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Stix » Post

i didnt know about the bug but this method is great, i also like the formspec page explaining how it works +1
Hey, what can i say? I'm the bad guy.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Byakuren » Post

What about using protection nodes to apply protected areas with arbitrary centers, but keep track of the locations separately so that the map doesn't need to be examined to determine protection? Though applying to a mapblock might be considered an advantage in itself, since you don't have to be as exact with protector placements.
Every time a mod API is left undocumented, a koala dies.

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by AlexYst » Post

Byakuren wrote:What about using protection nodes to apply protected areas with arbitrary centers, but keep track of the locations separately so that the map doesn't need to be examined to determine protection? Though applying to a mapblock might be considered an advantage in itself, since you don't have to be as exact with protector placements.
The lack of arbitrary centres is the only difference between this mod and Glomie-style protection mods. Arbitrary centres are available in existing mods, so there's no need for me to reinvent that.

Arbitrary centres are great, but they'd break one of the main features of this mod. As stated in the topic post, this mod prevents oddly-placed protected areas with unprotectable gaps between them. For example, say the protected areas were centred on the nodes and they had a range of eight nodes away from that central node. What happens when player A places one thirty nodes away from one player B placed? You end up with a gap of fourteen nodes between, where no player may place a protection node. (Protecting eight nodes away means that the area protected has a width of 8*2+1==17, as there's the protection on both sides of the node, plus where the node itself rests.) It's usable land, but it's not protectable land.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Byakuren » Post

Ah, ok, that makes sense.

Just to nitpick though, you could protect that land in your specific example by placing a protection node close to but not in the protected area (and within one of the other protected areas).
Every time a mod API is left undocumented, a koala dies.

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by AlexYst » Post

Byakuren wrote:Ah, ok, that makes sense.

Just to nitpick though, you could protect that land in your specific example by placing a protection node close to but not in the protected area (and within one of the other protected areas).
You *can't* though, that's the thing. Not unless you're one of the two people with protect nodes nearby. A third person can't come and use the unused land between.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Byakuren » Post

I meant for one of the people who already protected an area. I thought your point was that neither protecting player could protect the middle area, because otherwise your example would not need two players.
Every time a mod API is left undocumented, a koala dies.

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by AlexYst » Post

Byakuren wrote:I meant for one of the people who already protected an area. I thought your point was that neither protecting player could protect the middle area, because otherwise your example would not need two players.
Yeah. It's funny you should mention that, as I nearly mentioned in myself in that last post. I didn't though, to keep it simple.

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

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Sokomine » Post

In how far is this diffrent from the Landrush/landclaim protection method? That one was used on the old Landrush server and worked more or less the same way. But...even if it's so similar: Don't worry. Many mods are like this. Happens all the time to modders :-)

The block has a nice texture and a very intresting formspec with a nice help text.

The Landrush approach worked IMHO a lot better than the protector mod approach. I personally don't like the protector mod because I always end up with corners that nobody can protect and where the griefers win in the end. Huge areas plastered with protection nodes or signs are also not that great to look at. I also tend to forget corners of my buildings which then get griefed as well. Landrush afaik had the drawback of hurting players for trying to dig/place in protected areas. Which is not so great if you're just trying to find out who built that nice house over there...hope such a "feature" will not be included here.
A list of my mods can be found here.

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by AlexYst » Post

Sokomine wrote:In how far is this diffrent from the Landrush/landclaim protection method? That one was used on the old Landrush server and worked more or less the same way. But...even if it's so similar: Don't worry. Many mods are like this. Happens all the time to modders :-)

The block has a nice texture and a very intresting formspec with a nice help text.

The Landrush approach worked IMHO a lot better than the protector mod approach. I personally don't like the protector mod because I always end up with corners that nobody can protect and where the griefers win in the end. Huge areas plastered with protection nodes or signs are also not that great to look at. I also tend to forget corners of my buildings which then get griefed as well. Landrush afaik had the drawback of hurting players for trying to dig/place in protected areas. Which is not so great if you're just trying to find out who built that nice house over there...hope such a "feature" will not be included here.
Three years ago, I lost my data due to a hard drive failure. Normally, I have a backup copy, but I'd just backed my data up, then wiped my computer with the initial copy. The backup drive failed, so I lost everything, including my password database. I lost all my accounts everywhere on the Internet, including this forum.

Anyway, I was the one that built the mod that landrush is based on, though I have no way to prove that old account was mine. My idea continues to evolve, but keeps certain similarities, which is why landrush seems so similar to this. The main difference is that landrush was based on a version of my mod in which the protection node would disappear from the map after being placed. As far as I know, landrush still contains that behaviour. This version not only uses the new protection API (landrush may have been updated to do this as well), but also keeps the nodes on the map for easy removal.

My mods will never hurt players for unknowingly trying to build somewhere that's owned. I only seek to keep vandals from doing their damage, not punish anyone (not even the vandals).

Speaking of which, I learned yesterday that fire doesn't respect the minetest.is_protected() function. I might build a workaround into this mod. My old mod had fire protection, but that was before minetest.is_protected() was added to the API.

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

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Sokomine » Post

AlexYst wrote: Three years ago, I lost my data due to a hard drive failure. Normally, I have a backup copy, but I'd just backed my data up, then wiped my computer with the initial copy. The backup drive failed, so I lost everything, including my password database. I lost all my accounts everywhere on the Internet, including this forum.
That sounds extremly bad. I'm glad you showed up with a new account at least.
AlexYst wrote: Anyway, I was the one that built the mod that landrush is based on, though I have no way to prove that old account was mine. My idea continues to evolve, but keeps certain similarities, which is why landrush seems so similar to this. The main difference is that landrush was based on a version of my mod in which the protection node would disappear from the map after being placed. As far as I know, landrush still contains that behaviour. This version not only uses the new protection API (landrush may have been updated to do this as well), but also keeps the nodes on the map for easy removal.
Aaah. That certainly explains why it sounds so familiar. The version of your mod on the Landrush server worked very well for many years. The server has been back online for a while but currently does not seem to be there. Builders where happy with the protection the mod provided. I'm glad the mod is back and will be maintained again.
Keeping the block placed instead of letting it vanish sounds good.
AlexYst wrote: My mods will never hurt players for unknowingly trying to build somewhere that's owned. I only seek to keep vandals from doing their damage, not punish anyone (not even the vandals).
Thank you! Some server owners seem to confuse those things and don't understand that there are reasons for placing/digging attempts other than griefing.
AlexYst wrote: Speaking of which, I learned yesterday that fire doesn't respect the minetest.is_protected() function. I might build a workaround into this mod. My old mod had fire protection, but that was before minetest.is_protected() was added to the API.
Fire is a very very bad to have on a server. AFAIK it's disabled for servers by default now. Many less experienced server owners where wondering why their server consumed so much CPU power...while a forrest fire was ravenging inside the next best rainforrest. If anything, fire needs to respect protection as such and not be checked for in individual protection mods.
A list of my mods can be found here.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Stix » Post

perhaps punching the node should show the area it protects like most mods? otherwise this is practically unusuable to any new player that doesnt understand the coordinate system. (changing this will also make it much less of a hassle to see if your protectection covers your house).
Hey, what can i say? I'm the bad guy.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by texmex » Post

I second Stix’s feature suggestion as this mod would indeed be even greater with it.

Something like this:
Image
Image
Image
Attachments
Jgz6VP5.png
Jgz6VP5.png (825.28 KiB) Viewed 1044 times
JxSxgVy.jpg
JxSxgVy.jpg (451.93 KiB) Viewed 1044 times
5KQV3TI.png
5KQV3TI.png (685.84 KiB) Viewed 1044 times

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by AlexYst » Post

I'd love to include that feature, I just don't know how. Trust me, I've been a bit sore about not having this sort of thing available even for my own use. How did you get all those dividing lines set up?

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by texmex » Post

I’m sorry. That’s Minecraft. But for MT I’m thinking that the particle drawing method used in the breadcrumbs mod would suffice. The lines don’t have to be permanent either, a few seconds would suffice. Particles can now glow through the dark too.
Last edited by texmex on Tue May 29, 2018 13:45, edited 1 time in total.

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Pyrollo » Post

Nice aproach !

It could be good to have also an area mod like /protect command to claim vast amount of map blocks at once (giving the two corners map blocks).

This would be great for admins and probably need a privilege to be able to use.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by texmex » Post

This is what I meant:

Image

zing269
Member
Posts: 109
Joined: Sat Apr 30, 2016 19:10

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by zing269 » Post

You can get a similar line effect by using an entity as a texture. I used a stripped down version from TenPlus1's protector redo in my mod to force load mapblocks, viewtopic.php?f=9&t=19840. I do get some visual glitches, like the boundaries disappearing from certain angles.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by texmex » Post

Yes, your (originally tenplus’s) solution looks more solid, though I’d favor a more subtle style.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Stix » Post

I just wanted the block to show the area it protects when punched like Tenplus1's protector redo.
Hey, what can i say? I'm the bad guy.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by texmex » Post

Yes, any visualization is good.

zing269
Member
Posts: 109
Joined: Sat Apr 30, 2016 19:10

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by zing269 » Post

texmex wrote:Yes, your (originally tenplus’s) solution looks more solid, though I’d favor a more subtle style.
So would I but I'm completely incompetent with anything related to graphic design. :)

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] BlockProtectNodes [2018-02-11][blockprotectnodes]

by Stix » Post

zing269 wrote:
texmex wrote:Yes, your (originally tenplus’s) solution looks more solid, though I’d favor a more subtle style.
So would I but I'm completely incompetent with anything related to graphic design. :)
simple, just use 1 square at each facet to show the protected area instead of many.
Hey, what can i say? I'm the bad guy.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests