[ADMN/WGEN] Spade and TerraBukkit - Terrain Generation Plugin and an API [766]

Discussion in 'WIP and Development Status' started by N3X15, Mar 28, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    So I've been in the terrain generation business in Minecraft for quite some time. I originally created MineEdit, an inventory editor that had the first terrain generation system ever implemented outside of Minecraft itself. I've stopped working on MineEdit, because it's grown into a bunch of Spaghetti code, but I have always been looking for ways to re-introduce the ability to generate custom terrain on-the-fly in Bukkit so people can define their own worlds.

    Today, I bring you news that I have succeeded in doing what Bukkit has struggled to do for ages.

    I have created TerraBukkit, a server patch that allows plugins to override the specified World's terrain shape generation system, the sediment population system (for dirt/sand/etc), the ore/tree/flower/lake populator, the cave generation system, AND/OR defer to Notch's existing solution.

    Here's some sample images using a sample plugin I created, called Spade:

    Flatgrass with Biomes​
    Mountains and Lakes​
    I'll soon be adding overrides to the plugin for terrain sediments, ores, and caves.​
    Developer Stuff
    To screw with worlds, you must call Server.createWorld with an overridden org.bukkit.ChunkProvider (see here for an example). The WorldChunkManager API (for Biome overrides) is not done yet, so pass a null for that parameter.​

    Jenkins Builds (UNSTABLE, WIP, ETC)
  2. Offline


    FINALLY someone did something like this!

    Will you make a configuration plugin for this, too?
    Maybe you could use some ideas and ressources from older mods like Wickety's Terrain Tweaker or Kadde's Ore Redistribution Mod.
    I had a thread about that somewhere, let me search it...
    Ah, here it is: Thread
  3. Offline


    The plugins handle configuration. Most of what I'm doing is the API.

    Spade provides sample configuration in plugins/Spade/Spade.yml

    Fixed Mountain generator. Here's the old version, new version posted at the top.​

    Some more pictures from my mountain world:


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


  5. Offline


  6. Offline


    So this runs alongside craftbukkit or replaces it entirely?
  7. Offline


    I suggest you work with the Bukkit devs to get this integrated into Bukkit - it's exactly the terrain generation system the now-defunct generator branch was going to provide and that I'll soon need for certain shenanigans.

    Excellent work!
  8. Offline


    Awesome work =)
  9. Offline


    Replaces entirely, I had to implement a few things to get the plugin to work.

    I'm slowly patching it to a state that Bukkit devs will approve of (gotta remove 5000 "fuck"s, for example :V)

    Updated to 600+ for shits and giggles.
    phondeux likes this.
  10. Offline


    That was my next question, thank you for making this! I want to make a simple plugin that after X distance from spawn turns the chunk entirely to air. The idea is;
    [spawn] <------ world ------>|<----- [air] -----> [enforced border]
    So instead of players abruptly running into an invisible wall they will instead come to the literal edge of the world.
  11. Offline


    You know if you made it read from a configuration file you could use this to entirely replace the BiomeTerrainGenerator mod that is being worked on over at minecraftforums.net.

    That said, I've been trying but really have no fucking clue what to pass to this to get it to generate terrain. I want to make a world generator that makes terrain like something out of a Roger Dean painting. I don't understand how it could possibly be done though as you're developing the world 16x chunk by 16x chunk. What happens if a world object exceeds the size of the chunk? Hell, I have no idea how the regular game does it, does it look back at adjacent chunks and determine where it should put its sand, etc? I see the generateChunk gets the following;
    (Object world, int X, int Z, byte[] abyte, Biome[] biomes, double[] temperature)
    The value for world is obvious, X and Z are the chunk, correct? What the byte array, the values for the chunk referenced?

    I've been looking through your source at the flatgrass provider which helps, but much of what it's doing is a mystery; what is a template?
  12. Offline


    abyte = array of blocks in the chunk (16*16*128 in size). getBlockIndex(x,y,z) will get you the index.
  13. Offline


    I suspected that; the array starts at the bottom of the world and goes up, right?

    How do you create world objects that are larger than 16x16 x z? I thought about making an elaborate setup that would create the objects first and then if an instance of them is created to copy out a block array as needed. Is there another way?
  14. Offline


    this is awesome! :D nice job!^^
  15. Offline


    I'd like to see something where it just has an api that I call for chunks and biomes, nothing more. I'd like to be able to integrate http://www.minecraftforum.net/viewtopic.php?f=1022&t=203248 (pymcworldgen) to both server and client, and this seems like the perfect thing for the server portion.
  16. Offline


    I'm really looking forward to this. I've been using the Biome Terrain Mod on my server for a little while now, but it's not currently compatible with bukkit 677. This seems like a potential substitution.

    I'm definitely keeping an eye on this.
  17. Offline


    Looking forward to an update for 1.5.
  18. Offline


    Updated for 684. Waiting for 1.5 RB before I go and break everything.
  19. Offline


  20. Offline


    Is there anyway to configure this to create an endless ocean?
    gsand likes this.
  21. Offline


    I have something like that on my server.
    PM me for the address.
  22. Offline


    Well, not really at the moment, but I'll tweak the Flatgrass generator to do that.
  23. Offline


    Hi, would you please post an example of a spade config file?

    preferably with the flat grass provider.

  24. Offline


    Does the Flatgrass generator generate ores? I want to use this plugin to make an ocean world where my users can build their own islands, and then play survival on the islands. I could probably edit the Flatgrass generator myself actually, I have some coding experience.
  25. Offline


    Yeah, it can. However, the island generator is currently the most mature, as we use it on our production server.

    # Spade Configuration
        world:  # This is your primary world.  Do not change it.
                name: stock
                name: stock
            chunk-provider:      # Chunk Generator
                name: islands    # Select from the list of chunk providers here: http://mine.7chan.org/wiki/Spade
                config:          # Any configuration for the chunk generator goes here.
            chunk-manager:       # Biome generators (not done yet)
                name: stock      # Defer to Notch's
            limits:              # Broken
                enabled: true
                round: false
                chunks-from-spawn: 100
  26. Offline



    I was really confused and kept typing the full names of the chunk providers and kept getting errors.
  27. Offline


    The only generator that seems to work for me is "doubleperlin". I tried "wat" and "islands", but they had errors on startup, and "flatgrass" starts generating chunks, or at least reports that it's generating chunks, but has an "OutOfMemoryError: Java heap space" after generating chunk (156, -71).

    Also, it looks like flatgrass does nothing. abyte gets assigned template's reference, so it has no connection to the outside of the generateChunk method.
  28. Offline


    This seems awesome :D
  29. Offline


    I am having the same problem. Flatgrass keeps generating chunks nonstop (does not even appear to generate valid ones) until the process hits the set memory cap. (ala the heap full error). Only doubleperlin seems to work. The rest error on start (except for mountains2 enabled via source edit) which errors out after generating about 100 chunks in the same nonstop run-away manner as the flatgrass generator.

    On an unrelated matter; what plugin are you using to get around to the different worlds? On my stable server I use multiverse but when I tried it here I ran into issues. First; if multiverse loads the world spade won't generate chunks in it. Second; if spade loads the worlds it shows up in multiverse but you can't reach it via multiverse methods.
    EDIT: This was fixed by forcing Spade to the top of the load order and having multiverse load after (and load the world).
  30. Offline


    /tpw worldname is the command to go to each world's spawn.
Thread Status:
Not open for further replies.

Share This Page