I'm relatively new to the mechanics of game development - catching up fast, but there are still some things that escape me. For example: generating a fully-accessible map on a 2d grid.
See the example at http://crawl.s-z.org. Each floor map starts with dozens of winding labyrinthine passages and randomly drops in points of interest - temples, boss lairs, bazaars, etc. I know there's a lot of factors that go into this: generating passages that always have at least one exit (no isolated tunnels in the walls), making sure passages have at least a one-cell-width wall between them and adjacent parallel passages, and dropping points of interest in such a way that they connect to the dungeon.
I've taken a shot at it, and it's very easy to ranomly place lines in a 2d matrix that represent passages - but they're never guaranteed to connect, and it's not nearly as elegant as the maps at the above example.
I suppose my question is, what do I need to know to reproduce the example at crawl.s-z.org? I know this is a large question - I'd be fine with someone handing me a link to a reference site and telling me to learn it there. I'm just new enough at this that I don't even know what terms to google - maybe there are names for different generation processes? Available techologies are JS (jQuery) and PHP, so a solution tailored to one of those would be ideal. Thanks!