I'm creating a Roguelike and I'm having constant troubles with map generation, it's just something I have a lot of difficulty wrapping my head around.
I currently have my map as a 50x50 square of tiles, which is then cut up into a 6x6 grid. The grid resembles as follows
+---+---+---+----+----+----+
| 1 | 2 | 3 | 4 | 5 | 6 |
+---+---+---+----+----+----+
| 7 | 8 | 9 | 10 | 11 | 12 |
+---+---+---+----+----+----+
etc etc up to 36. I can generate perfectly an identical room into each of these map sections but what I'm actually concerned about is filling a small number of them and connecting them.
Is there a known approach to this? Currently what I'm doing is just looping through the sections, taking a 50/50 coin toss and making a room there but I'm unsure how I can tell where to make paths, what if I have my map set out as follows
+---+---+---+----+----+----+
| 4 | | | 1 | | |
+---+---+---+----+----+----+
| | | | | 2 | |
+---+---+---+----+----+----+
| | | 3 | | | |
+---+---+---+----+----+----+
How do I intelligently map between 1 and 2? How do I map between 2 and 3, much less how do I map between 3 and 4?
I'm very new to game development, so please excuse me if this is a silly question