Jump to content

Tilemap.setPreventRecalculate performance questions


Recommended Posts

Happy Holidays!


I am procedurally generating a map using Tilemap.putTile.  For maps much bigger than 32 x 32 the game crawls to a snail's pace, with the bulk of the time being used in Tilemap.calculateFaces.  After many experiments, I have settled on this:

// this.map is the Tilemapthis.map.setPreventRecalculate(true);// procedurally generate the map using putTilethis.map.setPreventRecalculate(false);

I had not seen Tilemap.setPreventRecalculate mentioned before.  Deferring Tilemap.calculateFaces seems to dramatically improve performance while correctly calculating collision data. (I.e., tile faces, etc.)  However, I have a couple questions.


1) Should this really work, or am I missing something in testing?

2) A crossover question - Is the intent to redesign tilemaps for Lazer (Phaser 3.x, https://github.com/photonstorm/phaser3), or will it be the Phaser 2.x Tilemap design refactored?





Link to comment
Share on other sites

  • 2 weeks later...

I'm working through some ugly tilemap performance issues in 2.4.4 myself. You might want to try an older version to see if your issues go away.


In my case, all was well in Phaser 2.2.2 and an upgrade to 2.4.4 killed performance.


Please update us if you find the culprit.


...and good luck!

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...