Performance of really big tile maps


I am looking for a solution to have a really big tilemap loaded at run time and get the best performance I possibly can.

As of now the performance is degrading slightly due to how big of a json file i am loading into phaser is causing lower end machines to crawl down to 15-20fps which is unplayable.

Has anyone come up with a clever way to load big tiled maps without performance degrading, and without introducing transitions from one map to another? (in other words rollovers via legend of zelda 1 on NES isn’t viable solution)

Another question: Does phaser render stuff outside of the current screen (or canvas) bounds? Or do we need to specify that in an option somewhere?


How big is your map in tiles (width x height) ?

Phaser does not render anything outside of the current screen, but it might process those gameobejcts/tiles anyway (not the rendering phase). If you need speed, try creating a StaticTilemapLayer instead of a Dynamic one.

An interesting read might be this article:

Tiles are 1000 wide / 1000 high == 1million tiles
Tiles are 16 pixels / 16 pixels == 256 pixels.

Only dynamic tilemaps are culled afaik. Static ones can’t be culled and for general game objects I think you need to do it manually (using visible or alpha). There is a method in camera to get a list of culled objects, but with such high amounts you would need to handle it in customized, optimized way.

Try dynamic layer, although that might still be too slow. Solution would be to load/unload the map in segments so there’s never too much to work with.


Yeah it unfortunately needs to be static as part of requirements I’m setting on it :frowning:

What requirements are those? Dynamic can do more than static, so unless I’m missing something there’s no possible valid requirement except performance, which is what we are trying to improve here.

It needs to be static because it needs to be static? :slight_smile:

I could try loading it dynamically but the map is not going to change (Im speaking in terms that no sort of procedural generation is going to occur). I guess you could say it is “business level requirements that the map remains consistent and always renders the same”.

It’s just about what kind of layer you create. If you don’t change the tiles, it will render the same.

1 Like

WOW. You guys are freaking awesome!

Changing from static to dynamic and fps on this crap work machine I’m using went from ~31-33 fps to ~58-60 (and i’m clamping fps to 60 manually).

INCREDIBLE. Thank you so much. Literally worked like a charm without changing anything but createStaticLayer to createDynamicLayer. Loading 1million tiles with this is awesome.

1 Like

@Antriel was right, I forgot StaticTilemaps aren’t culled. But they are super fast for small maps for that very same reason. On the contrary, they are super slow for giant maps. Richard explained this very clearly in this devlog if you are curious: