Randomly Generated Maps

I am looking to create randomly generated maps, dungeons, etc. Similar to what you would see on Diablo, Path of Exile, Torchlight, etc.
Can anyone point me in the right starting direction, as of now I don’t have any idea about how to do this.

there’s a few threads explaining with different approaches, just search around. a few provide code as well, while some of the latest ones offer the promise/possibility of a Marketplace release

I made such a system in UDK (eventually will redo it in UE4) and the main advantage was that I was spawning prefabs, which provided maximum artistic control (as I could make rooms by hand with all kind of props and items on them)