• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Design Any ideas to improve my map generation?

Reign

Member
There are so many options out there I couldn't decide, but I eventually settled on a method being similar to the binding of Isaac and Zelda. I make the rooms by hand with my custom map maker. I then randomly pick a few out of many premade rooms from a file to fill the map and add the doors as I generate the path.
I really want better looking maps than BoI though and am trying to find ways to accomplish that.

One problem I've always had with Zelda and the binding of Isaac is that the perspective makes no sense and I wanted to correct that. The view is top down for the map, but the side view of player makes him look like he's laying on the floor. I've been trying to find ways to do it in a 3/4ths bird eye sort of view, but it's difficult to show where the doors are, especially if I make the walls 2 tiles high and having a hard time making it look nice if the walls are 1 tile high.

The other problem I'm having is that I would like the doors to move so that they are not always in the center, but I'm not sure how I can accomplish that. Like if I know a door has to be on a specific wall when generating the path, I could slide its position along the wall, but would be weird if the doors don't line up in each room? and how could I prevent the door from being blocked? should I separate rooms into categories based on where the doors are pre-placed? (like L shape, + Shape - Shape, etc).
Or, do I just keep the doors in the center of each wall and improve in a different way. I've been thinking maybe I can have larger more unique rooms so the doors being in the center is not as obvious, but smaller maps.

Whether I keep doors in the center or not, right now I just replace the wall tile with a floor tile and remove collision when adding the door. This means I have to have a path leading to where the door might be when designing a room. This is a big hinderance far as making rooms look and feel unique, because it restricts me to only ever making the corners a unique area like adding water in the picture I attached.

Any thoughts?
 

Attachments

Morendral

Member
Why not have some rooms that connect at certain places, then restrict is neighbors to one that fits the options given. For instance you could have a room that connects only in the top middle and right bottom, they spawn a room next to it which only connects in the bottom left. Either that or take the blue ball machine as inspiration.
 

Reign

Member
@Morendral I'm not sure I understand what you're suggesting. The grey box at the top left is actually a mini-map of all the rooms in the map and numbers represent the order the rooms were generated in. The order and position of the surrounding rooms are what determines where the doors are and how many there are. Each room can have 1-4 doors in any of the 4 positions. What's blue ball machine?
 

Reign

Member
@Morendral That could work, but if I have more than one door on a wall I'd still need to resolve the other problem I mentioned, being how to make sure that the doors are not blocked if I place them anywhere other than in the center of the wall and designing maps with that in mind.
 

Reign

Member
@Morendral I mentioned previously my map generation already does that, that's not what I'm talking about. I'll attach a visual example. If you look, the door in the screenshot is inaccessible if it's anything other than center which only works because I design all the maps in a way so that if there's a door on any side it can connect to a walkable area so the player doesn't get stuck. This is one of the things I'm trying to find a solution for. Even if I found a way to add it somewhere other than center, would it be weird if the doors don't line up between rooms(like going in a door at the top right of a room and coming out the bottom left in the next room)?
If doors between rooms don't have to line up, than one solution I can think of getting around needing doors being in the center is, to iterate through the rooms map data and find the nearest position to the side of the room we want to add the door on that doesn't have any collision and more or less tunnel offscreen from that point. If they need to line up, I guess another solution would be to always make rooms square and never block off the area closest to the walls when designing the maps.

Not sure if anyone has seen the game Songbringer that came out recently, but the way they did their map generation is similar to mine. I'm watching a let's play of it for ideas.
 

Attachments

Last edited:

The M

Member
A simple solution would be to group rooms after where their doors are positioned (for example a door on the lower left side) then you could easily pick a room that fits but you would have to make a lot of rooms to keep the room pool varied enough. Another idea would be generating doors or replacing a sub section of a room with an exit. In the case of your example you would change the left side of the room to make the path go to where the door is. You could probably extend it to take the terrain into account (like making a side water with a bridge to match the next room's exit). I'm not sure how you would do that in practice though.
 

11clock

Member
Enter the Gungeon fixes this by doing away with the grid-based generation entirely in favor of connecting rooms through short hallways, making the hallways turn if needed. This also allows them to have rooms of many different shapes and sizes.
 

Reign

Member
@The M That's a good suggestion. I've thought about trying that before, but I'm concerned it will become too much of a hassle to organize all rooms by shape(L, T, -, |, +, etc), especially since I already organize rooms into categories (floor one, floor two, boss rooms, shops, etc). Extending the doors could work, but It would require a lot of checks to fix the tiles around replaced ones with walls and corners unless I simplify the maps to only being a wall tile and floor tile. Changing the door is a good idea too and can be done by checking the tiles you're replacing(i.e. if TileID==5 it's water). Could try even replacing the entire wall potentially, but it'd be hard if the rooms anything other than square.

@11clock Watching Enter the Gungeon gameplay now and I could see that working. The main reason I chose to make the rooms the screen size was primarily for co-op so that you wouldn't have to fight over the camera or split screens and it fits the retro NES theme I'm going for, but that is tempting. Need to weigh the pros and cons. The only con I can think of other than the co-op aspect is it would probably be less maze-like which means less dead-end rooms and those are what I use to determine what should be a special room like shop, puzzle, treasure, etc. Most of their rooms on average seem to be about the same size, so I could just make my rooms bigger and it'd be similar.

@Morendral I've considered doing that style of classic roguelike map generation because it's so simple, but I wanted to make the rooms by hand for quality control so that they look really nice and decorated. I do intend on selling this game when it's finished so it has to be polished.

I think the size might be a big problem with the rooms at the moment too, maybe they need to be a little bigger or square, but not sure what resolution to use. Was going with 640x480 until I read ppl complain about it not being 16:9. Now I'm using 640x360, but it feels like I don't have enough room to work.
 
Last edited:

Yal

šŸ§ *penguin noises*
GMC Elder
The perspective used in Binding of Isaac is over 700 years old, and it's still used for a reason (we usually look at the terrain around us from above because the ground is flat and grass is short etc; we usually look at other humans from the sides unless we're basketball players). Wouldn't really say it looking weird is enough reason to get rid of it, it's still very relatable.

BoI basically has every room able to work with any door layout, doors are expected to be placed at every wall in the same spot except when the room is at the edge of a dungeon. Doors not being there is the exception, not doors being there, so every room is designed expecting a door to be there. If that approach doesn't feel right for you, you could always have an approach where, if a door is spawned in front of an impassable tile, you override layout cells with plain ground until the cell in front of the door is connected to a region made from normal ground. It has the potential to look weird, but it means stuff always works. Or you could take the approach that if a door is unreachable with the selected layout, just select a different layout; keep going until you find one that works. Could cause extra lag but lets you do wierd combinations (e.g. half room is water tiles) without really worrying about plausibility, even when doors are randomly placed and not always in the same spot.

One approach I used in my dungeon generation engine that I'm kinda proud of is to possibly flipping room data horizontally or vertically... that means that every asymmetrical layout actually provides 4 different layouts depending on the mirroring variables. (Obviously you'd only change tile data this way, not actually rotate the objects). Since this doesn't change room height or width, the data works even if your rooms are non-square. You can also semi-trivially do this in GM rooms (if you use those for your dungeon rooms) by some code like with(all){x = room_width-x; y = room_height-y;}

Anyway, the main benefit of this approach is to reduce boilerplating: once you make a cool layout, you get 4 different versions of it; it spreads out your reused asymmetrical layouts so the player won't realize the same few appears over and over, and you don't need to make 4 different versions for things you would want to have multiple rotational versions of.

Another useful technique: recursive randomness. Designate room regions for things like "3x3 tile decoration object" and then pick a random object from a list, possibly by some conditions. For instance, in a jungle biome that room might have a tree or a statue, in a lava biome it might be a lava puddle, and so on. Having multiple different variants can keep the level feel different, too. Perhaps there's a chance the object that gets spawned is just a pile of rubble without a collision mask, which changes the room's gameplay parameters (suddenly there's this 3x3 tile normal ground here instead of a wall!). You could spawn enemies completely unrelated to what obstacles there are in a room. Some obstacles might be replaced with breakable equivalents. And so on. The more things you can change in each instance of a room, the smaller the chance the player will feel like they experienced the same room twice in a row. It's super-easy to implement this with random tables, too.
 

Reign

Member
@Yal The perspectives both work on their own and look great, I just feel like they're inconsistent when used simultaneously. Suppose it's not enough reason to rule it out, but might be interesting to try the Zelda/BoI formula with a 3/4ths view if I can make the doors look right on the side walls.

Designing rooms with the chance that doors might be in the center on any wall like BoI is how I have it currently and I'm tempted to stay with it because it's reliable, but I think it would be a big improvement if doors didn't have to be centered. I like your suggestions, will have to think about it.

Your dungeon generation engine looks good! I saw on your page that all the rooms are in one GM room. How did you go about only updating enemies in the room that the players currently in?

Haven't really considered recursive randomness, that's an awesome idea though. Definitely going to try that.
 
Last edited:
Top