Make random dungeons interesting

"Randomly generated" is kind of a misnomer. While the "seed" from which the content generates is meant to be random, there needs to be rules that dictate how the level grows out of that seed.

So decide what you expect out of a level (the ingredients), then you need to design an algorithm/procedure/ruleset by which those ingredients fit together (the recipe) .

Simply saying each level will have an exit, chests, and enemies is about as useful as saying that a cake is made up of flour, sugar, eggs and water. If you just randomly throw each ingredient together, and do some random stuff to it, you will almost definitely not get a cake.

So start by breaking it down, every piece, into rules.

- Each level needs to be self contained (bound) by walls. 
- Each level will have one entrance, and one exit that must be 
connected
- Each room must be connected to at least one other room.
- etc.

For other content generation, like chests and enemies, you'll similarly create a set of rules. For any given level, there must be 'x' amount of chests relative to it's size or number of rooms. Or perhaps for every 'x' amount of enemies in a level, there must be 'y' amount of chests. The specific rules are entirely up to you. Absolutely everything can be boiled down to a set of rules, and it's all up to you. If you leave everything to an RNG you'll have a bad time. Balancing is absolutely impossible, level design will be garbage.

I'd suggest reading up on post-mortems and dev blogs for similar 2D procedurally generated games. There's some great videos out there for Spelunky and how they approach procedural level design. Also the rogue-like subreddit has lots of resources that will help you on your way, and there's the procedural generation subreddit as well, which is a bit more broad and advanced in scope, but has good stuff in the sidebar.

Best of luck!

/r/gamedev Thread