# Use libgdx box2d for dynamically generated top down map

So, I've already found some information on how to use box2d and tiledmap together.

Since I want to generate my top down map (100 by 100 tiles), I thought about only using box2d.

The tiles would be fixed and only the player (and maybe some other movable parts like chests, etc) would be dynamic. I'd also like to use box2dlights later, so using box2d seems convenient.

My only concern on this is the performance. I haven't used box2d much, so I don't know how it handles such a big amount of boxes (though not all 10000 tiles would be visible at the same time).

Does anyone know how the performance would be influenced or advice on how to achieve this easier?

• I doen't make a difference, if the tiles are visible or not, Box2D will update them anyways. But i don't think, that those 10000 tiles will create performance problems, as most of them are static as you said. Anyways, if you don't need any complex physics-calculation Box2D will be overhead. For lighting there are many other posibilities + it is possible to use Box2D lights without Box2D (no shadows!) as you can see here – Springrbua Jun 4 '15 at 7:41