How to handle almost identical scenes

Godot Version

Godot 4

Hello my fellows,

I have a little dilemma, I’m working on a 2D game with procedurally generated level layouts, where I have a script to place premade rooms.

My dilemma is what’s the best practice to handle the rooms; as you can see in the image below, everything except the TileMap called “Room Art” and the SpawnPoints (which are simple Marker2Ds) will be identical between all the different rooms (so the walls, doors and the other Area2D is a player detector will always be there).


At first I thought about making multiples of this exact same scene and simply modifying the Room Art and Spawn Points to fit that particular layout but I can’t stop thinking that surely there is a better way to do it, I just don’t know it.

Any suggestions on how to tackle this challenge?

You could create a new inherited scene by right clicking a base room.tscn file. Then adding the tilemap and spawnpoints to each inherited scene.

1 Like