Roguelike dungeon generator

Post your own tutorials, guides and demos.

Post » Mon Aug 16, 2010 3:12 am

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:





B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Mon Aug 16, 2010 8:20 am

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.

:)
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Aug 16, 2010 5:00 pm

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.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Mon Aug 16, 2010 5:13 pm

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

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Aug 30, 2010 12:16 pm

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

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?
B
2
G
2
Posts: 22
Reputation: 694

Post » Mon Aug 30, 2010 1:31 pm

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.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Mon Aug 30, 2010 8:56 pm

[quote="mandanceman":h9nwa7ha]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 :P).

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?[/quote:h9nwa7ha]

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.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Mon Aug 30, 2010 11:15 pm

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'?
B
2
G
2
Posts: 22
Reputation: 694

Post » Tue Aug 31, 2010 3:14 am

[quote="mandanceman":1nzcrxtl]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'?[/quote:1nzcrxtl]

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.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sat Oct 16, 2010 11:13 pm

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:
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: Megavolt and 0 guests