Inactive [FIX] ChunkManager 0.4.3 - Improved chunk sending algorithms! [1818]

Discussion in 'Inactive/Unsupported Plugins' started by Thulinma, Dec 3, 2011.

  1. BukkitDev URL:

    This plugin does some smart manipulation of the server internals to prevent the following chunk sending problems:
    • Chunks are only sent while you are moving - one chunk per movement packet.
    • Chunks beyond your viewing distance are still sent if you moved away from them before they were sent to you.
    • Chunks will not be sent if you are receiving too many other types of packets (many entities nearby, for example).
    • Chunks are sent with the chunks nearest to you being sent first. If you are moving fast, this will only load chunks behind you!
    With my plugin enabled, this changes to:

    • Chunks are sent every 2 server ticks (10 chunks per second), whether you are moving or not, until you have all chunks near you.
    • Chunks that are farther than 10 chunks away from you, are cancelled.
    • Chunks will always go into the packet queue, even if many entities are nearby.
    • Chunks are send based on the position you will be at in about a second, calculated with your current movement speed in mind. Works smoothly, even for insane speeds!
    Should be compatible with all other plugins, even plugins that mess around with chunks themselves, including spout!

    This plugin will gracefully fail if you are running an incompatible server and re-enable the vanilla chunk sending management, warning you in the server log about this.

    The latest beta version (0.4.3 at time of writing) can always be found here.
    And of course, source code is available on github.

    Note that this is in early development. It's stable, and your server will definately not crash with this plugin enabled, but there are no options and no permissions. It's either on or off for right now. Please report any problems you find, and suggestions for improvements!

    No known incompatibilities!
    Confirmed compatible with sometimes problematic plugins like Spout, Ore to Client Obfuscation, NoLagg (bergerkiller includes a modified version of my code in newer versions of NoLagg).

    0.4.3: Fixes compatibility with the latest RB (1.1-R3).
    0.4.2: Fixes bug of random "holes" not loading until you stand in them.
    0.4: Fixes all known bugs. (Cross-world teleporting being slow, player renaming breaking chunk sending, server reloading causing missing chunks)
    0.3: Even more optimalisations, better handling of movement (fast movement especially - tested up to 200 blocks/s movement speed!), better handling of deleting far-away chunks.
    0.2: Optimalisations and smaller code. No new functions, but works a lot faster and uses less memory.
    0.1: First public release.
    Rahazan, vicente947 and bergerkiller like this.
  2. Offline


  3. Offline


    mmm.. looks nice but compatibility with nolags ? :D this plugin have some changes at load chunks :p
  4. Offline


    @Adrenaline added this plugin inside NoLagg right now (have his permission), of course adding proper credits :)
    Adrenaline likes this.
  5. Offline


    kkk ^_^
  6. Offline


    To be honest, after digging away the code, it is (so damn) simple of how it works...yet it is so much better than the method I use in NoLaggChunks... xd

    This is my own implementation of this plugin

    It is indeed a lot simpler to just alter the chunk sending queue directly, instead of handling the packets at the very last minute...possibly interfering with other plugins and with a Spout requirement.

    Now considering working this out completely, but instead of using a task replacing the player instances that are used to manage these sending things, this way altering the algorithm and allow buffering + sending to properly function.

    Props to you @Thulinma , at first I thought 'how' but now I dug through the source code of native minecraft server again, it proves that the simplest of things are sometimes the best ;)
  7. Offline


    @Thulinma Looking good please don't add this or merge this into anything like NoLagg and crap like that I don't want more bugs. But this looks really great and I will have to test it out. I was wondering if you tried it with spout any chance?
  8. I haven't tested it, but it should work. It alters a different part of the chunk code and shouldn't interfere. Let me know if you have any issues and I'll try to fix them. :)

    Hehe, told you it was easy :p Let me know if/what you change so I can add the changes here too. I like the idea of keeping this available seperate from the other "nolag" stuff, since this plugin will most likely not break when craftbukkit updates - unlike your plugin (no bad meaning intended here - it's simply a fact of live that if you fix that many issues, it will break a lot when updates come out...) :)
  9. Offline


    @Thulinma believe me, this is FRIGGEN awesome. Thanks man! :)

    I completely ported NoLaggChunks to your system, but then 'slightly adjusted'.

    As you know, players have a List called 'chunkCoordIntPairQueue'. Now, instead of using a task to check this list every so often, I made my own class extending LinkedList (that is used), handling all changes. Luckily, if get(0) returns null, it ignores the send, I used that to my advantage. I can easily control what chunks are sent and when, and it uses so much less load. :)

    Furthermore, I replace this queue with my own when a player joins and when he changes worlds, can't be simpler. Added a single task which acts as a 'chunk clock' to update the intervals and rates. Added a trigger system to validate chunks after they are sent (trigger queue), which is sent to the player every tick as well. Added a 'boost' value, which sets the amount of chunks to ignore. I use that to make the download part go quickly.

    In short: your method got a bit outdated now, but the main system (using the queued list) is still present, only reworked. Will upload 1.51 of NoLagg really soon, completely free of a Spout dependency :)


    And that's why everything can be toggled on and off :)
    btw, most issues came from NoLaggChunks, which will be entirely replaced now. (pfew)
  10. It was written with Spout in mind - but I must admit I didn't test it with spout. Should work. Let me know if it doesn't! Like I wrote a few posts up, I plan to keep this updated seperate from bergerkiller's nolagg plugin, for people like me who want something simple that "just works". The people that want more can always use his version :)

    Just posted an update to version 0.3 - it's starting to *really* work nicely now. Only one feature is missing before I'm calling it 1.0 and a "stable release". :D (see top post for changelog)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 21, 2016
    Kane likes this.
  11. And 0.4 is out now. Fixes all known bugs (again, see topic for changelog).
    The next release will most likely be 1.0, unless I find more bugs before then (unlikely).
  12. Offline


    Does this also fix chunk holes when you teleport to a chunk that is not loaded yet?
    Looks brilliant :)
  13. Offline


    @bergerkiller So should we just use this and replace nolaggchunks?

  14. Not intentionally, but it might do this as a side-effect. I haven't tested that, to be honest.

    He's already including my ideas as part of nolagg and removing the nolaggchunks. Since he and I have some different ideas on how chunk sending should be done, you can still use my plugin with his plugin though - in which case it will automatically replace bergerkiller's version of the technique. This way users can decide which version they like most for themselves :)
  15. Offline


    Approved because of bukkitdev
  16. Offline


    I love this plugin. Nice work. I've been testing from a high-latencey, low-bandwidth connection and it's brilliant.

    love it.

    [EDIT] - I still get killed by time-traveling creepers, but at least I can see where I am.
  17. Offline


    Chunks that are futher than 10 chunks away from you, are cancelled.

    So this plugin forces a viewdistance=10 ? What if I use viewdistance=3 ?
    MarkehMe likes this.
  18. Correct. Note this is maximal view distance - I do not influence when chunks are sent, I simply cancel chunks that are futher than 10 away. If you have the view distance set to 3, it will not change this to 10.

    I will most likely add a setting in a later release of this plugin, allowing you to change the 10 to other values. :)
  19. Offline



    Thank you for your reply. Also, If I use a viewdistance=3, can your plugin still be useful ? I mean the chunk load direction features and so on.

    One more interesting question, can your plugin SIMULATE a viewdistance LOWER than the MC hardcoded 3 ?
  20. Yes and yes :)

    The main feature of this plugin is better management of chunk sending - regardless of your settings, you should always see an improvement.

    As for the "lower than 3" viewing distance, it can definitely simulate this - as low as 1 is possible (only send the chunk the player is standing in, nothing else). Well, even 0 would work, but no chunks would be sent at all anymore, making playing a little difficult :)
  21. Offline



    Very cool.. please make it happen! I have a 500+ server, and any viewdistance above 3 make it unplayable, but I bet if we could set a lower than viewdistance=3 our player CAP would increase even more. :)
  22. Sure, I'll put that option in the next release, most likely.
    Not sure yet when exactly that will be, but sometime soon.
  23. Offline


    Hi, will this plugin change server bandwidh requirements per player ? (towards less use I hope ? )
  24. Sort-of. The amount of data sent is still on average the same, but if your server has less bandwidth available than it really should have, this will make the effects of that less noticable.

    An example:
    I run a small MC server with a few (10-ish) players. Before this plugin, about 4 could be online at the same time, as I have a 100kb/s upload speed on this server, which is not enough by far for a good amount of players.
    With this plugin installed however, it is still playable with 8 players connected. A good improvement :)

    Your mileage may vary, of course. And if anyone else wants to report changes in amount of players that are able to be online at the same time using this plugin, I'd be very interested to hear it :)
  25. Offline


    It wont load the map after a certain range from where I came into the game, its one big map hole after a certain distance
  26. What viewing distance do you use on the server? Do the areas appear if you step into them? Can you guesstimate the range where this starts happening?
  27. Offline


    I had it at 15 view changed it to 10 and it works, think when you fix view distance itll be fine, other than that still maybe an issue or 2 with it and orebfuscigator holes but they usually dont last long, also I have with or without the plugin issues with holes where you need to step into them in the vicininty of the area I am when I log in, maybe you can make that load better too.
  28. Offline


    How is the plugin going. I had tested before but really could not see much of a difference. I think Spout might already do some of its own optimizations.
  29. Today's bugfix release (0.4.2) should fix your problems.

    0.5 with configurable viewing distance coming soon! :)
  30. Offline


    Im using the no lag chunk sending thing, is this one better, if there the same thing ill stick to the no lagg option.

Share This Page