[INACTIVE][ADMN] DynamicViewDistance v0.0.3 - Control the visible chunks around each player [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Cogito, Aug 15, 2011.

  1. Offline

    Cogito

    DynamicViewDistance - Control the visible chunks around each player:
    Version: v0.0.2

    This plugin allows you to set the view distance on your server. At the moment you can set the view distance for the server, world and player, but this must be done manually and does not persist between server restarts (except for the server view distance).

    Features:
    • Set and reset server view distance
    • Set and reset each world's view distance
    • Set and reset each player's view distance
    Commands:
    To set the view distance, use the 'setview' command.
    /setview 5 - set my view distance to 5.
    /setview server 7 - set the server view distance to 7.
    /setview world 4 - set the current world's view distance to 4.
    /setview world hell 3 - set the "hell" world's view distance to 3.
    /setview player admin 15 - set the "admin" player's view distance to 15.

    The 'resetview' command is similar, except that it does not take the view distance parameter.

    Permission Nodes:
    This plugin has a rich set of permission nodes that it respects. All permissions default to ops, but can be configured to your hearts content.
    The nodes are as follows:

    General:
    viewdistance: allow full control over view distances

    Setting view distance:
    viewdistance.set: allow the setting of all view distances
    viewdistance.set.server: allow setting of the server view distance
    viewdistance.set.world: allow setting of all world view distances
    viewdistance.set.player: description: allow setting of all player view distances
    viewdistance.set.self: description: allow setting of a player's own view distance
    viewdistance.set.player.playername: allow setting of a specific player's view distance

    Resetting view distance:
    Replace 'set' with 'reset' in the set permission nodes to get the reset nodes.

    Downloads:
    Download DynamicViewDistance
    Source Code

    Changelog:
    Version 0.0.3
    • Fixes bug with setting your own view distance
    Version 0.0.2
    • Releasing my awesome plugin
     
    wassilij likes this.
  2. Offline

    SwearWord

    I'm going to pretend this was made specifically for me. Thanks!
     
  3. Offline

    Kane

    *pushes aside*

    Bitch this was made for me!

    Thanks @Cogito =)


    So I should confirm before installing this.

    If I had 100 people and they had 10 view distance and it was set to 5 they all go down a lot of usage lets say for fun 50%.

    now if we leave server at 10 and each user was between 10-1 and it avged out to 5. Would this be sort of the same effect?

    Just trying to get a better picture of this hehe.
     
  4. Download URL has a space in it ;)
     
  5. Offline

    Cogito

    Thanks, fixed

    Kane, the way it works depends on how you use it. Note that at the moment there is no way to persist the view settings of players, it is more of a testing/basic config tool. Let me know what sort of functions you want and I will add them. One thing I do plan on adding soon is view distance changing based on load.

    To your question, the load on the server is not linear with view distance. We can measure load as some order of the number of chunks loaded. For one player, a view distance of 0 means that 1 chunk is loaded. A view distance of 1 means 9 chunks loaded, view distance 2 is 25 chunks loaded.
    If we say that view distance is 'x' and the number of player is 'p', then the load on the server 'L' is in the worst case
    L = p . (2 . x + 1)^2
    In reality, some chunks will overlap so the actual load will be a little smaller.

    If we halve the view distance for everyone, the load L_half = p . (x + 1)^2, that is a little more than one quarter of the original load. If we set the view distance per player the calculation is more difficult. We get the load being at worst
    L = sum(n = 1..p; (2 . x_n + 1)^2)

    Let me do some quick calculations now, based on real view distances with 100 users:
    view distance: 10 => relative load: 44 100 chunks
    view distance: 5 => relative load: 12 100 chunks
    view distance: 1-10, evenly distributed => relative load: 17 700 chunks
     
    Kane likes this.
  6. Offline

    jonassm

    Hi Cogito, i think Nex wanna get in touch with you.
    - Jonassm from GameSketch.
    Cool plugin btw!
     
  7. Offline

    spunkiie

    great piece of software :)
     
  8. Offline

    cholo71796

    @Cogito
    Hey! 1058 isn't a recommended build! Someone tell a moderator!
     
  9. Offline

    Cogito

    lolz - of course this is in the plugin submissions :p - maybe I should move it to WIP, but it is more or less done...
     
    cholo71796 likes this.
  10. Offline

    LRFLEW

    does this not work with 1060? Was there really that much of a difference between the two builds :p?
     
  11. Offline

    Cogito

    I am working on fixes for the issues that Bukkit has with view distance. When they are done, this plugin will be updated to reflect that.
     
  12. Offline

    Kane

    Worst plugin ever. Does not work for 1060 :p
     
  13. Offline

    Wakko

    Well, Cogito is a moderator. :p
     
  14. Offline

    spunkiie

    @Cogito

    REQ: Permissions support
     
  15. Offline

    cholo71796

    Earlier today, passersby observed a joke flying right over @Wakko 's head! :D
     
  16. What's the max view distance then?? Does this send more chunks to the players than the server usually would? :)
     
  17. Offline

    Cogito

    For individual players, there is no max distance defined. For server and world the max is the vanilla 15.
     
  18. Offline

    Jadedwolf

    So you say the changes are not persistent, but does this apply to every command or does per world view distance persist? I know the default view distance persists, but I'm talking per world.
    would be great to say have a higher view distance in main world and a really low one for say the nether, I mean cause lets be honest, is there really a need for huge view distance there. XD
     
  19. Offline

    Cogito

    At the moment, there is no per-world persistence. This is definitely something I will add along with per-player, feel free to add a feature request over on github in order to track it.

    I also welcome any contributions that people have, so feel free to fork and open pull requests.
     
  20. Offline

    sagethor

    @Cogito
    I'm confused as to what setting the view-distance to three in my server properties does, if this plugin exists. If this somehow does help me load less chunks and use less RAM than when using it at view-distance three alone, this will be very handy. :)
     
  21. Offline

    Cogito

    This plugin is simply (at the moment) for allowing you to set the view distance while the server is running. The normal behaviour of setting the view distance in your server properties still works.

    In later versions of this plugin I hope to make per-world and per-player configurations easy to do in some file or something, and to be able to save them in game.
     
  22. Offline

    wassilij

    Bukkit 1060
    Spout 1.0.2
    Your Plugin v0.0.3

    Code:
    2011-08-17 14:50:12 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'setview' in plugin DynamicViewDistance v0.0.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:352)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:737)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:701)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:694)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:435)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.setViewDistance(I)V
        at net.gamesketch.viewdistance.commands.SetViewCommand.setServerViewDistance(SetViewCommand.java:106)
        at net.gamesketch.viewdistance.commands.SetViewCommand.setServerViewDistance(SetViewCommand.java:95)
        at net.gamesketch.viewdistance.commands.SetViewCommand.onCommand(SetViewCommand.java:28)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 13 more
     
  23. If possible, it would be awesome if you could code it to allow an increased server view distance, to maybe 20 or 25 chunks or something :D I've set it to max so the plugin won't do much at the moment lol
     
  24. Offline

    Cogito

    The issue, as you can see, is that the methods that this plugin relies on aren't in the current release of CraftBukkit/Bukkit. They were removed as some of it wasn't working, and is being fixed.

    At the moment Bukkit maintains the vanilla behaviour of not allowing less than 3 or greater than 15 for server wide and per-world settings. This may change in the future, but we want to know the impact that might occur.

    For now, you can set each player's view distance individually, to anything greater than or equal to 1.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  25. Offline

    Mercury

    @Cogito - Is it possible to make real dynamic settings like which calculates on player moving and position. While in cave we can set this option automatically "view-distance" to lowest for player. While player is running outside this can be ranged between 10 - 15. and while being outside + building + being on same chunk we can range it between 7 - 10.

    Possible?
     
  26. Awesome plugin!
    Would it be possible to set a default distance depending on which permissions group the player is in?

    For example:
    Normal users have a view distance of 6 as they do not need to fly and admins have a view distance of 15+ to allow them to fly without them to wait for as many chunks to load.

    Thanks
     
  27. Offline

    Cogito

    This is possible, we would need to work out what sort of situations would trigger a view distance change. Potentially, this plugin could provide a range of utilities that either the server admin or other plugins could use to manage view distance. So there could be things like 'buff view distance' that adds view distance up to a limit for a certain amount of time. More likely I will take the most useful suggestions and incorporate them together - the longer a player stands still the larger their view distance gets for example.

    Features like this should be added to the issue tracker on github.

    I am not sure of the best way to handle this at the moment. I don't really want to handle groups myself, as there is a lot of things people require from a group system. That being said I could implement very simple groups of players, and allow these groups to have specific view distances set, however that is a poor option.
    Preferably, some other plugin (or perhaps bukkit in the future) will support looking up properties for players. It would be the job of that property manager to inform this plugin how far a player can see, and could use factors such as which group they are in to decide that. This is a much more robust system, and I will investigate the options as time goes on.
     
  28. Offline

    Draaven

    Anyone tried the permissions on this to give other players permission to use the self change ability. I've tried putting in viewdistance.set.self and the players still get the message that they don't have permission to use that command.

    Nevermind, found what was wrong. In plugin.yml in the .jar file, there's a default setting for set.self and reset.self that were both set to false. I changed them to true and all is working now:

    viewdistance.set.self:
    description: allow setting of a player's own view distance
    default: true

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  29. Offline

    Tanite

    Does this translate to server performance if you lower everyone? Any idea how much (ballpark)?
     
  30. Offline

    Draaven

    I was having issues with external players constantly getting disconnected due to the amount of chunk data being sent to them, after putting this plugin on they're not longer getting disconnected since they're getting less data with the lower setting I put on them. Hopefully the author will make the settings per player persistant, instead of them having to change the setting themselves every time they login. I've certainly noticed better server performance since installing this.
     

Share This Page