Filled DYNAMIC MAPS

Discussion in 'Archived: Plugin Requests' started by toxictroop, May 7, 2013.

  1. Offline

    toxictroop

    DYNAMIC GENERATED MAPS
    [​IMG]
    _________________________________________

    PLUGIN MAIN IDEA: The plugin should make the centre of the map lock on to the player so where the player go's the map would follow generating the world, this could be a potentially good popular plugin to make!
    PLUGIN REQUESTS: I would love the maker of this plugin to note/show the idea was thought by me toxictroop and by the team at: http://www.crossfiregaming.net/
    The request above would be very appreciated!! thanks and have fun developing this plugin!


    PS. I DONT WANT TO HEAR DYNMAP IN THIS THREAD!! THE PLUGIN NEEDS TO WORK FOR THE VANILLA MAP AS A MINIMAP FOR THE PLAYER.
     

    Attached Files:

    Steffion likes this.
  2. Offline

    DarkRiddles

    I'm sorry, but what are you trying to say?
     
  3. Offline

    timtower Administrator Administrator Moderator

  4. Offline

    HumaneWolf

    He want a vanilla map item that works like a minimap, showing the area around the player. Also following the player, so the player is always in the middle of the map.
     
    toxictroop likes this.
  5. Offline

    timtower Administrator Administrator Moderator

    Dynmap is doing the same except that it is web based
     
  6. Offline

    toxictroop

    Yes! Thanks for going more in-depth
     
  7. Offline

    Syd

    @toxictroop

    I'm currently working on it.
    However, there a some serious problems:
    1. the map does not render very fast (~5-6 seconds to update the map after moving a bit)
    2. it costs a lot of server performance
    The max. resolution I was able to use without crashing the server was 512x512, but only for 1 player with an update every second. (Default update time is 20 times per second - every tick)
    But the current code is more like proof of concept than final code. I'll look into optimizing it tomorrow.
     
    toxictroop likes this.
  8. Offline

    toxictroop


    ok ^_^ cheers seems like you know what your doing very well.
     
  9. Offline

    Syd

    @toxictroop

    http://www.craftlancer.de/Plugins/ServerMinimap.jar

    A small Beta/Proof of concept version.

    Map #0 is the minimap and for every user specific.
    You can configure the scale from 0 to 4. The size of the map is 128*scaleĀ².
    The 2nd value is linesPerRun, which defines how many of the 128 lines are rendered every tick. (1 tick = 1/20 second)
    More linesPerRun makes the rendering faster, but need more performance.

    Last but not least you need to map a color to every block under the 'color' config key.
    Colors are values between 0 and 55.
    This part may will take a while...

    I hope it is what you expected.^^

    If you have any suggestions for new features (e.g. more marker) feel free to post them...
     
  10. Offline

    toxictroop

    Syd thank you very much for your work into this plugin, very appreciated i will take a look now.
     
  11. Offline

    toxictroop

    It seems the plugin does not want to work on my bukkit server. :3
     
  12. Offline

    Syd

    Is there any error message or other output I can work with?

    Edit: nvm, found the error. Will reupload a fixed version. -> http://www.craftlancer.de/Plugins/ServerMinimap.jar
     
  13. Offline

    toxictroop

    Thanks ^_^ testing now.

    Ok i have tested, but the map does not seem to follow the player?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  14. Offline

    Syd

    Are you using the map with Id 0?
    It should follow the player, while not showing much details with the default config.
     
  15. Offline

    toxictroop

    Map #0 wont move.. im using a spigot build, is that why maybe?
     
  16. Offline

    Syd

    Is there any error message in log?

    I just uploaded a new version (link is the same), which fixes one error...
     
  17. Offline

    toxictroop

    Where can i find the colour values?
     
  18. Offline

    Syd

    This is what Bukkit says.
     
  19. Offline

    toxictroop

    thanks ^_^

    Is there anyway i can make the whole map refresh every tick?

    Oh ^_^ could you add players to the maps if thats possible, just like when multiple players have maps they show up on the map, but what im wanting is them to show on map even if they dont have a map :3?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  20. Offline

    Syd

    Set the config value "linespertick" to 128, and it will reload the map every second. (However, it'll still take about 6 seconds to have a clear map)
    But I don't recommend to do so, as it'll also increase your server load dramaticly

    So basicly player radar. It's on my TODO list. :)
     
    toxictroop likes this.
  21. Offline

    toxictroop

    Also another thing, the player direction is screwed up, i go-towards water on the map, and the map indicated im moving away instead of towards. hope you can sort this ^_^

    I cant get water on-map to work its always transparent WATER: 20

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  22. Offline

    Syd

    Try STATIONARY_WATER, as MC uses 2 different Blocks for water.

    When I add player markers, I'll try to fix the orientation of the markers, too.

    toxictroop

    I just uploaded a new version.
    Other player in range will be shown on the map (Can be deactivaed by adding/setting "canSeeOthers: false" to config)
    and the orientation of the markers should work now.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  23. Offline

    toxictroop

    Ok Cheers! great work!!!

    Oh cheers for the colours and blocks you added ^_^

    The water still seems to be transparent for some odd reason.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  24. Offline

    Syd

    Just tried it and got a clear blue line at a village farm.
     
  25. Offline

    Hoolean

    Can I see your code and see if there are any input on optimisation I could make?
     
  26. Offline

    Syd

    Go ahead, the source is included in the .jar
    There should be plenty of room for optimisation, as the current version is more like proof of concept.
     
  27. Offline

    Hoolean

    Thank you ^_^
     
  28. Offline

    Syd

    I've made progress on a more useable version of the plugin.

    The first big change is, that the map is now cached in a chuck system, compareable to the one in minecraft.

    This decreases the CPU usage dramatically (while increasing RAM usage), as a map pixel is only calculated once when it's needed and every time it gets an update. (Like someone placed a block)
    The needed updates are collected in a queue and will be executed every x ticks (configuable), but only a configurable amount of 16x16 pixel chucks per run.

    The second expansion is an update on the sending mechanism, as Bukkit already has a Player#sendMap() method.
    So I added a method to send the minimap every x (configurable) ticks to every player with the permission "minimap.fastupdate".
    It provides almost instand map updates.
    However, this feature is pretty bandwidth hungry. Every time you send a complete Map it needs to send ~128*128 bytes, what makes a total of about 16KiB. When you send the map every 20 ticks (1 second) you'll have a additional bandwith usage of 16KiB/s per Player.

    The config has also changed a bit.
    "linesPerRun" is now "chucksPerRun" and defines the amount of 16*16*scaleĀ² chucks, that will be rendered every run.
    "runPerTicks" defines every x ticks the queued updates are calculated.
    "fastTicks" defines every x ticks the full map is sent to every player with the "minimap.fastupdate" permission.

    DL Link, as always: http://www.craftlancer.de/Plugins/ServerMinimap.jar
     
  29. Offline

    toxictroop

    thanks so much!

    16:23:42 [WARNING] [ServerMinimap] Task #22 for ServerMinimap v0.3 generated an exception
    java.lang.NullPointerException
    at org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer.sendMap(CraftPlayer.java:338)
    at de.craftlancer.serverminimap.SendTask.run(SendTask.java:14)
    at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftTask.run(CraftTask.java:58)
    at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:344)
    at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:509)
    at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227)
    at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472)
    at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404)
    at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)

    error?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  30. Offline

    Syd

    @toxictroop

    Can you reproduce the error? If yes: how?
    Also, is there any plugin that uses maps and might interfere with my plugin?
     

Share This Page