Need help with random map/city generator

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Imaculata
Party member
Posts: 102
Joined: Mon Aug 10, 2015 2:51 pm

Re: Need help with random map/city generator

Post by Imaculata »

Image

So, I wanted to reopen this topic for a moment, to discuss some finer details of random maze building. I've expanded my dungeon builder a lot, to include all sorts of new room types, including secret rooms. But now that I have a full map in the sub screen, I noticed how much space often goes to waste. See the above picture to see what I mean.

The maze tends to be a big clumped together block, most of the time. I prefer that it looks more like an octopus. I like twists and turns, and dislike straight corridors. But when every corridor just makes 180 turns and folds back on the maze, it ends up being this massive block, with no space in between.

So I'd like to hear ideas to fix this.

One of the solutions I came up with, was to create "black-rooms". Basically, rooms that the crawler can't use. I could first run the main crawler from start to finish, and then randomly place black rooms adjacent to the main corridor. Then when I create all the extra corridors, they'll be forced to diverge more. This has however a risk attached to it, that they block off too many possibilities. Because the mini crawlers which build the extra corridors, have to start out from a room adjacent to the main corridor. If too many black rooms are placed around the main corridor, there isn't much space left to build more tunnels. This is especially a danger with small dungeons. Of course I should probably adjust the maximum number of black rooms based on the length of the main corridor to prevent this.

Another solution, was to simply build warps, that connect to a new floor (to fill in the extra space). The extra floor could have a boss battle and exit of its own.
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Need help with random map/city generator

Post by Rickton »

I think there's really two issues here that you're concerned with.
The first is the unused space, and I don't think that's really something to worry about, as long as the levels feel big enough. The player isn't going to know there's a huge unused section of the map, as long as the used section of the map is big enough (although it is kind of a waste of memory).

The second is that you want the levels to be more meandering. I think the "dark room" idea is a good one, but it probably won't solve the problem by itself. That said, try it out. A large part of procedural level generation is experimentation and seeing what kind of craziness your generator comes up with, because it's not always easy to predict what'll be fun.

Here are a couple of other ideas you might try:

Weighting what direction it'll take. Make it less likely to go into a room that is surrounded by other rooms, more likely to go into space that doesn't have a room yet, forbidding it from going back the way it just came, etc.

Forcing it to build straight lines. Have a random chance that each time you dig into a new room, it'll be part of a "tunnel" (maybe weight this to be more likely if you're facing out into the "darkness"), and the generator is forced to continue in that direction for X number of rooms before being left to its own devices. (Just reread your post and saw you said you don't like straight corridors, I think this could still be useful, just keep the distance it travels low)

One other thing, if your generator is allowed to have dead ends, make sure to put something interesting in them (treasure, miniboss, whatever). Going all the way to a dead end and back when there's nothing there is annoying and will make players think your game has bad level design.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
User avatar
Imaculata
Party member
Posts: 102
Joined: Mon Aug 10, 2015 2:51 pm

Re: Need help with random map/city generator

Post by Imaculata »

Yes, the latter is already taken care of. The game spawns treasure in the dead ends, creates custom dead-end room types for those rooms, and it gives priority to those rooms to lock them behind doors. It also creates short cuts near dead-ends, so you don't have to backtrack a lot.

The reason I'm cautious of long corridors, is because the game merges them into one long room. Now this looks fine as a means of getting rid of boring long rows of rooms in the same direction (it makes them look less out of place). But if you increase the chance of the crawler heading in a straight line, the game will spawn more of these long rooms, and it will look really weird. One or two long corridors are fine. But multiple right next to each other, is something I want to try and avoid.

The idea to weigh directions is a good one. I'll have to consider that.
Post Reply

Who is online

Users browsing this forum: No registered users and 225 guests