Inactive [ADMN/MISC] WorldGenerationControl v2.6 - Generate areas of your world at will [1.0.1-R1 / 1.1Dev]

Discussion in 'Inactive/Unsupported Plugins' started by Nephyrin, Aug 7, 2011.

  1. Offline


    WorldGenerationControl 2.6
    Formerly ForceGenChunks
    Which is a confusing ass name so I changed it

    WorldGenerationControl on BukkitDev

    This is a very simple plugin to allow you to pre-generate a region of your world. It does not affect already generated regions. As of 2.0, it can also repair lighting of existing regions.

    • Generate arbitrary regions by coordinates
    • Queue multiple generations
    • Various speed settings to control lag vs generation time
    • Works on a live server
    • Doesn't lock up the server (unless you use the /allAtOnce option)
    • Low ram usage, works on servers with 1gig of memory.
    • Generates trees & ore, not just land
    • Can generate valid lighting
    • Can force regenerate lighting on existing chunks, to fix light issues.
    • Generating land and light take lots of CPU - nothing the plugin can do to prevent that! If you don't want to lag a live server, use the /slow or /veryslow modes.
    • Designed for servers with at least 1gig of memory allocated to them (-Xmx1024M). Servers with lower memory limits may encounter heap exceptions. If you have less than 1gig of memory, try using /slow or /veryslow modes.

    The /genregion (or /generateregion) command can be entered by any server op, the server console, or anyone with the appropriate permission (see below).

    The syntax is:
    /genregion WorldName StartX StartZ EndX EndZ

    For circles (/generatecircularregion or /gencircle):

    /gencircle Radius [WorldName xCenter zCenter]

    The world and center coordinates for the circle command are [optional] if you are a player (not the console). It will default to your current/world position.

    All coordinates are in normal, in-game coordinates - but will be adjusted to the nearest chunk boundary (inclusive).


    All commands can have options applied to them like so:

    /gencircle 1600 MyWorld 0 0 /fast /lighting

    Options are not case sensitive. The available options are:
    • /allAtOnce - Don't pause between steps, generate everything requested all at once. This will make the server basically unusable until the generation completes, but get the job done fastest. Very useful in conjunction with /onlyWhenEmpty
    • /veryFast, /fast, /slow, /verySlow - Adjust speed. Has no effect if /allAtOnce specified. Normally the plugin will cause mild lag while generating usually doing around 700ms of work per three seconds (depending on the server CPU). Raising the speed with fast or veryfast will cause more lag but speed up the generation, slow or veryslow will reduce lag while increasing generation times. Veryfast will cause a lot of lag. Veryslow will cause almost no lag, but will take something like 10x longer.
    • /forceKeepUp - Force the server to 'keep up' with garbage collection and chunk saving. In particular, 1.9 Has a new async chunk saver, which appears to be rate limited, meaning it may not keep up with fast generations. This option forces the chunks to be saved immediately, rather than on a separate thread.
      You should use this option if you notice the plugin spending a lot of time "waiting for the server to catch up" and don't mind the minor increase in CPU usage caused by forcing it to keep up. /allAtOnce mode will always use this option.
    • /lighting:none - Skip generating light data for loaded chunks. See Notes on Lighting below.
    • /lighting:force - Reset and regenerate lighting for all chunks we pass over, even if they already have lighting data. Useful for fixing areas with corrupt lighting.
    • /verbose - Print detailed timing info while generating. Doubles the amount of spam the plugin prints!
    • /quitAfter - Shutdown the server once this (and any other pending generations) are complete. See the Using in a Script section below.
    • /onlyWhenEmpty - Only do generating when the server is empty. The plugin will pause generation and wait until players leave, allowing you to generate lots of land without worrying at all about the extra CPU. You can use this in conjunction with /allAtOnce to have the server use 100% when it is empty towards generating land, without causing any lag when players are online.
    • /destroyAndRegenerateArea - As the name says, this will delete and destroy all land in the area given, generating new land instead. I cannot stress enough how this will delete your world (or the specified area of it at least), so please understand what you're doing and make backups!

    Permissions are optional. Server ops and the server console can always use generation commands. However, if you have permissions installed, the following permissions are used:
    • worldgenerationcontrol.generate - Allows user to queue generations. Implicitly grants worldgenerationcontrol.statusupdates.
    • worldgenerationcontrol.statusupdates - Allows user to see generation progress messages. These can be quite spammy, explicitly removing this permission will cause only the server console to see these messages.

    /genregion OurBeautifulWorld -50 -50 50 50

    Would generate from -50,-50 to 50,50 in game coordinates. Simple!

    /genregion "Bob and Sam's \"Awesome\" World" -50 -50 50 50

    The same command for world: Bob and Sam's "Awesome" World. Quotes can be placed around world names with spaces, world names with actual quotes in them can be escaped with backlashes.

    /gencircle 1000 /fast /verbose /lighting

    Would generate a 1000 block radius circle around the issuing player, using the /fast speed setting, with verbose output, with lighting!

    /gencircle 1000 MyWorld 100 100 /veryslow

    Would generate a 1000 block radius centered in MyWorld at 100x, 100z, using the veryslow speed setting so as not to cause lag.

    /gencircle 10000 MyWorld 100 100 /allAtOnce /onlyWhenEmpty

    Would generate a HEUG circle centered at MyWorld 100,100 at max possible speed, but pause the generation when players join. Useful if you want your server to use 100% on generating when it would otherwise be idle.

    Notes on Lighting

    By default, minecraft only generates lighting info for a chunk when it is first approached by a player. This is fine, but if you want to generate an external map with something like Minecraft Overviewer, it means the areas players haven't visited will only have 'fast' lighting, with pitch black shadows.
    To fix this, by default, WorldGenerationControl forces new chunks to have lighting info, as if a player were nearby. This shouldn't cause any problems, but takes about 8% more CPU-time. You can skip this step with /lighting:none -- the chunks will still be lit when a player wanders by, so this is only an issue for external tools as mentioned above.
    There is also /lighting:force, which will force-generate lighting for all chunks it passes over (even those already generated and with proper lighting), which is useful for making minecraft recalculate the lighting in areas with glitched shadows.

    Using in a Script

    The /quitAfter option lets this plugin be used as part of a script. For example, some users like to generate maps for a lot of random seeds to share with the community or post on /r/minecraft for delicious karma. Because bukkit/java freaks out when EOF is encountered in input, the proper way to do this would be something like:

    echo "gencircle 1000 TestWorld 0 0 /allatonce /quitafter" | cat - /dev/full | java -jar craftbukkit-0.0.1-SNAPSHOT.jar --nojline



    • 2.6
      • Updated to work with 1.0.1 / 1.1 builds.
    • 2.5
      • /forceKeepUp now keeps up on garbage collection as well
      • Renamed /forceSave to /forceKeepUp to reflect that it also keeps up on garbage collection.
      • When the server is floating at >80% memory for too long, the plugin will try invoking a GC. This fixes the issue where the default Java GC options would have it float at 80% memory forever as long as nothing forced it to catch up.
      • Cleaned up /verbose output a little.
      • Check if we have <200Megs free in addition to <20% free, prevents out of memory errors on 512Meg ram servers (which this plugin doesn't technically support)
    • 2.4
      • Add /forceSave workaround for 1.9's AsyncChunkLoader silliness.
      • /allAtOnce now implies /forceSave
      • Make the memory limit a little more conservative to ensure we don't hit GC overhead errors on low memory servers
      • Once the memory limit has been hit, wait for ram to decrease below the limit by at least 10% before resuming
      • Tweak the NextTickList bug workaround - instead of flushing the list, just ensure it stays below a threshold. Should fix the minor lag spikes from the fix.
      • Minor optimizations
    • 2.3 - Death to Memory Issues edition
      • Includes a fix for CraftBukkit's poor NextTickList handling, allowing high generation speeds on low memory servers
      • Invokes the GC directly when running close to memory limits to prevent GC Overhead errors
      • Takes a break if memory usage gets unacceptably high to let the server catch up
    • 2.2
      • Lighting now talks directly to CraftBukkit and is now approximately 115 times faster. Yep.
      • Because lighting has gone from taking up 92% of processing time to a trivial amount, the plugin no longer splits lighting/generating/saving into separate steps.
      • Because lighting is now very fast, /lighting is now the default. It can still be disabled with /lighting:none
      • /lighting:extreme is now named /lighting:force, and only eats a little bit more CPU.
      • Added /destroyAndRegenerateArea - which regenerates all chunks in the region. Beware!
      • Removed /lightExisting, lighting is now only done as-needed either way, and /lighting:force can be used to try and fix corrupt light areas.
      • Fixed /gencircle being centered incorrectly when called by a player without coordinates
      • Improved accuracy of some fuzzy math logic to ensure only requested areas are generated
      • Added /onlyWhenEmpty - this causes the plugin to only do its work when the server is empty, pausing and resuming as needed when players join/leave.
      • Minor speed/overhead improvements
    • 2.1
      • Fixed issue with /allAtOnce being too aggressive on lighting, causing memory issues on low-memory servers.
      • allAtOnce mode now returns into the server briefly between ticks, allowing other commands (such as /cancelgen) to be run.
    • 2.0
      • Name changed to WorldGenerationControl from ForceGenChunks
      • Large rewrite
      • Supports Minecraft 1.8's lighting methods
      • Added options: lighting, speed, verbose, quitafter
      • Added permissions support
      • Normal speed is much, much less laggy. Speed options provide control over lag during generation.
      • No longer trusts server to cleanup chunks, manages process through lighting step and cleans up chunks directly. maxLoadedChunks removed as a result, even on high speed settings the plugin will never load more than 1024 chunks into memory.
      • Cleaned up and improved status messages.
      • Use block coordinates instead of chunk coordinates
      • Support queueing multiple generations
      • Better in-plugin API for other plugins to interact with this one.
      • Other things I likely forgot
    • 1.4
      • Added progress % to generating status messages.
    • 1.3
      • Added support for quotes and spaces in worldnames via quotes and escape sequences.
        • To generate for map: Bob's "Wonderful" Funland
        • /forcegen "Bob's \"Wonderful\" Funland" -10 -10 10 10
      • Fixed the "Invalid world name" error message giving the wrong world name for /forcegencircle commands.
      • Separated generation and cleanup phases - plugin now prints a message when generation is complete, and a second message later when cleanup is complete.
      • New generations can be started even if cleanup isn't done, the remaining cleanup will just be merged with the new task's cleanup.
      • Removed warnings about players being in the world, with above changes there is no harm in them being there.
      • Added some colors to plugin messages. Pretty.
      • Plugin messages now show who did what.
      • Tested with recommended builds 1000 and 1060.
    • 1.2
      • Added /forcegencircle
      • Players who use the command now see the progress, not just the 'generation started' message.
      • A few minor text tweaks.
    • 1.1
      • Wait for chunks to unload, instead of assuming our unload requests succeed. Fixes a 'leak' of loaded chunks in large generations, chunks that never unload until a reboot.
      • Add a optional maxLoadedChunks argument to /forcegen, setting this higher reduces the time spent waiting for old chunks to unload, but causes more chunks to reside in ram, increasing memory usage.
      • Added /cancelforcegen, to cancel generation in progress.
    • 1.0
      • Release
    mknight14 and MechanID like this.
  2. Offline


    This plugin worls like a charm !!!!!
    Thanks a lot, I use it with Phoenis Terain mod!!

    If you want todos :p
    1/ allow regeneration of already existing chunks with a possible therholds : regen chunk only from heigh 32 so that we dont regen underground (diamons or subways)
    2/ add a hook so that for each chunk that maybe regenerate, you can say "yes or no" (for example dont regen my worldguard protected zones)

    Thanks again for this great plugin !!
  3. Offline


    As you'll probably find out very soon, this mod causes a TON of server latency in 1.8 while it is generating chunks. I'm on a LAN with the server, the server was not overloading the CPU/RAM, but I was getting block placement lag, like I was having connection troubles.
  4. Offline


    The terrain generation in 1.8 is very CPU intensive, hence the lag. I'm looking into an option to slow down the generation rate.
  5. Offline


    Do it work with 1.8
  6. Offline


  7. Offline


    Trollkemada - What have you tried setting max loaded chunks to? How much ram is allocated to your server?
  8. Offline


    I have tried 10.000 2.000 and 1.000, I have 1gb an no other plugins nor players (im just ussinga test server on my machine to generate the map)
  9. Offline


    The more recent updates for Bukkit have lessened the effect slightly. CPU usage for the computer was never pegged (max I saw was maybe 10-20% usage), however. My server is running two dual-core Opteron 280s (2.4GHzx4 cores in total) with 8gb ram (7gb free after OS and other programs).

    I also noticed that I would get the messages that too many chunks were loaded, even with as much RAM as I had (see above), and the server would only max out at using 1-1.5gb out of the 6gb I had allocated to the java app. I have not messed with the max loaded chunks yet, however.

    It would be nice if the plugin would know to use more of it when it's available, but I don't know how complicated that is to program.

    With only 1gb, I'm not surprised. XP will use > 512mb, and Vista/7 will use > 1gb, so that leaves next to none for minecraft. Even if that's not the issue, I hear that a stock Bukkit server uses about 800mb of ram by itself, though I haven't confirmed that.
  10. Offline


    2011-09-23 05:23:34 [INFO] [ForcegenChunks] The console started generation of 385641 Chunks (6170256 blocks).

    Show Spoiler

    AND GO!
  11. Offline


    Do you know if this works with the 1.8.1 rb?
  12. Offline


    ^ like he asked, i saw the red writing but i was wondering.. what if its a brand new server with no one on it and run little chunks by little? would you think that itd still get out of memory issues? running a 1.5gb server on a server host.
  13. Offline


    My tests have shown that the 1.8 recommended build should be safe to use - I'm working on an update as we speak that fixes some lighting issues and will have more options to relieve lag so it can be used on live servers without as much impact. It will also have a /fast mode that will use all the CPU it can, for those just wanting fast generations on empty servers.
  14. Offline

    Bradley Hilton

    Just wanted to say thanks for making this plugin! I'm using it right now to generate chunks on my server so that when we go public/live again and players go exploring it doesn't end up lagging the server like 1.8.1 seems to like to do with generating a ton of new chunks. Only have had it lag up twice but that was due to the 1.8.1 bug/issue. Thanks again @Nephyrin
  15. Offline


    I can also confirm this plugin working on the latest RB #1185.

    It was able to generate a significant amount of land in under an hour without any crashes. I just whitelisted my server temporarily and kicked everybody out, logged in and generated the command:

    /forcegenchunks world -312 -312 312 312 <---- pretty big map

    I will say it did chew up a significant amount of RAM. I ran it on an E3-1230 with 16 gigs of RAM and it topped out at about 8.5 for the duration of the render.

    Anyway, pretty awesome plugin. [cake]
  16. Offline


    Without adjusting the maxLoadedChunks the plugin should be able to generate a region of *any* size within 1gig of ram on an empty server. Usage beyond that is likely due to memory leaks in bukkit - although the amount of ram allocated when your limit is 12Gigs is a poor indicator. Java will use up the memory available to it, even if it doesn't strictly need it, rather than over-aggressively garbage collecting. I've done generations of 1/3rd that size on 1Gig via build 1185, i'd be interested in hearing if the generation successfully completes if your max heap is set to 2gigs.
  17. Offline

    Bradley Hilton

    I know mine was from the memory leaks in bukkit because for the past few days when my server staff was exploring around and making it generate I was having way more problems than generating it with your plugin. I have 12gb of ram allocated to my bukkit server also and maybe after running your plugin for six hours I had to restart the bukkit server since the leak finally filled up my ram. Six hours!? Yeah I know, I'm using it to do a massive generation of chunks so that we don't have to deal with the leak later on.. By the way I'm still running it now generating as much as we can. Kind of looking forward to your /fast version of it even if it does mean restarting a couple times due to the leak..

    --Edit-- Realized I didn't say what I was doing. Doing the radius of about 325, was doing it bigger before I realized exactly how this plugin works.
  18. Offline


    Note also that lighting *is* broken for 1.8 - if you render the generated land in something like mcmap you'll see only simple lighting (100% opaque shadows). This will be updated the first time someone gets near the chunk, so the only issue is for out of game maps and of course the CPU eating that the first-time lighting will do.

    I'm actually working on this as we speak - the next version will force proper lighting, including in regions that are already generated. (so you can force-update lighting in previously generated areas). I pushed the lighting code to the git repo, but there's a bit of work left before it's safe.

    Let me know if you have any feature requests, right now I have /fast and /slow planned, /quitAfterGeneration (for scripting purposes), and the ability to queue multiple generations.
  19. Offline

    Bradley Hilton

    I'm not too worried about the lighting honestly. If it updates when players go near, they hopefully won't notice it too much.

    Well as soon as you do post an update, post a reply to this topic so I will get an email about it and I'll test it out/use it as soon as possible. I would use the force-update lighting since I've noticed that some of the lighting when normal generator (without using your plugin) seems to be a little messed up in areas at times. Would that be able to be done in radius or rectangle style?

    None that I can think of at the moment. I like the idea of having a fast and slow option, see that being useful if someone's doing it on a live server with quite a few players on and they want to expand their generated chunks equally.
  20. Offline

    Bradley Hilton

    Do we currently need to remove the old .jar? I usually do just curious.

    Will be testing this out either later tonight or tomorrow :)
  21. Offline


    v2.0 released, it has a few minor fixes from the beta build I posted previously, so check it out.

    And yes, you should remove the old version when you update. Let me know if you run into any issues!
  22. Offline

    Bradley Hilton

    Okay awesome will let you know tomorrow how it goes!
  23. Offline


  24. Offline


    Just to make sure - this plugin doesn't change the default minecraft generator right? All it does is generate chunks exactly the same way as walking on them for the first time? Including default 1.8 dungeons?
  25. Offline

    Bradley Hilton

    I do believe that you're correct @filszyp

    I generated my whole world and it's all 1.8.1
  26. Offline


    Correct, this plugin just loads chunks the same way exploring would.

    I just posted v2.1 which fixes a memory issue I found testing /allatonce mode on a low-ram server

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


    Thank you for your reply.
  28. One hell of a plugin!
  29. Offline


    It uses whatever world generator the server is running. The land generated is identical to if you went and explored manually.
  30. Offline


    You are my hero! I love this plugin more than world edit, voxel sniper, Heroes, buy craft, jail, regios, ddhelp, combat tag, factions, turnstile, spoutMOTD, and spout. Heck, it's better than Pacman and minecraft!
  31. Offline


    Seems to run out of memory for me and then freezes bukkit.
    Depends on the size of the generation and memory allocated to it of course but it never seems to free up any memory as its going. (possible memory leak or just me making too large a generation?)

    /gencircle 5000 /veryFast with 18GB will slowly fill up and then freeze around 92% when its maxed out the memory.

    I know 5k is a large amount but I thought id just let you know.
    Very useful plugin if you want huge pre-made maps and have the memory for it, love it.

    (I generate the worlds on my personal super computer and then copy them over to my slow ass server ^^)

Share This Page