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

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

    dak393

    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 :)
     
  2. Offline

    Timberjaw

    Sadly, those pillars are each ~16 blocks away from each other. But that does give me some ideas for dangerous dungeon rooms...
     
  3. Offline

    Raphfrk

    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.
     
  4. Offline

    Timberjaw

    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.
     
  5. Offline

    Raphfrk

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

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

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

    Timberjaw

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

    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.

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

    Raphfrk

    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.
     
  8. Offline

    Timberjaw

    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.
  9. Offline

    Adondriel

    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
     
  10. Offline

    Raphfrk

    This is what you get for flatworld:

    [​IMG]
     
  11. Offline

    Adondriel

    I see that i have my server up right now.
    server nolonger up
     
  12. Offline

    Raphfrk

    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.
     
  13. Offline

    Adondriel

    Progress? lol i want to see pictures! :p
     
  14. Offline

    Timberjaw

    @Adondriel raphfrk's picture above is the latest and greatest :)

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

    dak393

    Great, can we expect this awesomeness soon?
     
  16. Offline

    TuRmoiLxx

    This would be amazing.
     
  17. Offline

    Timberjaw

    @dak393 'Soon' being a wholly relative term, yes ;)
     
  18. Offline

    mindless728

    so is that soon as in Valve time or soon as in Duke Nukem Forever time
     
  19. Offline

    Timberjaw

    @mindless728 That's soon as in PSN will be back up soon.
     
  20. Offline

    dak393

    XD o crap
     
  21. Offline

    Adondriel

    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
     
  22. Offline

    Timberjaw

    @Adondriel Good idea. I opted to just show % completion under each item.
     
  23. Offline

    Adondriel

    Ok less complex i guess.. and informative! :) :p
     
  24. Offline

    Timberjaw

    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]
     
  25. Offline

    phondeux

    Do your chunks get decorated (tunnels, etc) or does all of this take place afterwards?
     
  26. Offline

    Raphfrk

    Btw, don't forget bedrock for the bottom for complete protection against fall through :).
     
  27. Offline

    Timberjaw

    That's what I'm working on now (0.0.2 on the Roadmap in the OP). :)

    Room Editor with border and corner hinting:
    [​IMG]

    Room Editor with border, corner, and doorway hinting:
    [​IMG]

    Center doorways are 4 blocks wide. Secondary doorways are 3 blocks wide. Note that this represents the maximum doorway size for each doorway location; in practice doorway and passage sizes will vary somewhat.

    As always you can see all the Dungeonator images in the imgur album.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
    phondeux likes this.
  28. Offline

    Adondriel

    That looks difficult to code... lol i cant wait to see this in a giant cave!
     
  29. Offline

    Timberjaw

    @Adondriel This is the easy part; it only gets worse from here ;)
     
  30. Offline

    Adondriel

    lol, i guess that's true but the other thing is, once its done, it will be EPIC :D lol
     
Thread Status:
Not open for further replies.

Share This Page