Well, experimenting is the best way to know for sure, but I'm guessing there is a time limiting factor if the project is for a degree. If you can, I would suggest trying whatever way seems the best/most-intuitive way and see what happens.
Quick disclaimer: I have not made a game like "Fallout Shelter" and I primarily do 3D game development, so please take what I wrote below with a grain of salt! Especially since this is part of a degree, it is important that you do make development decisions and choose what works best for you and your experience.
From what I can gather, it appears that the rooms in "Fallout Shelter" are arranged in a grid with a width of 8 (plus at least a single elevator). I do not know on the height, but I would haphazard a guess that it has a finite limit, probably something large like 64. From what I can gather, the all of the connections happen on the horizontal axis, so that is the more important of the two axes.
With this in mind, the issue primarily becomes storing rooms and knowing whether a tile is occupied by a room or not.
From what I can tell from looking at screenshots of the game, it appears rooms can be 1-4 grid units in width, with a constant size of 1 grid unit in height. This means you'll need some way of placing, storing, and managing rooms of all different sizes.
For this, I would recommend making a two-dimensional array populated the IDs of the rooms (or lack thereof) in the game, creating a grid of sorts. Then when you spawn a new room, you create a new ID and populate the two-dimensional array at the coordinates with the position of the room in the grid. Then you can check against this two-dimensional array to detect whether a room is located at a coordinate. You could also write code that takes a 2D coordinate and converts it into an index position in the grid and vice versa, both of which could be helpful later.
Here is a pseudo example of what the grid contents could look like:
# 0 = empty space, 1 = elevator, 2 = room_one, 3 = room_two
# 4 = room_three, 5 = room_four, 6 = room_five, etc
"""
22210001
00013341
05516601
"""
Then for adding new rooms, you just need to do a simple AABB check with the coordinates of the new room and the size of the room, and check that against the two-dimensional array. Then you can determine whether a room can be placed or not. Each room could be its own object that handles things like connecting to other rooms using the multi-dimensional array/grid.
For the actual storage of the rooms, you could just use a list and have the index position of each room in the list as the ID used in the two-dimensional array. Then something like this could be used to retrieve rooms:
var map_data = [
[2,2,2,1,0,0,0,1],
[0,0,0,1,3,3,4,1],
[0,5,5,1,6,6,0,1],
]
var rooms = [
null, elevator,
room_one, room_two,
room_three, room_four,
room_five,
]
get_room_at_coordinates(x_coord, y_coord):
var room_id = map_data[x_coord][y_coord]
var room = rooms[room_id]
return room
That is just an example. That is one way you could do it, if you have rooms of varying widths. There are other potentially better ways, but that is probably how I would approach the problem if I was working on a game like "Fallout Shelter"
If all rooms are the same size, then you can probably just store them in a simple multi-dimensional list, where each coordinate represents a different room (or lack thereof). Checking adjacent rooms would just require adding/subtracting one from both the X and Y axes, and overlap detection would just be checking if a item in the multi-dimensional list is occupied or not. If you do not care that all rooms have the be the exact same size, I would highly recommend going down this route, as everything becomes easier with a uniform grid with everything only occupying a single coordinate.
From what I can tell "Fallout Shelter" has rooms of all different sizes, meaning some form of overlap detection and storage is required. If you are trying to stay as true to "Fallout Shelter" as possible, then you may need something like what I wrote above.
If the game is simply a 2D stack, where rooms are stacked on top of one another without any variation on the X axis, then the issue becomes a lot easier. You can use a list and store the ID of each room as the value within the list. Then adding/removing rooms is simply knowing the index position of the room within the list, and removing it. Likewise, checking for adjacent rooms only requires adding/subtracting one from the index value of a room.
Finally, and I cannot stress this enough: You will need to experiment and find what works best for you. While I, and others, can give advice and suggestions, it is important that the project reflect you, your experience, and that you understand how it works. If you have an idea on how to achieve what you want, then go for it and see how it goes! From my experience, that is the best way to learn and expand what you know.
As I mentioned earlier, please take what I wrote above with a grain of salt, I have not done something like this before so a lot of what I wrote is based off previous game development experience and speculation.
Regardless, I hope this is of some help and gives you some ideas on how to go about it.
Best of luck with your project! :smile: