Page 1 of 2

[Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Fri Jan 03, 2014 02:26
by Sokomine
There are lots of protection mods out there which all take a diffrent approach and have their pros and cons. To me, ShadowNinjas areas mod, which is based on node ownership, is the most flexible and useful.

It has one drawback: The chat commands and the interface as such are not very intuitive.

That's where this mod comes in: It tries to make it far easier by taking into account what I've seen players do when they want to show a moderator which area they want.

In order to see how it works, let's start with crafting the actual markers:
Image
Craft them and place one at each of the four corners of your area. When you place a marker, it will show you how far it is away from the marker you placed before that - useful for measuring distances.

Do not worry about height.

If anything goes wrong, dig the marker and place it again at the same location.

When done, right-click on the last marker you placed. It will show you a menu:
Image

Please enter three values: "This many blocks up: " - this is how far you want your area to stretch into the sky (relative to the marker you clicked on!). Same goes for "and this many blocks down:" - there you can enter a number that's heigh enough to stretch down to the floor of your cellar. "The area shall be named:" - that ought to be obvious. Try to pick a name that describes what you built or intend to build there - perhaps with your player name included.
Image
The above picture shows the filled out formspec. In this case it's a very small area that reaches only 2 blocks into the ground and 6 into the sky - it's a very small tent. You can click on "Buy area" now. Don't worry about the price! Areas do not cost anything (yet).
Image
Finished. The area has been protected for you. You can now dig up the markers and use them for your next area - or let them remain where they are - just do as you like.

But that's not all: You may have forgotten how large your area is, or you want to find out where one is located, who else owns it, add a second owner etc...all of that can be done with chat commands. But there's also a gui for that now. Craft a marker stone:
Image
Place that marker stone somewhere in your protected area and right-click on it. It shows you a menu:
Image
Change owner allows you to give your area to another player who will then own it.
Rename allows to rename the area (change its description).
My areas will give you a list of all areas you own or are subowner of.
Player's areas does the same as My areas - except for the player shown instead of yourshelf.
Add allows you to grant build access to the area to another player. The player will get a subarea of the same size as yours and can dig/build inside it.
Local areas lists all areas that contain the position the marker stone is located at. Since each player that can build there has its own area, there can be more than one. There can also be smaller sub-areas for other purposes (i.e. pieces of land that are part of a town).
Show main area allows you to switch the display to the main area for this region if you're currently displaying a subaera.
List subareas lists the subareas a main area contains.
The commands listed under Admin commands: offer the same functionality as those mentioned above - except that they're shown for all admins/moderators with the areas priv - even if they don't own that particular area.

Image
This is how the area info display looks for areas that are owned by other players.

The compass picture at the bottom shows where you can find the area. In this case, it's 1667 m west and 179 m south of the markers position. If the marker is located inside the areas boundaries, you'll see the top of the marker instead of the compass, and the numbers given will show you how far it is from the marker's location to the borders of the area.

This is a sample area list that shows my areas on VanessaE's survival server:
Image
You can click on each entry and will get a preview of where the area is:
Image
Double-click on an entry to get the area info display known from above.

If the player who owns an area was not considerate enough to place a marker stone, you can get the same functionality with a land title register. It's a tool that you can craft like this:
Image
Wield it and left or right click on a position you want to check. The same menu will open that would open would there have been a marker stone.
Image
Even on old servers, there's plenty of unprotected, unowned land. Clicking on "List all areas" will show you a list of all main areas the server knows about.

Download: https://github.com/Sokomine/markers/archive/master.zip
Browse code: https://github.com/Sokomine/markers
Version: 0.2
Licence: GPLv3
License for pictures: WTFPL (thanks to VanessaE for creating them! And look at the marker stone in HDX.)
Depends on: areas

What needs to be done in the future?
Apart from general feedback and tests with random players, what needs to be added is a way to "pay" for an area. A very simple function for calculating a price is already included. You can edit that function and let it display almost any text. Writing a function that actually charges the requested price is still missing. Mostly that's because it depends a lot on the server itshelf - they all have their own, diffrent monetary system. Giving areas away for free might not be such a good idea as players might spam with it and protect more than what they can use. By default, the size of areas is limited to 1024 m^2 and a height of 100 m. You can change those config values at the start of the init.lua file.

A second semi-graphical display like the compass/marker stone ought to be added that shows how large the area is in each dimension. That might be easier to take in than the text in the area's description. Also information about how high the area is is not displayed yet.

Currently, creating a new area inside your own area creates a new main area instead of a subarea of your area. That's not a big problem in general but could be annoying if areas are charged for (who wants to pay twice?).

Hope this is helpful. Please test it with your players. Ultimately, I hope that Redcrab comes back and installs it on his server (you're allowed to hope, aren't you..?)

PostPosted: Fri Jan 03, 2014 04:45
by LuxAtheris
OMG Awesome mod here dude!

PostPosted: Fri Jan 03, 2014 09:57
by webdesigner97
This looks very cool and it is very useful!

PostPosted: Fri Jan 03, 2014 10:26
by Krock
+1

This makes it alot easier to work with the protection mod.
Alot tools are included too, like a GUI for all areas by that player.
I like it!

PostPosted: Fri Jan 03, 2014 15:20
by Inocudom
Sokomine, you are one of the most outstanding members in this community.

PostPosted: Tue Jan 14, 2014 03:15
by Sokomine
What's still missing is some useful way to handle how much a player can protect. I do limit the size of the area to 1024 m^2, but that won't stop players from protecting lots of areas without any chance of them ever going to build anything there. Another limitation comes from the basic areas mod which limits self-protection to 3 areas (configurable).

I plan to add a price of x cobble per m^2 (height does not count). Areas less than 100 m from spawn will be more "expensive", while areas further out will be cheaper. The idea is that cobble is not a very good material for building while beeing available in large quantities on (almost) any server. The money mods used are just too diffrent. The amount of cobble the inventory can contain will limit the size of the areas indirectly.

Of course this won't work at all on creative servers. For those, limiting the amount of areas a player can have might be best.

Regular players who have proven that they know how to handle self-protection and apply it in a useful way might be omitted from paying the cobble price and the amount of areas limitation.

What do you think of these suggestions? Server owners: What would you prefer?

PostPosted: Wed Jan 15, 2014 20:14
by Josh
Look's cool, much easier way of protecting areas.

PostPosted: Thu Jan 16, 2014 05:32
by gsmanners
This is very nice, though I should admit that I bumped up the min to 4096 (64x64). Seems a bit more reasonable.

I like the idea of giving players credits, and my own idea on the matter is basically that it should measure how much active time you've spent. I think 40 credits per hour is pretty reasonable, all things considered.

PostPosted: Sat Feb 01, 2014 14:46
by CraigyDavi
What a great mod! This makes the areas mod much easier to use.

I am using this on my server at the moment. And it is great not to be bothered by anyone anymore thanks to the simplicity of this.

Very nice!

Re: [Mod] markers - gui for areas mod

PostPosted: Thu Apr 24, 2014 17:02
by CWz
Got this error which crashed my server
19:53:09: ERROR[main]: ERROR: An unhandled exception occurred: /home/chaoswormz/.minetest/mods/markers/init.lua:339: attempt to index a nil value
19:53:09: ERROR[main]: stack traceback:
19:53:09: ERROR[main]: /home/chaoswormz/.minetest/mods/markers/init.lua:339: in function 'get_marker_formspec'
19:53:09: ERROR[main]: /home/chaoswormz/.minetest/mods/markers/init.lua:600: in function 'on_rightclick'
19:53:09: ERROR[main]: /usr/share/minetest/builtin/item.lua:326: in function </usr/share/minetest/builtin/item.lua:319>

In thread b6c61700:
/build/buildd/minetest-201404200513/src/main.cpp:1889: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b4bffb40:
#0 virtual void* CurlFetchThread::Thread()
DEBUG STACK FOR THREAD b6c61700:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void Database_SQLite3::saveBlock(MapBlock*))
(Leftover data: #4 void ItemStack::serialize(std::ostream&) const)

Re: [Mod] markers - gui for areas mod

PostPosted: Fri May 23, 2014 04:50
by Nubelite
I couldn't get it to work for me, but might be me.

I tried my hand at trying to modify this to what i am looking for exactly. I would like to set one stone to protect a predefined area without a time limit.

I don't see how i can modify markers.marker_placed to use only one stone with a preset -dist +dist for the pos.

Re: [Mod] markers - gui for areas mod

PostPosted: Fri May 23, 2014 07:13
by twoelk
Nubelite wrote:I couldn't get it to work for me, but might be me.

I tried my hand at trying to modify this to what i am looking for exactly. I would like to set one stone to protect a predefined area without a time limit.

I don't see how i can modify markers.marker_placed to use only one stone with a preset -dist +dist for the pos.


Aren't you rather looking for something like the Landrush-mod ?

Re: [Mod] markers - gui for areas mod

PostPosted: Fri May 23, 2014 14:10
by Krock
twoelk wrote:
Nubelite wrote:I would like to set one stone to protect a predefined area without a time limit.


Aren't you rather looking for something like the Landrush-mod ?


How about simple_protection? There, you can define the area sizes easily.

EDIT: bump = edit

Re: [Mod] markers - gui for areas mod

PostPosted: Thu Jun 19, 2014 03:20
by Vazon
I have been thinking about this mod a lot on my server and I think a two add on would be nice.

1- Once the area has been claimed the markers remove themselves, otherwise once you make a set you almost never have to make another and make the crafting a little bit harder.

2- Add merge claims, when a player has 2 claims next to one another, they can merge them into 1 by putting markers on the corners of the. example:
x = claim 1, o = claim 2, m = markers

m x x x x o o o o m
x x x x x o o o o o
m x x x x o o o o m

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Fri Sep 12, 2014 17:12
by Sokomine
Added the missing pictures for now.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Wed Sep 24, 2014 07:27
by jp
Some thoughts on this mod :

1. It sometimes a pain to align correctly the 4 markers as a perfect rectangle. To solve that, there is an easier way : 2 markers placed as the diagonal of a rectangle (like the WorldEdit & Areas positions).

2. The recipe for the markers are cheap. Too cheap. Every newcomer, usual short-term player have the effortless possibility to appropriate land(s) (with their highly-scattered crappy cobbles & planks homes) without considering the (future) expectations of the serious builders. It curbs the good evolution of the map. So, a more costly recipe can bring a more deserving use of these markers.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Wed Sep 24, 2014 11:50
by Minetestforfun
@jp
I agree => +1

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Nov 04, 2014 09:14
by Fritigern
Markers appears to have crashed my server. This is not the first time, but it's the first time that i have remembered to copy the error so i can paste it here:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
01:00:27: ACTION[ServerThread]: <USERNAME_WITHELD> places node markers:mark at (408,1,-254)
01:00:27: ACTION[ServerThread]: facedir: 3
01:00:30: ACTION[main]: IRC: Disconnected.
01:00:31: ERROR[main]: WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.ERROR: An unhandled exception occurred: ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:340: attempt to index field '?' (a nil value)
01:00:31: ERROR[main]: stack traceback:
01:00:31: ERROR[main]:    ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:340: in function 'get_marker_formspec'
01:00:31: ERROR[main]:    ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:601: in function 'on_rightclick'
01:00:31: ERROR[main]:    /home/balaam/Minetest/bin/../builtin/game/item.lua:326: in function </home/balaam/Minetest/bin/../builtin/game/item.lua:319>
01:00:31: ERROR[main]:    (tail call): ?


Using the currently latest Minetest git version (0.4.10-174-g96fcca4-dirty)
I hope this helps making this mod even better.

EDIT: The cause was that four markers were placed in a straight line. Right-clicking the last marker then causes the above issue with a forced shutdown of the server as a result.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Jan 27, 2015 13:49
by afflatus
It would be just so great to have a button for your own areas in the dialog's first screen.
I'm constantly switching between screens to get to the listing I want, which is tiresome during times of high lag.

This mod is really great for players, but as admin I'm increasingly using the areas command-line. That's not a criticism as I guess that was your intention.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Jan 27, 2015 13:54
by afflatus
I disagree with jp.

There is nothing to stop an admin either re-assigning abandoned areas, asking players to rebuild in a suitable style or setting area_open to allow bulldozing. It is _so_ much better than dealing with complaints from griefed players.

Please keep it cheap and simple.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Jan 27, 2015 13:55
by afflatus
I found the settings rather gnomic and hard to understand. They are done in a way that doesn't look like they are supposed to be edited. Did I miss something?

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Jan 27, 2015 20:12
by cHyper
afflatus wrote:I found the settings rather gnomic and hard to understand. They are done in a way that doesn't look like they are supposed to be edited. Did I miss something?


its just a simple way to mark your building area,
after 60*60*24 time the protection is over.

+1 for the mod ...

important note:
when u want to delete an element you've to set YES into the input-field...
how can i move the area-sticks to another position?
must i redo the same process to mark the positions?

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Sun Mar 08, 2015 21:31
by 12Me21
If you place all 4 markers above each other (to try to protect a 1x1 area) it will crash the game...

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Mar 10, 2015 23:34
by afflatus
Or even if you just place one on top of the other.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Sun Mar 22, 2015 04:35
by Sokomine
12Me21 wrote:If you place all 4 markers above each other (to try to protect a 1x1 area) it will crash the game...

That bug is fixed in the current version. I ought to have announced it here...

afflatus wrote:Or even if you just place one on top of the other.

That is also fixed. Thank you for reporting it!

@All: Please update your version of markers!

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Tue Mar 24, 2015 04:31
by Kilarin
I would humbly like to offer a pull request to the markers mod.

https://github.com/Sokomine/markers/pull/7

I think you have an excellent point Sokomine that some users have a difficult time marking an area by picking out opposite corners. And I believe that your markers mod is a very clever way of addressing that issue.

But when I was experimenting with it, I realized that I was having a difficult time getting my markers into a perfect rectangle, and all at the same level. And when I was thinking about it, I realized that with a small change, markers might be even MORE intuitive to use.

What this change does is alter markers so that the user doesn't have to worry about trying to get a rectangle at all. They just plop down markers, as many as they wish, at all of the extremes of their build. They can even build a "fence" of markers around the build if they wish. They can also place markers at the lowest and highest points of the build they wish to protect.

Then, when the user right clicks on ANY of these markers, the code just runs through a quick loop and calculates the opposite corners of a 3d box that contains all of those markers. And THAT becomes the basis of the area to be protected.

For example, here I've built a really simple (and not very pretty) house:
Image

But oh! How shall I mark it for protection? it's not square, and it's not all on the same level and basic geometry confuses me!

Never fear, I just plop down markers all around the house, being certain to hit all of the extremities and have at least one marker at the lowest point and one marker at the highest point:
Image

Now I right click on ANY of those markers and:
Image
The calculated points, (179,26,-2) and (191,34,9) are the minimum and maximum corners of a cube that contains every single marker placed. There aren't even markers at those positions, but the program calculated them for me. I still have the option to extend the protected zone up and down from marked positions, but now the "above" number is for extending above 34 (the y value of the highest placed marker) and the "below" value is for extending below 26 (the y value of the lowest placed marker)

I feel that this takes your already great idea for markers, and makes it even easier and more intuitive to use.

Take a look at it and see what you think Sokomine.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Mon Mar 30, 2015 16:31
by afflatus
Kilarin I really like your idea. My younger players have trouble placing markers in a rectangle in the right order. Older players tend to find the chat commands easier. This would balance things out a bit.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Wed Apr 01, 2015 23:16
by Minetestforfun
The Kilarin work is awesome, i hope it will be merged soon !

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Mon Apr 06, 2015 03:52
by Sokomine
Thanks to Kilarin, this pull request (and another one about sorting areas by those nearest first) have been merged. Having more flexibility with placing the markers is certainly a good idea.

Re: [Mod] markers - gui for areas mod [0.2][markers]

PostPosted: Mon Apr 06, 2015 04:43
by Kilarin
Thank you kindly Sokomine, but just a small change to a GREAT mod! :)