i'm making a procedurally generated side-scrolling and destructible tile based world. So far I've got : - the values generator (for deciding which tile to place where) - a testing scene generating one object per tile (a mesh with 2d box collider, inactive at start) - map chunking (separating the map into chunks to show only what is visible) - visibility based on orthographic camera size (it's not much but the camera can zoom in or out) - the chunks are 32x32 tiles in size - the maximum chunks I've seen is around 25
This works fine for testing the world generation, however there is massive stuttering when moving around with camera zoomed out to the maximum. It's less when zoomed in, but it is still noticeable.
From testing, I've found out that its obviously the building in the scene that causes the major part of the stuttering.
I've been searching for better ways of building the scene but there are a few constraints that make most of the non viable : - The world is destroyable, so I need to be able to interact with each tile - There are textures coming on top of the tile texture depending on context (selection rectangle, decoration, glow...) - The tile texture itself is not a single sprite but a repeatable texture, so it needs to be places based on coordinates so it properly repeats itself.
So far I've looked at : - TileMaps - Mesh melding - Texture bombing
None of these seem to be able to fulfill the constraints fully.
Is there a way to fulfill the constraints while improving scene building or am I missing something? Please help.