Has anyone here made any form of random map (dungeon) generator? I need one for a RPG I'm writing and I'm not entirely sure where to start with it in order to create rooms and halls that are at least somewhat realistic (not turning every which way and such).

I don't want someone else's script for this and I don't want to rip code from another script. I'd just be interested in pointers or ideas in how to accomplish this (not an entire script).

For example, would it make sense to randomly cerate the rooms themselves and then create paths from the door on one to the door on another? And then make interconnecting paths somehow?

Or is it better to create a room and start from one door and just start making a path and randomly add a room as I go along that path?

Or something else?

I have the item generator completed (tho I want to add to it and improve it a bit... it does have hundreds of thousands of possibilities, though), basic character creation with randomly (realistically) generated age, heigh, weight for the character completed, basic battle system (non magic so far) done and some various other things done.