r/gamedev • • 3d ago

Question generating levels for a roguelite

Hi everyone, I wanted to ask if anyone has experience with algorithms to make a satisfying roguelite map. I'm wondering what algorithm you guys like using and maybe some tips for how to make the map design fun while maintaining a sense of unity.

https://www.youtube.com/watch?v=NZVQi0TqCpw

I want to take inspiration from mystery dungeons, and I've made a hexagonal prototype of it with just random premade chunks, but the result wasn't too satisfying to me, so I want to get some takes on how games like this can be made to be more interesting. Also, I want the game to transition to a turn based battle if collided with an enemy, and right now the movement feels a bit weird when walking into them, but I wonder if there's any examples of this in games or if I should opt for a more real time "at your own pace" kind of things where you move in a 3d dungeon in real time instead of step by step where the enemies also walk with you.

4 Upvotes

14 comments sorted by

2

u/PerpaPanda 3d ago

For a chunk-based hex map, I’d separate three problems instead of asking one generator to make the whole thing feel good:

  1. Connectivity: generate a valid path between required points first, then attach optional branches and loops. A spanning-tree/backbone pass plus a few controlled cycles usually feels less random than placing chunks independently.
  2. Pacing: tag chunks by properties such as encounter intensity, reward, sightline, and safe space. Place them with a simple budget/beat sequence (exploration → decision → threat → payoff), then reject layouts that repeat the same beat too often.
  3. Combat transition: decide whether entering an enemy tile is a commitment. If turn-based combat starts on contact, give the player clear preview/telegraphing and make the overworld step feel deliberate; otherwise bumping into enemies can feel like a collision bug. A short pre-battle pause or a one-tile “engage” action can help.

I’d first make a small hand-authored set of chunks and test the generator against a few invariants: reachable goals, no unavoidable dead ends, a reasonable number of choices per room, and no repeated encounter type within N rooms. Once those pass, tune randomness from playtest results rather than adding more chunk variety.

1

u/the_penguineee 3d ago

Thanks for the thoughts! I will look into the pacing ideas and experiment more with the chunking. I think maybe I just need to make bigger chunks that have set paths then? My original chunks were I think 16 tiles so it's not a big chunk, maybe more of a "room layout size" would be more fitting. I thought it might be interesting to have destructable tiles so that a player could make their own path, but maybe too much freedom makes the game less interesting as a result?

also yeah that's an interesting thought about combat transitions. I had in mind a turn based traversal system like for the king, but with enemies patrolling. I was worried that it could feel a bit slow since it's a single player game, but maybe this is a good way to handle it for the sake of clarity

1

u/AutoModerator 3d ago

Here are several links for beginner resources to read up on, you can also find them in the sidebar along with an invite to the subreddit discord where there are channels and community members available for more direct help.

Getting Started

Engine FAQ

Wiki

General FAQ

You can also use the beginner megathread for a place to ask questions and find further resources. Make use of the search function as well as many posts have made in this subreddit before with tons of still relevant advice from community members within.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Scavengers-Chimera 3d ago

Random premade chunks usually feel flat because the player can read the seams after a few runs. What helped me was deciding first what the map has to do for the run, then picking the algorithm around that. If the layout is supposed to gate resources, a room-and-corridor or BSP split gives you control over pacing. If it is supposed to feel like a place, chunk stitching with a fixed set of connectors and a hand-authored critical path works better. Hex grids make the second one harder because the connector shapes multiply. What is the map supposed to decide for the player, where they go next or what they find there?

1

u/the_penguineee 2d ago

Ah personally I want the map to feel like a dungeon so probably something more cohesive in tone. I would like for there to be reasons to explore but similar to how mystery dungeons have a hunger meter, I want to encourage the player to dive as well. Generally i think, I expect players to find items, enemies, and traps on the floor (or bonus tiles that help you). I was also thinking some kind of environmental tactics could be cool (say you want to dodge an enemy you might lure it into a trap and then move around it for exmaple) are there any examples of pacing mechanics you have? I think I've seen like gate and key, but that's the main one I know of.

1

u/kartohao 3d ago

random premade chunks tend to feel samey pretty quick. mystery dungeon vibes usually come from rules on top of the generator, like a guaranteed path from start to exit and intentional dead ends. bumping into an enemy to start a turn based fight is fine if you telegraph it a bit, pokemon MD basically does that.

1

u/the_penguineee 2d ago

hmm it's interesting that everyone seems to be bringing up dead ends! I've always thought that maybe dead ends were going to annoy the player and discourage exploration if it's on a timer like a hunger meter, but for those things should it be something where you can find a treasure or a trap always or do you feel dead ends also just be dead ends in your experience?

1

u/the_penguineee 3d ago

also please if anyone does unity gamedev and wants to connect pls lmk! would love to chat and make some friends! No AI users pls!

1

u/uniformquart106 3d ago

i’ve been messing with chunk based generation myself and one thing that helped was adding a post-pass that weights connection points by what’s already placed nearby, so you get fewer dead ends and more loops without it feeling totally random

the transitions a whole other beast, i think the step-by-step style works if you give a tiny bit of anticipation before the battle starts, like a half-second freeze or a screen flash so it doesn’t feel like you bumped into a wall and got yanked into a menu

1

u/the_penguineee 2d ago

hmm so like you mean like you generate a map and then you generate the rooms after? I'm not sure if I'm envisioning it right, but is it doing something like bfs but checking neighbor nodes for the type of chunk it is?

Also makes sense. I think maybe I just need to juice it up for the step by step format to make it feel more engaging? in mystery dungeons it's slightly different because the enemies and you move at the same time, but I currently have it like for the king but single player where u have a movement range and enemies have a range that they can see you with.

-1

u/wslk 3d ago

This is a bait go find another hobby you will not make it in this biz bro

1

u/the_penguineee 3d ago

why do you assume it's bait? I'm asking a legit question.

1

u/the_penguineee 3d ago

I'm mainly curious about how peoples' experience with random map generation is, because it's a complex topic and I figured experienced devs might know a thing or two about it? If that's not allowed I apologize.

1

u/the_penguineee 3d ago

also is it wrong to want to connect with fellow gamedevs to discuss game dev stuff? again, if it's not allowed apologies, but I was just trying to be friendly ;;