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

    Nephyrin

    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.

    Features
    • 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.
    Bugs/Quirks
    • 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.
    Commands

    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).

    Options

    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

    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.
    Examples

    /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:

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

    Download
    https://github.com/downloads/Nephyrin/WorldGenerationControl/WorldGenerationControl_v2.6.jar

    Source
    https://github.com/Nephyrin/WorldGenerationControl

    ChangeLog
    • 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

    Nephyrin

    Xmillsa: It sounds like you're using a version of craftbukkit with memory leaks in it. The plugin will never have more than 1000 chunks or so loaded when generating, which is less than 1g of ram usage. I've done very large generations on a test server using 1gig without issue. Try using build 1185 or 1240 and see if this improves. It's also worth noting that java is a garbage-collector based language, and allocating massive amounts of ram to it is basically inviting it to chew that much up, regardless of how much is in reachable use.

    Actually, I take it back. According to a jhat profile:



    That's not good. It looks like on /veryfast the server lags behind in tickrate, but doesn't cull its pending ticks list, causing a sort of memory leak. This is a craftbukkit issue, but I believe I can have my plugin work around it. In the mean time, try a lower speed setting!

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

    Xmillsa

    The latest version of craftbukkit (1317) does seem to have fixed the problem.
    Currently re-running the same command, 50% through and only 1.1GB used(itd be around 9GB used on 1240), so far so good!
    EDIT: Finished with never going over 1.2GB I think we can safely say craftbukkit 1317 has fixed the issue.

    Although with that I have a question, when doing a re-run/re-generating a world, does it skip over the parts it's already generated or does it try to generate them again?
    I only ask because it seems to be taking the same amount of time as it did previously when I tried the command.

    To not encounter the craftbukkit "leak", I changed 5000 to 4800 which, completely successfully and is a fully working and running world, so... it's now re-doing the command "/gencircle 5000 /veryFast" over the 4800 area which has already been completed, or at least it seems that way.
    Hope that makes sense.
     
  4. Offline

    Spruu

    Thank you for making this plug-in, I had been looking for something like it for awhile. I used it when you first released it with much success, but now I'm having problems.

    After keeping up to date with 1.8.1 and the pre-releases, I've come to realize I really dislike the new terrain, so I thought I would use this and Bukkit 1060 (1.7.3) to generate worlds for the foreseeable future. Now trying to get the old version running is proving to be a problem, even though I used it in the past.

    I started with the latest version of the plug-in, and no surprise there it didn't work with Bukkit 1060. So I went back to the 1.4 version and it won't load either. Here is what I see:

    Code:
    12:59:36 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-980-
    g4ed23b1-b1060jnks (MC: 1.7.3)
    12:59:36 [SEVERE] Could not load 'plugins\ForcegenChunks_v1.4.jar' in folder 'pl
    ugins':
    java.util.zip.ZipException: error in opening zip file
            at java.util.zip.ZipFile.open(Native Method)
            at java.util.zip.ZipFile.<init>(Unknown Source)
            at java.util.jar.JarFile.<init>(Unknown Source)
            at java.util.jar.JarFile.<init>(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:60)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:213)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:136)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:143)
            at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:110)
            at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigur
    ationManager.java:51)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:133)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:337)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    12:59:36 [INFO] Preparing level "world"
    Any thoughts on what I'm doing wrong and how to get this running again?

    Thanks
     
  5. Offline

    Nephyrin

    This error sounds like your v1.4 jar file is corrupt. Try downloading a new one from here:
    https://github.com/Nephyrin/WorldGenerationControl/downloads

    And make sure it matches md5sum af1cea7c60f616955006d05ab5141f74
     
  6. Offline

    Spruu

    That fixed it, thank you.
     
  7. Offline

    Spruu

    Sorry to even bother you with an outdated version, but I have my reasons for using it. I've read through the thread and noted your explanation as to the memory leaks and everything, which I am experiencing with 1060.

    I'm guessing my only choice is to do this in stages?
    For example,
    Code:
    /forcegen world -10 -10 0 0
    /forcegen world -10 10 0 0
    /forcegen world 0 0 10 10
    /forcegen world 0 0 10 -10
    And just restart the server, and re-do that stage when I run into problems?

    Or does anyone know of a pre-1.8 Bukkit version (old terrain gen) that didn't have the memory leaks when generating chunks?

    Somewhat detailed description in spoiler for anyone that cares.
    Show Spoiler
    P.S. Am I missing something or is it not saving the chunks to disk as it works? Is this where the Bukkit memory leak stems from? Even though it may not help I increased the -Xmx from 2GB to 4GB and it seems to have gotten further along this time, but the RAM usage is still enormous and when it runs out it seems to slow down greatly. At least it is still working.

    I noticed after about 20km^2 were generated the folder for my new world was still only a couple MB leaving me to believe it's keeping it all in RAM and not saving to disk at all. Now that it's about 50km^2 the folder is only at 81MB and my RAM usage is at 4.4GB. Progress has really slowed down though.

    And boom, it died. I got 51.58% through a ~100km^2 world generation. The world folder is still small, only 82.3MB. Just closing the window actually updated the folder size finally, 879MB. Maybe I should just give in and use 1.8....
     
  8. Offline

    Nephyrin

    There are two memory issues I'm aware of:

    1) Certain craftbukkit builds leak memory when loading/unloading ram, causing unnecessary chunk references to sit around. There's no good way around this other than using unaffected builds.
    2) The servers internal NextTickList of block processing has arbitrary restrictions on its processing rate, meaning the plugin can outpace it causing it to cache millions of block references. This isn't anything like land being in memory - its just information about changes the server needs to look at that are piling up faster than it can do so. I submitted this pull request to craftbukkit to resolve this issue. Until then using normal or slow generation speeds should allow the server to keep up without the runaway memory lists.

    Neither of these have anything to do with not saving land - in fact, the v1.4 of the plugin explicitly prevents more than ~700 unsaved chunks from ever being loaded, pausing while the server catches up with saving if it goes over that (a 2gig server can easily load 20,000 chunks into memory for comparison) -- These issues are purely poor memory handling in craftbukkit. Using the latest builds + my patch above I generated a 5000 radius circle at max speed in about 40 minutes on a server with 1gig of ram -- so i'm quite positive that this is the issue.

    If you're feeling bold you could try building your own version of craftbukkit 1060 or whathaveyou with that patch applied, or you could use a more recent build that lets you use the slower speeds.
     
  9. Offline

    Spruu

    Thanks for the response. I forgot, you are right about it not keeping the chunks. I remember seeing it referencing (I thought) ~850 loaded chunks in the server log, at least towards the end.

    I'm glad to hear you've found a way around that in the latest builds. As for the old terrain generation, I have a couple friends taking Java courses right now. Maybe I can talk one of them into taking a gander at that patch. Thanks!
     
  10. Offline

    SPBmayhem

    Hello, great plugin I was just wondering if you could implement it so you can make a square not just a circle
     
  11. Offline

    Spruu

    You can currently. From OP:

     
  12. Offline

    Vorna

    Ok, I have not tested this plugin on my server yet. But was wondering something.

    I have been searching for a very long time for a plugin that allows me to generate ore back. Why? Because I am trying to make a world similar to how RuneCraft works. Where you cannot dig throught he ground, but instead can mine the ores that have been pre-placed.

    So Lets say I have some iron ore in a cave and the cords for one of the iron ore blocks is 1,8,5.

    Can I have it where this plugin generates an Iron ore at the cords 1,8,5 every few minutes? Of coarse if one is already there, it would do nothing. But if it is missing, it would generate one there.

    If so, I can use other plugins to prevent players from placing blocks there to break it if need be.

    So in short, Can this Plugin Target a single block region and spawn a specific block there at time intervals?
     
  13. Offline

    Spruu

    The closest you could get is a 1m^2 column. from bedrock to sky. For example:

    /genregion World 1 5 1 5

    It doesn't do elevation so the 8 wouldn't be used. This would also regen the column from the seed, so if the iron block was placed there manually, it would remove it and place whatever was there originally.
     
  14. Offline

    Nephyrin

    This plugin regenerates land by the chunk, so that would end poorly
     
  15. Offline

    Vorna

    No worries. I found my plugin I was looking for. It's called Growing Ore. It works wonderful. You select ANY blocks at all by right clicking them and then make them turn into ANYTHING and when you destroy that block.. it regenerates on a time interval you gave it. Its like my prayers were answered.

    P.S Thank you Nephyrin for helping the community so much .People like you are the ones who stitch the quilted community together.
     
  16. Offline

    Nephyrin

    v2.2 is out!

    Lighting is 115 times faster now so you should probably update. Also added /onlyWhenEmpty, /destroyAndRegenerateArea, and other improvements, see changelog
     
  17. Great plugin! Took me some time to learn how to use this (I don't use this for my public server though)
     
  18. Offline

    Darkvoltage3

    I've been tring to get rid of generated minecraft chunks to perserve my world and get rid of them for good so that when i got in the game it wont show mc chunks only mine will this plugin do the job for me?
     
  19. Offline

    Nephyrin

    v2.3 released - has a workaround for the craftbukkit memory issue and code to have it take a break if memory is usage is getting too high.

    This release also works well with the experimental 1.9 bukkit builds
     
  20. Offline

    niugnip

    Just a little suggestion: Could you make it possible to regenerate an Annulus (ring shape), so you do, for example,
    /gencircle RadiusA RadiusB Worldname x y
    And maybe the same thing with squares? That would be great ;D
    /gensquare RadiusA RadiusB ...
     
  21. Offline

    Nephyrin

    niugnip - a /excluderegion:x1,x2,z1,z2 type option is on my todo list, which would let you make rings and such. e.g. /gencircle 100 /excludecircle:90

    I also just posted v2.4, which has a workaround for 1.9's async chunk saving making generations take forever
     
  22. Offline

    Lakart

    I love this plugin, but it also drives me CRAZY. If It ever hits that "memory limit" the memory never gets back to an acceptable amount. And if I have to stop the sever or reload the plugins for whatever stupid reason I have to, everything its generated ends up having to be generated again. I wish there was some kind of feature where it would save every x% that way you wouldn't loose everything if something went wrong.
     
  23. Offline

    Nephyrin

    I think this is because java sees memory at 85% with moderate load, and decides not to start a GC, resulting the server just floating at high ram indefinitely. I've released v2.5 which tries to address this, let me know if you see issues.

    As far as chunks not saving, are you using craftbukkit 1.9? The new asynchronous chunk saver can delay the chunks getting saved - the new /forceKeepUp option will make sure they're all saved immediately (at the expense of a little more lag)

    - Neph
     
  24. Offline

    Lakart

    Yeah I am using 1.9. Thanks for the update. :D

    I would like to suggest one feature, if there was a /silent option instead of omitting the permission to view the report, that way you could add /silent at the end of generations you didn't want reported in game, only on the console.

    EDIT: 2.5 seems to be on verbose all the time.
     
  25. Greetings, just a quick question: Are you gonna update this? The last activity was quite a few days ago, but we would love to have a nice, round-shaped world map.
     
  26. Offline

    Nephyrin

    Hiramas: Yes, I'll be updating this to support the latest RB whenever one is pushed. I haven't tried it against 1.0.0 snapshots but I'll test it out and make sure there's no issues later today
     
  27. Offline

    Nephyrin

    @Hiramas - I just did a (very) quick test and I see no problems with this addon and release v1.0.0. I'll be updating it to match any recommended builds, but v2.5 should work fine until then.

    @Lakart - I fixed the always-verbose bug in git (oops!) and will look into a better way to tone down the spam for v2.6
     
  28. When I tried to set up a server (just perms, essentials and this plugin) I got some major error with word like "chunk" and "generate" in them, so I assumed it was this plugin. I will try again ;)
    Thanks
     
  29. Offline

    EdgarsErnsteins

    After you generate world does it shows up on the Dynmap?
    Not for me.. ;(
     
  30. Offline

    Chaznuts

    It should show up on dynmap AFTER you do a "/dynmap fullrender <yourworld>"

    Since it's not actually placing or destroying a block, it doesn't automatically trigger dynmap to render.
     
  31. Offline

    Chaznuts

    This plugin doesn't seem to be working properly since MC 1.0.0. It use to be really smooth and efficient, but now it uses up a lot more memory, goes extremely slower, and is also filled with lots of errors at times. I hope you're aware of this and can fix it. If needed, ill post a log. Thanks :)
     

Share This Page