Create spritesheet for better performance at the lauching of a game depending of the tiles i need.

I created a game that draw maps from a single spritesheet because i heard that it makes performance better.
So i made several spritesheets.

for example: sprite sheet for level 1 tiles…sprite sheet for level 2 tiles

The problem is that a level in the game can only use the bitmaps on the spritesheet that the game has load so it is less convenient than only loading the tiles i want to draw.

Is it a good Idea to pack the tile in a spritesheet automatically during the inialisation of game so that i will not care of spritesheet during map edition.

I would do whatever is easiest until you run into a performance problem, then measure the performance to find out whats slow and actually solve that issue.

You also don’t have to make 1 tile set per level, instead you can logically group your tiles into sets that show up together and when you load the level you can load the sets you are using for that level. One advantage of this technique is if level one uses spritesheets A, B and C and level two uses C, D, and E then you can skip loading C when you load level 2.

I would also expect that in many cases even if it’s not optimal it will probably still be fine to load tiles you aren’t actually using for that level.