[Mod] Protector Redo [3.4] [protector]

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [Mod] Protector Redo [1.3] [protector]

by Ferk » Post

Don't you already check for protectors around the area? I just checked the code and it looks like it does.

The expensive call is already done. And you are even already iterating over the result. The only thing this would add is maybe having to do 1 or 2 more iterations (I don't expect more than 3 protectors in the same area which means only 1 or 2 more get_meta(), the only expensive call in the loop). And this is in the worst case scenario, most of the time you could even return already as soon as you find a node with no priority assigned (and assume no priority is highest priority) and when placing it, if there were no conflicting areas not owned by you (which you are checking for already as well) you don't have to save any priority/timestamp since a protector placed without conflicts would always be highest priority.

The thing is that there are cases where "placing it properly in the first place" is not possible. See this case

Code: Select all

.P....
......
..x.R.
......
.P....
R is your protector, P is other people (with one dot in each direction of radius in a square), the x is what you want to protect. Trying to protect it will always get you in conflict with the other protectors, who are maybe by people that don't want to give you permissions to access their house area, even if they would be ok with you expanding one dot to the side as long as you don't disturb their areas.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.3] [protector]

by TenPlus1 » Post

Adding this would cause players to become lazy and develop no planning skills as a result... I would gladly add the new checks if I felt they were needed, but in my opinion it overcomplicates a mod that works well on a standalone and sever environment without causing much lag or jittery movement.

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [1.3] [protector]

by firefox » Post

so a simple solution to this would be to add mini protectors with a small radius to fill those gaps between areas.
✨🏳️‍🌈♣️✨

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.3] [protector]

by TenPlus1 » Post

Then I would have to rewrite the mod to check for different sizes of protector which could slow things down. It's still a better idea to plan things out beforehand.

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [Mod] Protector Redo [1.3] [protector]

by Ferk » Post

You only need to check once using the bigger size radius like you already do now, when a protector is found just see if it's a small radius type (could be determined by metadata) and ignore it if it's too far. Doesn't add anything expensive to compute (the find_nodes_in_area and get_metadata has to be done anyway), other than some math you can do with vector.distance which only needs to run when there's an actual small protector and that I'd guess is already faster than the get_meta (it's just arithmetic, no database query or I/O needed for that).

But I think adding a smaller version is not really a solution to the problem, would be best the prioritization (which I believe it's not much difference in speed as well). However, it's entirely your call, it's your mod and it's fine if you decide you want to leave it like it is.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.4] [protector]

by TenPlus1 » Post

Updated to version 1.4:
  • Changed protector recipe's to give 1 instead of 4
  • Added [+] button to interface when adding names
  • Added /delprot command for server admin to remove protectors in bulk
  • Tweaked and tidied code

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Protector Redo [1.4] [protector]

by Fixer » Post

Changed protector recipe's to give 1 instead of 4
reason?

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [1.4] [protector]

by firefox » Post

maybe because some players spam their protectors all over the landscape, taking the rare crystal biomes all for themselves and then never log in again ....
✨🏳️‍🌈♣️✨

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.4] [protector]

by TenPlus1 » Post

Exactly that firefox, on Xanadu I'm fed up removing landscapes full of protectors and making the recipe a little more expensive should help in the long run.

Note: Players who have been banned or not on server for over 4 months will soon have protectors removed so that other players can build.

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Protector Redo [1.4] [protector]

by Minetestforfun » Post

TenPlus1 wrote:Note: Players who have been banned or not on server for over 4 months will soon have protectors removed so that other players can build.
Happy to see you speaking about this improvement, it will be possible to tweak this "counter" in the "minetest.conf" ?

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.5] [protector]

by TenPlus1 » Post

Updated to version 1.5:

- Added protected trapdoor (craft trapdoor + copper ingot)

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Protector Redo [1.5] [protector]

by amadin » Post

Can anybody write settings for minetest.conf that increase the speed of protected block return to the place if not owner dig it?

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Protector Redo [1.5] [protector]

by amadin » Post

Do you can add support for chicken and bunny to protector? Because other players can kill my animals even in protected fence wood cage.

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [1.5] [protector]

by firefox » Post

amadin wrote:Do you can add support for chicken and bunny to protector? Because other players can kill my animals even in protected fence wood cage.
maybe tamed animals should have the same PvP protection that players get in protected areas, so that only the owner can kill them.

for Xanadu i recommend you to use invisible glass slabs. (the slabs are harder than the full blocks and can't be broken by hand.)
✨🏳️‍🌈♣️✨

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.6] [protector]

by TenPlus1 » Post

Updated to version 1.6:

- Added protector_drop and protector_hurt settings to minetest.conf

...these settings were added to stop players using lag to grief through protected areas and inside buildings by dropping their tools and hurting them.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Protector Redo [1.6] [protector]

by Fixer » Post

Added protector_drop and protector_hurt settings to minetest.conf
Excellent :} This is excellent feature, thank you very much. Must have.

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [1.6] [protector]

by firefox » Post

that killed 1 of my ninja skills, but on the other hand: it is now impossible to sneak into the Inner Sanctum without finding the hidden entrance, yay!
✨🏳️‍🌈♣️✨

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Protector Redo [1.6] [protector]

by everamzah » Post

I haven't tried this yet, but what do you do when a player has a lot of armor and HP, as well as multiple tools? When one drops, they could switch to any other.

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [1.6] [protector]

by firefox » Post

everamzah wrote:I haven't tried this yet, but what do you do when a player has a lot of armor and HP, as well as multiple tools? When one drops, they could switch to any other.
usually you can't switch tools fast enough before the digged blocks are replaced.
✨🏳️‍🌈♣️✨

User avatar
TenPlus1
Member
Posts: 3721
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector Redo [1.6] [protector]

by TenPlus1 » Post

..and if you switch tools while one is dropping you may lose the 2nd tool completely :) muhahahah

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Protector Redo [1.6] [protector]

by Fixer » Post

firefox wrote:
everamzah wrote:I haven't tried this yet, but what do you do when a player has a lot of armor and HP, as well as multiple tools? When one drops, they could switch to any other.
usually you can't switch tools fast enough before the digged blocks are replaced.
This requires very good skill, weak blocks and computer :}. Also, if by some megaluck intruder gets inside, his tools will be on outside, there will be probably owner, not far from here, with some swords to kill him and gather his tools :}
Also, if all goes well, there will be owned steel trapdoor in MTG, yes, that will protect some known weak spots *cough* and you will have complete safety :}

I will try to break into some Xanadu houses just for test (the noob way :}).

Dragonop
Member
Posts: 1233
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: [Mod] Protector Redo [1.6] [protector]

by Dragonop » Post

I will try as well, but I will ask the owner for permission first hehe

Edit: it's possible, if you have some skill and fast fingers you are able to, but most of the times you will leave your tools behind, so finding a weak spot, and using steel/bronze tier tools is what trespassers might do (if smart enough).
Roofs are still really weak tho :p
You could use a tool to break the roof, you drop inside, and then you use another tool to get your fist tool back (clicking, because it won't fall).

Edit2: sorry TenPlus1 for posting this here, but it might help you improve the method, I hope.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Protector Redo [1.6] [protector]

by amadin » Post

You posted new advice to griefers here, you must wrote this to private message only. I hope you will remove your last message.

Dragonop
Member
Posts: 1233
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: [Mod] Protector Redo [1.6] [protector]

by Dragonop » Post

-nvm, no explications needed-

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Protector Redo [1.6] [protector]

by Fixer » Post

Steel trapdoor will fix weak spots :}

Post Reply

Who is online

Users browsing this forum: Kazooo and 26 guests