I have a map that is full of 4+ rooms each with one randomly selected door on one of its sides. I need to create a tunnel connecting all of the doors together. I'm not sure the best way to do this A* seems to complicated for me to do at the moment and I cannot think of a way to connect these rooms. Any suggestions on how I should do it?
My world is currently a vector<vector<Tiles>> and the tiles contain entities like tunnel, wall, stair, floor, etc.
Sounds like typical roguelike tunnel carving. After you have your rooms, just start "carving" out tunnels from one room until you run into another one (or another tunnel).
The concept is pretty simple:
1) Start at point X,Y (in one of your rooms)
2) pick a random direction
3) pick a random number of spaces to move (N)
4) carve out N walls in that direction, starting with X,Y
5) repeat from step 2
Stop when you connect with another room, or another tunnel (but be careful not to stop if you run into the origin room or the tunnel you're currently carving, or else you'll end up with isolated rooms)
Make sure you don't go out of bounds of your map.
The "random" can be biased to make the maps a bit better. For example you might want to give your tunnels an 80% chance of choosing a direction that heads them towards a target point (another room you want to connect to), and 20% chance of going the "wrong" way (away from the target point). That'll give the tunnels a more of a zig-zaggy feel, but still having an overall direction.
It is like your picture above, the rooms are connected to at least 1 other room. But those 2 rooms may be isolated from the rest of the dungeon. How can I get those isolated sets of rooms to connect with the rest of the dungeon.