I am trying to implement Box2D into my top down tile game in LibGDX. Each world consists of a set of chunks, and each chunk is 16 tiles wide/long. The maximum/minimum chunks loaded at one time is 9 (a 3x3 set of chunks with the player in the middle). This means that there are 2304 tiles active at all times.
I have tried creating a Static box shape for each of these tiles but performance was understandably terrible. I then tried creating a box shape for each of these tiles that are solid. Performance was still terrible because at one time there was 500-1000 individual boxes.
One partial solution I found to this is reducing the chunk size. At chunk size 8 with boxes around only solid tiles performance was 60 fps on mobile devices, however this was only sustained when the chunks that were loaded did not contain many solid tiles so this isn't really a solution.
I then came across a potential solution which would join all solid adjacent tiles within a chunk, so that instead of having a box for each individual solid tile, there would be a irregular polygon for each set of connected solid tiles. This solution appears to be the best, however what would happen when I want to destroy a solid tile. I would then have to recalculate all of the tile connections within that chunk and recreate another irregular polygon. To get around this, I then thought of dividing the chunk up into 4x4 sections. Each of these sections would handle their own irregular polygon so that when a tile was destroyed only that section would need to be updated and recalcuated. This however increases the number of bodies in the box2d world compared to the previous solution where there is just 1 body for each group of solid tiles.
I am looking for any other ideas that might help.
On a side note: The only reason I am using box2D is so I can achieve a nice lighting effect with shadows and everything with box2DLights. If there are any substitutes of this library that you know of please let me know!