[WGEN] The Dungeonator - A Procedural Dungeon Crawl Generator [v0.0.3 Preview Now Available!]

Discussion in 'WIP and Development Status' started by Timberjaw, Feb 26, 2011.

  1. Offline

    M1sT3rM4n

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Now fill the bottom with lava. We just created a parkour game type! Whoever reaches the end first wins 2 diamonds.
  2. Offline

    dak393

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Instances are impractical for minecraft servers the stress on a server of generating a new dungeon per group would be huge. Seeing as all dungeons would exist in the same server you would use a lot of space and resources. You could possibly generate multiple dungeons in the world (or another world) and have it teleport you randomly to one when you enter the entrance (or press a button). Also look into Phatloot and dungeonreward for dungeons :)
  3. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Sadly, those pillars are each ~16 blocks away from each other. But that does give me some ideas for dangerous dungeon rooms...
  4. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Does this use the same method as Afforess' inventory API?

    Also, I think, you have modified the wrong Provider.

    You should just override the Generator, not the full chunk provider. I think that may help with lighting.

    You need to use this class as base.

    This is a generator chunk provider.

    I assume you are doing something like

    ((Cast to Minecraft)(getServer().getWorlds().get(0).getHandle()).chunkProvider = yourProvider

    I think

    ((Cast to Minecraft)(getServer().getWorlds().get(0).getHandle()).chunkProvider.chunkProvider = yourProvider;

    will swap in your provider, but only for world generator.

    In the main chunkProviderServer class, the chunkProvider variable points to the "backup" chunk provider which is used if disk loading fails.
  5. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm not familiar with the inventory API.

    I based mine off that class and the ChunkProviderHell class (Nether counterpart to ChunkProviderGenerate class, as best I can tell).

    I'm using ((CraftWorld)world).getHandle().chunkProviderServer.chunkProvider. Not sure which of your examples that's equivalent to.
  6. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hmm, actually I think that is what I was suggesting.

    So much for that theory.

    I would have thought that it would get lighting right.

    I wonder if the issue is that lighting is easy in the standard world. Everything below ground is full dark and everything above ground is bright.

    Does the dungeon start out as completely bright or completely dark?

    There are 2 passes in generation. First is places basic blocks and then decoration.

    It doesn't call decoration until the block is is bordered by other chunks in 3 of the 8 directions (I think it is N, NW and W).

    Lighting updates might happen during that pass.

    Also, on the spawn thing, you could just move the spawn location to 1000x1000 or something :).
  7. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It is the same trick, change one of the internal CraftBukkit variables.

    He is using it to replace the packet send/receive class. This allows him see inventory updates (and block packets if need be).
  8. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Raphfrk The 'dungeon' is currently open to sunlight (it's just a flat layer with no ceiling).

    I'm pretty sure the lighting is actually calculated initially from within ChunkProviderGenerate, so one of those umpteen obfuscated method calls is preparing the lighting (I think).
  9. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Notes to self:
    Lighting data is currently stored in two NibbleArrays: Chunk.f and Chunk.g

    Chunk.f = SkyLight
    Chunk.g = BlockLight

    I'm not yet clear on the difference. I think SkyLight is the light on the top block in each column. If the exact names change, they can be found again in the ChunkLoader class (hooray for NBT references which can't be obfuscated!).

    Values are set with NibbleArray.a(int i, int j, int k, int l)

    Chunk.b() seems to set the SkyLight data.

    BlockLight data seems trickier. Chunk.a(EnumSkyBlock enumskyblock, int i, int j, int k, int l) is the only place I've found so far where it's set, but I don't know what the whole EnumSkyBlock thing is yet.
  10. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Sky light is the strength of the Sunlight. Block light is the light from torches etc.

    The actual light for a block is something like

    (brightness * skylight) + (block light)

    brightness depends on the time of day.

    This means that the client can quickly adjust as the day changes. The server doesn't need to recalculate the light level as the Sun sets.

    It just sends a brightness update.

    It is only affected by block light sources.
  11. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Just for kicks, here's the current v0.0.1 (Flatland) build: Dungeonator

    A few notes:
    1. Per the name, it's completely flat. There's nothing there. Just endless flatness. Enjoy.
    2. You will die the first time you spawn. Don't panic. Respawn and you should be ok.
    3. DO NOT install this plugin on an existing server with an existing world. It WILL overwrite it immediately, horribly, and permanently.
    4. Your console will be flooded with debug info. This is normal.
    5. Side effects may include the following: crashes, sterility, a new appreciation for plugins that do useful things, and death.
    HSAR likes this.
  12. Offline

    Adondriel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    If you make it not spam the console, it would be a great creative server!! lol can't wait for the rest of it!
    EDIT: How far are you on the actually cave/dungeon generator? :D
  13. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This is what you get for flatworld:

    [IMG]
  14. Offline

    Adondriel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I see that i have my server up right now.
    server nolonger up
  15. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Btw, if you don't like the spam, you could just generate an area once and then switch back to without the plugin.

    The generated zones would stay as they were.
  16. Offline

    Adondriel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Progress? lol i want to see pictures! :p
  17. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Adondriel raphfrk's picture above is the latest and greatest :)

    Will have more (or perhaps a video!) when the editor is working.
  18. Offline

    dak393

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Great, can we expect this awesomeness soon?
  19. Offline

    TuRmoiLxx

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This would be amazing.
  20. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @dak393 'Soon' being a wholly relative term, yes ;)
  21. Offline

    mindless728

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    so is that soon as in Valve time or soon as in Duke Nukem Forever time
  22. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @mindless728 That's soon as in PSN will be back up soon.
  23. Offline

    dak393

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    XD o crap
  24. Offline

    Adondriel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Could you add like a progress bar to the thread? like
    [0000][0000][0000][0000][0000][0000] - each one standing for a different version?
    so it would be like
    [0000][0000][0000][0000][0000][0000] - each 0 being 1/4 of the completion? :D :p
  25. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Adondriel Good idea. I opted to just show % completion under each item.
  26. Offline

    Adondriel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Ok less complex i guess.. and informative! :) :p
  27. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Generating two layers at the bottom of the map prevents the fall-through on first spawn, so that's that taken care of. Thanks to @Raphfrk for the tip.

    I'm working on the editor as promised, as well as rewriting a bit of the chunk code to support multiple layers. Basically, I'll be dividing each chunk into 16 horizontal slices, each 8 blocks high. This complicates the code somewhat, but it will only get worse the longer I wait.

    I'm toying with the idea of designating vertical ranges with different generation characteristics (e.g. lowest slice = bedrock and lava, highest 4 slices = overworld, that sort of thing).

    Needed a splash of color after staring at blank rock for so long:
    [IMG]
  28. Offline

    phondeux

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Do your chunks get decorated (tunnels, etc) or does all of this take place afterwards?
  29. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Btw, don't forget bedrock for the bottom for complete protection against fall through :).
  30. Offline

    Timberjaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    That's what I'm working on now (0.0.2 on the Roadmap in the OP). :)
    phondeux likes this.

Share This Page