Spigot View Distance Tweaks [1.14-1.17] 1.3.4

Dynamic per-world view distances, giving a better balance of gameplay and performance.

  1. We just updated to 1.17.1 from 1.16.5 and we're using a the latest version of View Distance. We're also running Tuinity. I am finding that View Distance commands (/vdt) don't work anymore and View Distance seems to have stopped working altogether. It's popping up with an internal error occurred... Is 1.17.1 supported? If so, any ideas what we might have messed up? We moved from Paper to Tuinity during our upgrade to 1.17.1.
     
  2. Hey, is the plugin disabled (showing up as red in /plugins)? You might not have it enabled in the config.yml, or it's encountering an exception at start-up. If you do see an exception during start-up could you share it here by pasting it on https://paste.gg/ ?
     
  3. Thank you for getting back to us! I believe we have it enabled in the config. Here's our config. I am also attaching a screenshot. VDT was working just fine prior to upgrading from 1.16.5 to 1.17.1 (we skipped 1.17) so I thought it just needed to be updated for 1.17.
     

    Attached Files:

    • vdt.png
      vdt.png
      File size:
      271.4 KB
      Views:
      9
  4. I tested with your config and it seems to be working fine for me, so I'm not sure what's going on there. Are you sure you're using the latest version? Versions 1.3.2 and below will definitely not work on 1.17+ - you can check the version with '/ver ViewDistanceTweaks'.

    Other than that, you should be getting an error in the console when you try to run the command - could you share that error here?
     
  5. Hi. I started using this plugin 15 days ago. It's been working fantastic and has almost completely removed TPS drops.

    I don't know what triggered it, but it randomly triggered a crash today.
    My server runs on paper-1.16.5-638

    I've attached the crash report, console logs, and plugin config in this zip.
     

    Attached Files:

  6. Just quick follow up. I deleted the original VDT folder, booted, enabled VDT in the config, rebooted again, and it is now working. It's a little strange that the old folder/config wouldn't work, but the solution seems to be to delete the plugin folder and start fresh. I was able to copy over my old settings and everything is working again. VDT is a great plugin. We really appreciate you providing it to the community and your dev work. We hope you continue to support it into the years to come. Thank you!
     
    • Like Like x 1
  7. Another quick question. What's the correct way to exclude a world? In the attached screenshot, I tried to exclude our spawn point, but it errored when I reloaded VTD. Can you tell me the correct syntax for excluding one or more worlds? Thanks!
     

    Attached Files:

  8. Hey, glad the plugin has been working well for you! That crash seems to be related to per-player mob spawns having an issue handling the change in view distance. I would suggest trying to update to the latest Paper version for 1.16.5 since you're a fair few versions behind - and it might be a problem that was fixed by Paper

    Hey, the correct way is to make a separate section for the world you wish to exclude, like this:
    Code (YAML):
    world-settings:
      Menacecraft
    :
        exclude
    : true

      default
    :
       # Should we not manage the view distance in this world?
        #  * Note: Even if excluded, the world's chunks will be counted for the purpose of adjusting the view distance of
        #    other worlds. If you do not want this, also be sure to set the chunk-weight to 0.
        exclude
    : false
    This will only exclude the world 'Menacecraft'
     
  9. Hi, just wanted to leave a quick bug report incase this wasn't known. On my paper SMP server, I noticed that mobs weren't despawning when leaving the view distance range. After some investigation, I found that when VDT decreases the view-distance, it breaks the ability of the server to despawn mobs once the player goes out of range.

    Steps to reproduce:

    - Start your VDT config with view-distance of 4. In creative mode, place a mob with a spawn egg in a fixed location, and move away at least 64 blocks. When you return within 64 blocks, the mob should have disappeared. This is working as intended.

    - Change the view distance with /vdt set 3. Repeat the process above, placing a mob with a spawn egg in a fixed location, and move away at least 64 blocks (48 would work too). This time, when you re-enter the view distance range, the mob is still there and hasn't been despawned.


    The impact of this is that players can no longer use the mob hard despawning mechanic in order to 'get rid' of spawned mobs by running away from them, since they'll still be there forever until they soft-despawn or you kill them.
     
  10. Hi, I don't want to overlap the vision between my players.
    exclude-overlap:
    should it be true or false?
     
  11. Hey, thanks for the report! I don't think there's much of a way around this unfortunately. Even in vanilla, the hard despawn distance is 128 blocks and does not change depending on the view distance. So I guess in that sense it is "vanilla behaviour" that this happens. There's no options available for changing the hard despawn distance during runtime that I'm aware of so I think the only real option in this case is to make sure your despawn distance settings make sense at your lowest configured view distance

    Hey, it should be true. This will make it so the overlap is not double-counted
     
  12. While you are correct that vanilla minecraft has a separate concept between hard despawn distance and view distance, in todays age, with multiplayer and bukkit servers, the behaviour is very different from what you'd see in vanilla. In a bukkit/spigot/paper server, when a player leaves the view-distance range set by the bukkit config froma particular mob, the server simply doesn't check that mob for existence.

    However, bukkit/spigot/paper servers have the built in functionality to despawn the mob when leaving this range, which is intended (presumably) to replicate vanilla behaviour, however this mod breaks it. It is very easy to see how your mod can break expected behaviour on paper servers by following the reproduction steps I mentioned previously
     
  13. I currently have view-distance: 2
    with 95 players connected, the chunk load should be 1,140 chunks but when I look at /vdt stats it gives me values above 1,900 chunks, does this have any explanation, I am a bit new to the subject, thank you for your answer.
     
  14. I'll have to look into this further on the weekend to see how the despawning mechanics work. I'll try to find if the view distance is used in the logic somewhere and is not being properly updated when the plugin adjusts it

    With a view distance of 2 each player would load 5x5 ticking chunks around them, which is 25 chunks in total. The maximum number of ticking chunks loaded by players with 95 players would then be 25x95 which is 2375. However some of your players are presumably playing in the same area as each other and may even be standing in the same chunk. This will bring the actual number of ticking chunks they are loading down, in your case to 1900
     
  15. Is there a more personalized way to receive support?
    Discord perhaps?
     
  16. Hi! I want the tick viewing distance to always be 3, and the no-tick viewing distance to vary from 4 to 6 (increasing at >15 tps, decreasing at <14tps). If you can, please tell me whether this configuration will work. It looks strange, but it seemed to me that it doesn't work properly with a different settings.

    Code (YAML):
    # Configuration for View Distance Tweaks.
    # Plugin page: https://www.spigotmc.org/resources/75164/
    # Github: https://github.com/froobynooby/ViewDistanceTweaks

    # Please don't change this!
    version
    : 5

    # Set this to true to enable the plugin. The plugin is initially disabled so that you can make changes to the config
    # appropriate to your server.
    enabled
    : true

    # How should we determine whether the view distance needs adjusting? Accepts three values:
    #  * proactive : Adjust the view distance so that the player-loaded chunk count is always below a set threshold.
    #  * reactive  : Adjust the view distance in response to changes in the server's TPS.
    #  * mixed     : Be both proactive and reactive; prioritising decreasing the view distance over increasing.
    adjustment-mode
    : reactive

    # These settings are for the proactive adjustment mode.
    proactive-mode-settings
    :
     # Set this to the maximum chunk count your server can handle. The view distance of each world will be adjusted such
      # that the total number of player-loaded chunks is sitting as close to this value as possible.
      #  * If you know your server can handle up to p many players with a view distance of d, a reasonable choice is to set
      #    this to (2d + 1)^2 * p.
      #  * As an example, 5780 is the number of player-loaded chunks for 20 players with a view distance of 8.
      global-chunk-count-target
    : 999999

    # These settings are for the reactive adjustment mode.
    reactive-mode-settings
    :
     # Above what TPS should we consider increasing the view distance?
      increase-tps-threshold
    : 50.0

      # Below what TPS should we consider decreasing the view distance?
      decrease-tps-threshold
    : 1.0

      # These settings concern how we determine the TPS.
      #  * Only touch these settings if you know what you're doing.
      tps-tracker-settings
    :
       # Over how many ticks should we collect tick durations for calculating the TPS?
        #  * Setting this too high will make the TPS very slow to react to changes.
        #  * Setting this too low will make the TPS volatile.
        collection-period
    : 1200

        # By how much (in percent) should we allow the tick durations we use to calculate the TPS vary from the average
        # tick duration.
        #  * This is used for smoothing the TPS; making sure it's not heavily affected by sudden large lag spikes, such as
        #    those caused by garbage collections or world-saves.
        #  * Setting this to 0 will mean your TPS will never change - don't do that.
        trim-outliers-to-within
    : 100.0

      # We keep a history of TPS vs. player-loaded chunk count in order to better predict what the TPS will settle to after
      # increasing the view distance.
      tps-prediction
    :
       # Should we use TPS prediction when we are considering increasing the view distance?
        #  * For example, we may be at 20 TPS with a view distance of 6, meaning we would consider increasing the view
        #    distance to 7. However, if we saw that 10 minutes ago with a view distance of 7 we had 17 TPS, we would hold
        #    off on increasing.
        #  * Disabling this can lead to a back-and-forth game of increasing and decreasing the view distance every few
        #    minutes - not ideal.
        enabled
    : false

        # For how long (in minutes) should we keep a TPS / chunk count history?
        history-length
    : 30

    # Every how many ticks should we check whether the view distance needs to be updated?
    ticks-per-check
    : 600

    # How long in ticks should we wait before starting the checking tasks following the plugin's start up?
    #  * This is useful when using the 'mixed' or 'reactive' adjustment modes where it is desirable to ignore the server's
    #    performance in the first few minutes following a restart.
    start-up-delay
    : 2400

    # How many checks in a row that say to increase the view distance should be required before the view distance is
    # actually increased?
    #  * This is useful as it guards against the following kind of case: A player leaves and the view distance is increased,
    #    but the player returns three minutes later and the view distance is lowered to its previous value.
    #  * Since increasing the view distance can cause lag-spikes for players with poorer connections, it is recommended to
    #    keep this value relatively high.
    passed-checks-for-increase
    : 10

    # How many checks in a row that say to decrease the view distance should be required before the view distance is
    # actually decreased?
    passed-checks-for-decrease
    : 1

    # Should we send a message to the console when we change the view distance?
    log-view-distance-changes
    : true

    # These settings can be specified per world. If a world is not specified or if a setting is missing, it will use the
    # settings listed under the default section.
    world-settings
    :
      default
    :
       # Should we not manage the view distance in this world?
        #  * Note: Even if excluded, the world's chunks will be counted for the purpose of adjusting the view distance of
        #    other worlds. If you do not want this, also be sure to set the chunk-weight to 0.
        exclude
    : false

        # What should the absolute minimum view distance be in this world?
        minimum-view-distance
    : 3

        # What should the absolute maximum view distance be in this world?
        maximum-view-distance
    : 3

        # Relative to the other worlds, how 'heavy' is a chunk on performance?
        #  * For example: In the End dimension, about half of the chunks you encounter are void and so have very little
        #    impact on performance. For this reason, you may want to set the chunk-weight of the End to 0.5.
        chunk-weight
    : 1

        # These settings concern how we count the number of chunks in this world.
        chunk-counter-settings
    :
         # When two players are near each other, their view distances can overlap. Should we not double count the chunks
          # that are overlapping?
          exclude-overlap
    : false

    #  world_the_end:
    #    minimum-view-distance: 8
    #    maximum-view-distance: 10
    #    chunk-weight: 0.5

    # These are additional settings that apply if you are using Paper as your server software.
    paper-settings
    :
     # These settings concern the no-tick view distance available in Paper 1.15.2+.
      #  * Note: higher no-tick view distances are less heavy on the server as far as TPS goes. For this reason, there is no
      #    option to adjust no-tick view distance based on TPS.
      no-tick-view-distance
    :
       # Should we adjust the no-tick view distance?
        enabled
    : true

        # Set this to the maximum number of chunks you want to be loaded by the no-tick view distance.
        #  * Note: this only counts chunks that are outside of the standard view distance of a player, but within the
        #    no-tick view distance of a player.
        #  * If you know your server can handle up to p many players with a no-tick view distance of n and a standard view
        #    distance of d, a reasonable choice is to set this to ((2n + 1)^2 - (2d + 1)^2) * p.
        #  * As an example, 6720 is the number of chunks loaded by the no-tick view distance for 20 players with a no-tick
        #    view distance of 12, and a standard view distance of 8.
        global-chunk-count-target
    : 999999

      # These settings are an alternative option to the reactive-mode-settings, allowing view distance to be adjusted based
      # on MSPT rather than TPS.
      #  * MSPT stands for "milliseconds per tick", and tells you how long your server takes to tick on average. A server
      #    whose MSPT is above 50 will notice things slowing down, as the TPS drops.
      alternative-reactive-mode-settings
    :
       # Should we use these alternative settings for reactive mode?
        use-alternative-settings
    : true

        # Below what MSPT should we considering increasing the view distance?
        increase-mspt-threshold
    : 66.6

        # Above what MSPT should we consider decreasing the view distance?
        decrease-mspt-threshold
    : 71.4

        # These settings concern how we determine the server's MSPT.
        #  * Only touch these settings if you know what you're doing.
        mspt-tracker-settings
    :
         # Over how many ticks should we collect tick durations for calculating the MSPT?
          #  * Setting this too high will make the MSPT very slow to react to changes.
          #  * Setting this too low will make the MSPT volatile.
          collection-period
    : 1200

        # We keep a history of MSPT vs. player-loaded chunk count in order to better predict what the MSPT will settle to
        # after increasing the view distance.
        mspt-prediction
    :
         # Should we use MSPT prediction when we are considering increasing the view distance?
          #  * For example, we may be at 38 MSPT with a view distance of 6, meaning we would consider increasing the view
          #    distance to 7. However, if we saw that 10 minutes ago with a view distance of 7 we had 48 MSPT, we would hold
          #    off on increasing.
          #  * Disabling this can lead to a back-and-forth game of increasing and decreasing the view distance every few
          #    minutes - not ideal.
          enabled
    : true

          # For how long (in minutes) should we keep a MSPT / chunk count history?
          history-length
    : 60

      world-settings
    :
        default
    :
         # Should we not manage the no-tick view distance in this world?
          #  * Note: Even if excluded, the world's chunks will be counted for the purpose of adjusting the no-tick view
          #    distance of other worlds.
          exclude
    : false

          # What should the absolute minimum no-tick view distance be in this world?
          minimum-no-tick-view-distance
    : 4

          # What should the absolute maximum no-tick view distance be in this world?
          maximum-no-tick-view-distance
    : 6
     
  17. I don't really have the capacity at the moment to provide real-time support, sorry. Forum based is about the best I can offer, but you might be able to find further help from people that have used the plugin in other Minecraft server admin communities

    Hey, the no-tick view distance is always adjusted proactively and not based on TPS. This is because non-ticking chunks do not have as measurable an impact on the server's tick times as ticking chunks. So with the config you provided, the no-tick view distance will always go to the maximum 6 since it will be targeting trying to load 999999 no-tick chunks. In short - it's not possible to do what you're trying to do
     
  18. Sorry, 1 more stupid question, does changing the view distance affect all players, or only those who join the game after changing it?
     
  19. Hey, the changed view distance affects all players - even if they were online when it changed
     
  20. Seems like 1.17 version is broken