Roguelike dungeon generator

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • I've prototyped a simple roguelike dungeon generator in Construct, and thought I'd post it for informational purposes. I'm looking into different methods, but I like this one so far.

    I'd most likely implement it as pure data, without the visual creation, if I use it, since it can be quite slow with some settings. Also, the way that I implemented differing dungeon sizes is suboptimal, and can cause problems because of object scaling. I intended it for 40 x 30, and 80 x 60 sizes, though others may work fine, too.

    It can be easily serialized into an array, since I use strict boundaries on the size.

    It uses a simple scoring system to place rooms, with a user-set number of attempts, in order to avoid overlapping rooms. If those, or speed, are desired, use 1 or another low number.

    It digs corridors between rooms to make sure that all are connected, with a chance to wander around on the way there. This can be set to get quite different results. The more wandering, the longer it takes to create, though.

    Download the .cap from the attachment at the bottom of the post. This requires Construct v0.99.92 or later.

    Here are a few results with different settings:

    <img src="http://dl.dropbox.com/u/5868916/Images/shot1.PNG">

    <img src="http://dl.dropbox.com/u/5868916/Images/shot2.PNG">

    <img src="http://dl.dropbox.com/u/5868916/Images/shot3.PNG">

    <img src="http://dl.dropbox.com/u/5868916/Images/shot4.PNG">

    <img src="http://dl.dropbox.com/u/5868916/Images/shot5.PNG">

  • This is a very nice example Silent Cacophony.

    Seems like Dungeon Generators are the in thing at the moment. As usual I'm going to study this, steal all the best bits and implement them in my own version.

  • It's really the hot thing right now, and i love it! There are way to few good rougelikes, and i LOVE rouglikes. It's really good for the future to have a bunch of examples like this for this kind of games.

  • Holey Moley that's sweet as bro.

    I'll have to check this out tomorrow... for now its nearly 3am and I'm off to bed

    ~Sol

  • Hay, construct noob here. I'm picking up construct with the hope of making my own roguelike (looks like I came just on time too, it appears to be in fashion ).

    It says I need a different version though, I could only find .99.91 on the website, is there a beta version you're using or something?

  • Welcome mandanceman.

    The latest beta (unstable) version is always stickied at the top of the "Construct Discussion" forum.

    Have fun.

    BTW, nice generator SC.

    Krush.

  • Hay, construct noob here. I'm picking up construct with the hope of making my own roguelike (looks like I came just on time too, it appears to be in fashion ).

    It says I need a different version though, I could only find .99.91 on the website, is there a beta version you're using or something?

    Yeah, it was done with v0.99.92. I forgot to mention that. May as well go for the latest build that Krush mentioned.

    On another note, I'm going to write a Python version of this without the visual creation. I'll most likely just use a couple of simple objects and keep it to a fairly straight translation of this. Depending upon how much time I have (I'm extra busy lately), it should be done this week sometime, hopefully. This could be easily dropped into any existing project, and extended as needed to fit the game.

  • thank you sirs.

    edit: it appears to be software limited, is there a way to remove the limit to speed up the process? It seems to perform one process per 'tick'?

  • thank you sirs.

    edit: it appears to be software limited, is there a way to remove the limit to speed up the process? It seems to perform one process per 'tick'?

    Note that I said this was a prototype in the OP. The slow speed is caused by my use of sprites and such in the visual creation of the levels. They need to be updated every tick for something like this to work at all. So, I had to design two nested, 'for loop' alternatives that would run one iteration per tick, using groups.

    That is exactly why I'm writing a Python version of it, which will be just data processing, and should be quite fast. The result will be a Python object containing a 2D list and some other data. The list will optionally be able to be copied to a Construct Array object.

    This is not intended to be anything like a plugin. I'm rolling my own dungeon generator, and maybe some others might find the methods that I used useful. The Python version will have the advantage of being able to easily put into another project, and expand upon, for those who have learned a little Python, or just copy to an Array object easily for those who don't like Python.

  • Well, it's quite a bit later than I expected, but I finally got some time to rewrite this thing in Python. It's a fairly straight conversion of the prototype version, with a simple slider-driven interface wrapped around it to demonstrate it's possible usage.

    The sliders were given private variables with reasonable ranges for the parameters, which can be changed in the layout editor if need be. The actual acceptable limits of the parameters are commented upon in the script, and are not checked by it. The user should handle making sure that the parameters are within range.

    I'm uploading two files. Each has the same script defining the classes, but each uses it in a slightly different way. The first one keeps things simple and uses a Text object to display the level, and the second one uses a method to copy the level data into a Construct Array, and uses a Canvas object to display the Array data.

    Requires Construct v0.99.95 or newer. Attachments are below:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Kickass!

  • Top stuff mate.

    Really nice.

    Krush.

  • Glad you guys liked it. I'll likely be posting further examples and updates occasionally in this thread, as I continue my work on making a roguelike game.

    My next steps will probably be to make a Dungeon class to contain the levels, with a way to connect the levels to each other, and getting a character moving around within it. Not very difficult stuff, but my time is more limited than I'd like these days. Things like filling the dungeon with random stuff and creatures will follow, here.

    I'll also likely be cross-posting this project across different threads later, as I get to field-of-vision and line-of-sight examples, and other different topics that will crop up with it.

  • This is really cool. Are there any online resources you've looked at in producing your code, or is it all original? I only ask because I'd like to do some research on random level generation myself, and like the way yours works.

  • Hi. The code is original, but the ideas are not. For instance, the 'scoring' system for room placement has surely been done before. I'm unsure if the way that I connect rooms has been done like I have done it. It's just what I came up with when I thought of how I'd do it with Construct, and was originally based upon Construct's easy random picking conditions that were used in the prototype.

    I did do quite a bit of research on roguelikes a few years ago, but never got around to starting one back then. Here are a couple of sites that I would recommend checking out:

    http://roguebasin.roguelikedevelopment. ... =Main_Page

    http://www.roguetemple.com/

    I haven't had time to look this one over much, but it looks quite promising:

    http://pcg.wikidot.com/

    And if you can do newsgroups while avoiding the ridiculous spam, I'd recommend the roguelike development one. Here's Google's version of it (horribly spammed):

    http://groups.google.com/group/rec.game ... ent/topics

    I'll be slowly working on mine and posting new examples as I go, but it seems that I'll never have the time I would like to work on it.

    Good luck!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)