Legacy GM Creating a building game; when I construct a room next to a hallway, how can I create a doorway?

M

mrjonwc

Guest
I'm creating a tycoon-like game with different rooms, hallways ect. Now say if I construct a room next to a hallway which are both side by side (separate objects), how will the room object know and create a doorway leading to this hallway object?

I can not figure this out for the life of me! Maybe someone can give me an idea, thank you!
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
A lot will depend on how you are generating the rooms and room spaces. Personally, I'd keep track of everything using a DS grid that is the size and resolution of the room. So, when you place a room, for example, you set a region of the grid to 1. When you set a corridor you set a region of the grid to 2, etc.... NOW when you are setting these things you can easily check the values of the grid squares around the edges and see if any of them match a room area, and if they do you can select a position along that edge to add a door.

I would even take this further and say that there is not even any need for instances with this setup, as you can simply set DS grid values, then add tiles for walls and floors, etc.... only using instances for interactive stuff like the doors. VERY efficient (my game skein has NO wall objects at all.... it's all just tiles and a ds grid!).
 
Top