Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Hitting a bit of a roadblock with my game's development and I'm just looking for some outside advice.

I'm trying to render a tilemap for my mobile game (Android) and I'm using LibGDX.

Now, here's the issue. Using my simplified version of LibGDX's own native OrthogonalTiledMapRenderer gives me:

  • 60fps on desktop
  • ~40fps on my Nexus 10 tablet
  • ~20fps on my Nexus S phone

Here's my renderer for reference, it's very simple as to keep performance up. The function renderTileLayer() is called every frame to render the tiles in the viewport's range.

Now, this is with all tiles in a single TextureAtlas, blending disabled, and actively culling the tiles. Since this is the beginning stages of the game, anything below 60fps is only going to result in horrid performance later on, so I need to get this fixed.

I don't understand how people are able to render tile maps on mobile devices in their finished games if I seem to be having so much trouble with rendering my own simple 1 layer map with no other objects or lighting effects or particles, etc...

The code for rendering the tiles is as straightforward as possible and results in only 1 render call to the SpriteBatch (no Texture swapping).

Any help/input appreciated!

share|improve this question
    
Perhaps you need to benchmark your code? Add time measurements here and there and see where is the biggest bottleneck in your code. –  Lasse Oct 6 '13 at 16:30
    
What is the size of each tile texture? –  you786 Oct 31 '13 at 4:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.