Is using tilemaps in instantiated scenes inefficient?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aquivion

Hello everyone,

I am currently using tilemap nodes for a 2D topdown pixel art game. Now i want to design mutliple different houses, each house having it’s own scene. All of these house scenes have a tilemap node which loads the same png (a png containing all the tiles for a house). Theses house scenes then get instantiated into the main scene.

I am questioning myself right now, if this might be inefficient.
For example: Is this tilemap data loaded multiple times into the RAM? Of course i would like to avoid, having the same png loaded multiple times into the RAM.

Are there other reasons why this might be inefficient? Of course I would have a lot of tilemap nodes, if each house in the game has its own tilemap. Would this alone be less efficient than having just one big tilemap?

Would it be better to build these houses in one bigger tilemap, containing all houses? If so, how would i add functionality to a house (e.g: hiding the roof when entering the house)?

Thanks in advance for any help :slight_smile:

:bust_in_silhouette: Reply From: Inces

It would be more efficiet to create all houses with tilemap.
But it would be mostly pointless, multiple tilemaps won’t take any considerable RAM, unless You are designing a game for 1999 Gameboy console :slight_smile:

resources don’t take any more space when they are used by multiple instances. It is always one resource shared by all. Textures, images - are resources.