Hello all,
I have been stuck on this problem for about 2 weeks, and I think I have hit every brick wall possible, so alas find myself here. I am currently creating a 2D rogue-like game (c++) with map elements not to dis-similar to the game Rogue Legacy. The level map is comprised of different rooms of different sizes that have entrances/exits to rooms that are adjacent. It's a little hard to explain, but hopefully this picture of Rogue Legacy which shows the game map will help.
And here is a crude paint drawing (where green arrows are entrance/exits)
Currently I am generating a map using a modified pathfinding algorithm which gives me my desired layout of rooms.
I currently run the map generation store the rooms in a 2D array. Once all of the rooms have been generated, I then run through the array and place portals (entrance/exits) in the relevant rooms and set their destination room.
This works perfectly at the moment, where all the rooms are the same size. However adding larger rooms that can have more than the standard 4 portals (Left,Right,Up and down) is turning out to be a little tricky, as I am having trouble calculating the destination room and/or the position in that room.
Any help would be greatly appreciated, if you need anymore information just let me know :).