We have a (potentially large) side-scrolling 2D world with lots of repeated tiles (e.g. terrain, walls, water, etc.) For example, there are large "hills" which can be very high, but are rendered using the same small piece of "rock" texture.
I would like to optimize the storage and rendering of this world (it's better to draw one large quad and apply the same repeated texture to it than draw a lot of small adjacent quads separately).
What is a good way to do that? Currently I see a two potential solutions:
- Allow the map designer to specify "chunks" (large rectangles of repeated tiles) manually
- Allow the map designer to design the map on a tile-by-tile basis and then compute the chunks automatically (what is a good algorithm to do this?)
If you have worked on a similar game, would love to hear your particular solution.