• 2D
  • Am I on the right track? (Connecting rooms)

Hi, I'm making a dungeon crawler like The Binding Of Isaac, and I would like some advice to know if I am on the right track with how I approached doors that connect each room.Since I use a Tilemap to generate rooms, I can't add functionality to a tile such as a door tile with a script that handles moving between rooms. Only collision works with Tilemaps and tilesets. So, I made a door scene that is instanced with the script I want and it works well. My concern is if my way of having instanced doors in my scene tree is inefficient or messy, because it gets the job done but when I look at the remote inspector and check the scene tree, I have a bunch of idle door nodes that are literally only there to tell my world which room it should teleport the player to when he touches it.[img width=623 height=665]http://i.imgur.com/cJL2rmE.png[/img]I only generated 3 rooms with 1 door each, but when I start implementing multiple branches with rooms, this approach seems inefficient.[img width=750 height=561]http://i.imgur.com/TUHpVag.png[/img]I know that another way is to only render the current room so that I only have 4 possible doors in the scene tree, but what if I wanted to have the whole dungeon rendered?

Hi,I am a beginner with Godot  G:my solution for doors...what use the Area 2D for doors and preload door node only when the player/camera is (the door is visible) close?so you should only have one node -the door (or a group of different variations of doors)

It shouldn't be particularly inefficient since there likely won't be thousands upon thousands of doors. Plus the physics system makes use of spatial partitioning, which helps deal with that kind of thing.The only other thing you could probably do if you really wanted to avoid having a lot of nodes is use a tilemap and tileset just to paint areas that are doors and have a Position2D at the center of your character sprite with a script that will lookup which tile you are on and transition you accordingly if you are on a door tile.But really, you shouldn't prematurely optimize. Don't try to make something potentially more complex/error prone in the name of efficiency until you see a definite performance hit.