1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Thread Status:
Not open for further replies.
  1. Afforess

    Afforess

    Local Time:
    4:54 AM
    CraftBukkit++

    While I enjoyed maintaining CraftBukkit++, md_5 has shown that he can do a better job, so I recommend all users to migrate to Spigot.​
    ELI5 (Explain like I am 5):
    CraftBukkit, slightly tweaked to make it run faster, and use less RAM. You use it instead of the craftbukkit.jar from dl.bukkit.org. Your plugins will work with it just fine.​
    The Name:
    "++" is a programming statement in C/C++/Java and many other languages. It refers to incrementing a number by 1. In this sense, it is CraftBukkit and 1 version better. Frequently shortened to "CB++".​
    Technical:
    CraftBukkit++ is an optimized build of Craftbukkit, with performance enhancements in mind. These enhancements are all configurable via the bukkit.yml file in your server folder. A partial list of the major enhancements are listed below:
    Optimized Growth/Decay
    Growth and Decay (Wheat, saplings, leaf decay, etc) are the single biggest tax on servers. For an understanding why, a 15x15 chunk area, with the player at the center is checked for growth each server tick.

    Vanilla growth area:
    View attachment adl.dropbox.com_u_49805_chunks.png

    Green squares are chunks checked for growth each tick. That's a lot. And this is per-player.

    Modified growth area:
    View attachment adl.dropbox.com_u_49805_chunks2.png

    Oh, pretty colors. But what does it mean? The Red chunk (the one the player is standing in) will always experience growth/decay. This means that players won't be surprised by leaves not decaying, etc.

    The green chunks show likely growth areas. Instead of always searching nearby chunks, the server only grows/decays in a specific number of chunks each tick. The amount is in your config. If you have 200+ players, I recommend 1000. If you have less, increase that number. More chunks = more lag, but faster growth. You will need to experiment to find a happy medium.

    Anyway, likely growth areas *may* grow and decay, but are not certain. They will only grow/decay if the server has enough leftover chunks to check.

    HOW MANY CHUNKS SHOULD YOUR SERVER USE?

    Depends on the size. If you are a 50 man server or less, try 2500 chunks. If you are a 100 man server, try 1500 chunks. 200 man, 750. I don't advise going below 500. If you use zero, or less than zero, GROWTH WILL BE DISABLED.

    Optimized ItemStacks:
    Items near each other and of the same type and data will automatically merge into an itemstack, to save on calculations. This can drastically cut down on CPU, because each itemstack floating in the world can use the same time as a zombie or skeleton might. Merging them together will drastically reduce the amount of items on your server, and save memory and CPU.

    XP orbs will also merge, like items do, by combining xp.

    The radius at which items will merge together is in the config. If the radius <= 0, items will not merge.

    Optimized Redstone Torches
    Some changes have been made to how the game internally locates and registers the locations of redstone torches. It does not alter gameplay, and hence no config option is present.

    Disable Random Lighting Checks
    Each tick, the game randomly samples several thousand blocks to verify that the light levels are correctly. This is a huge waste of CPU, since light updates just fine from block placement, and very rarely needs to be correctly. With this disabled, light updates will only happen when new chunks are generated or blocks are placed. This is adjustable in the config.

    Mob Spawn Range
    This changes how far around players mobs will spawn. By default this range is 8 chunks, (or 16*16 blocks, [256 if you're not a math geek]). This is a pretty large area. By default, with CB++, this range has been reduced to 4 chunks around players. Players will still encounter the same mobs in each chunk, they will just be more centered around players.

    Monsters Per Chunk
    This is how many monsters (creepers, skeletons, etc) will spawn in each chunk of the world. The default value is 70 per chunk. Increasing this will increase the monsters spawned, decreasing it will reduce the monsters spawned.

    Land Creatures Per Chunk
    This is how many passive creatures (sheep, pigs, etc) will spawn in each chunk of the world. Acts the same as monsters per chunk. Default is 15.

    Water Creatures Per Chunk
    This is how many water creatures (at the moment, only squids) will spawn in each chunk of the world. Acts the same as the above 2 settings. Default is 5.

    Aggregate Ticks
    With the setting at 4 (the default) the server will skip the chunk-tick process 3 ticks and at the fourth tick it will decide what chunks to tick, select them and then applying growth 4 times. This means the server need to spend less time choosing chunks and more time growing. If you use a setting of 1, the server will not aggregate any ticks and work normally.

    Sugar Cane/Melon/Pumpkin/Wheat/Mushroom/Tree Growth Rates
    These modify how quickly food grows on your server. This settings do not affect performance in any way. They are a percentage of normal growth, so 100% is normal growth rate. 200% is 2x normal growth rate, and 50% is 1/2 normal growth. Experiment with to your liking.

    Filter Unsafe IPs
    Uses http://www.spamhaus.org/xbl/ unsafe ip address service to automatically block any unsafe connections to your server. Any known infected pc or botnet ip address will be blocked from connecting.

    New Commands:
    • /merge - requires 'bukkit.command.merge' permission. Alters the item merge radius.
    • /growth - requires 'bukkit.command.growth' permission. Alters the number of chunks that growth occurs on each tick.
    • /mobspawn - requires 'bukkit.command.mobspawn' permission. Alters the range that mobs will spawn around players.

    eea550ac9570ef10a551abba332df410.png

    Have ideas for further performance fixes? Let me know.

    This is a personal project, unaffiliated with Spout, only posted here because Bukkit does not allow custom builds on their forums.

    If you appreciate this, donate for my time. awww.paypal.com_en_US_i_btn_btn_donate_LG.gif
    Last edited by a moderator: Oct 21, 2013
  2. Kainzo

    Kainzo

    Local Time:
    3:54 AM
    Herocraft approved
  3. midget_3111

    midget_3111

    Local Time:
    9:54 AM
    Shall be moving to this once a 1.1 stable build is out,
    Is this also how these things will work on the spout server?
  4. Sleaker

    Sleaker

    Local Time:
    1:54 AM
  5. S3bastian

    S3bastian

    Local Time:
    10:54 AM
    Testing it, seems to work very well. Thank you!
  6. croxis

    croxis

    Local Time:
    1:54 AM
    For those of us stuck on small VPS are there any optimizations to be had in the ram department?
  7. Afforess

    Afforess

    Local Time:
    4:54 AM
    Probably not. I'd decrease your view distance.

    I have some proto-ideas on how to compress chunk data, but that is likely to be more of a CPU/File access boost than a RAM saver.
  8. croxis

    croxis

    Local Time:
    1:54 AM
    If memory serves chunks are loaded in a square shape around a player, so view-distance of 10 means 21x21 chunk area is loaded, or 441 chunks. Would it be possible (and not too complicated) to have chunks load in a circular shape instead? A view-distance of 10 would result in only 314 chunks loaded (a 30% savings!). Circular loading with a view distance of 12 is about the same as square loading of 10.
  9. JoneK

    JoneK

    Local Time:
    11:54 AM
    How ever :( now my Massive farms won't grow.. unless there are less ppl online, tough they won't grow anyways when less than 10 tps

    Ouh disable "fast" or all redstone light updates from server side.
  10. Afforess

    Afforess

    Local Time:
    4:54 AM
    Turn up the number of chunks growth happens on. With vanilla and 100 players, it's rough 22500, so 5000 is not unreasonable.
  11. DonRedhorse

    DonRedhorse

    Local Time:
    10:54 AM
    well you and bergerkiller should get together... at least "bash" your head together on ideas..

    will look at the version when you publish the next one... looks like an RB is around the corner
  12. Kainzo

    Kainzo

    Local Time:
    3:54 AM
    We will be doing some hardcore testing tonight on this - since =Herocraft= is now on 1.1
    Are the item config changes still toggable in the config in the latest? I really dont mind the changes and it does make the server lag a lot less.
    Afforess - will a plugin like NoLagg will decrease the lag as well as a cb-server side fix?
  13. Afforess

    Afforess

    Local Time:
    4:54 AM
    I have updated CB++ to the lastest CB code, enjoy. ;)
    DonRedhorse and gameswereus like this.
  14. macman

    macman

    Local Time:
    9:54 AM
    Can anyone comment on how successful this is? With a in depth review?
  15. Afforess

    Afforess

    Local Time:
    4:54 AM
    Anecdotally, Herocraft uses this and can host 200 players with 20-15tps.
  16. Grinch

    Grinch

    Local Time:
    3:54 AM
    Just for the record, what is the usual TPS for Herocraft around 200 players when not using CraftBukkit++?
  17. Inscrutable

    Inscrutable

    Local Time:
    6:54 PM
  18. BioRage

    BioRage

    Local Time:
    4:54 AM
    Mytatrea Approves!
  19. BioRage

    BioRage

    Local Time:
    4:54 AM
    10 TPS
  20. macman

    macman

    Local Time:
    9:54 AM
    Ok I like this, I used to barely get 10 TPS with 25+ players Now I get 20 all the time even when world editing.

    I fully recommend this.
Thread Status:
Not open for further replies.

Share This Page