minetest-mapserver / mapserver

Minetest realtime mapserver, written in go
Other
100 stars 22 forks source link

Make it easier to view "areas" (from area protection mod) #178

Open dennisjenkins75 opened 3 years ago

dennisjenkins75 commented 3 years ago

The mapserver shows "prot-blocks" when zoomed way in. This is nice. Would be really nice if one could also see an overlay of the "areas" as well. This would make it easier to see unclaimed territory (for yourself, or for helping a new player find a "good spot" for their own use).

The areas are currently exposed via a json API and can be scraped out-of-game:

$ wget -q https://pandorabox.io/api/areas -O - | jq -c '.[] | select(.owner == "1hit")'

I have multiple ideas, and they are not necessarily mutually exclusive:

  1. Enhance the map server to allow viewing of areas. Granted that the map server shows a 2d slice, and areas are 3d and can be quite tall (up to 128, or 512, depending on player's priv)
  2. Create an offline tool (python or lua script) that one can run manually that would grab their areas and convert them into a SVG. However, doing this won't make it super easy to correlate the resulting 3d image with the map server.

(Moved form https://github.com/pandorabox-io/in-game/issues/53)

ronoaldo commented 3 years ago

I support this idea :) perhaps as an overlay? I'll try to get a stub on that and submit a PR; suggestions on where to start are welcome!

BuckarooBanzay commented 3 years ago

I support this idea :) perhaps as an overlay? I'll try to get a stub on that and submit a PR; suggestions on where to start are welcome!

There is currently an api endpoint at /api/areas that would expose all areas (https://github.com/minetest-mapserver/mapserver/blob/master/web/areas.go) ... but: the recent change from lua-based to json-based area-store essentially bricked that :P

Feel free to try to whip up a PR if you want. Also: i'm planning a frontend-rewrite but that should not bother anyone, i think i can copy most of the map-code over...