tsphillips Posted December 25, 2015 Share Posted December 25, 2015 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? Tom Link to comment Share on other sites More sharing options...
BrenX Posted January 4, 2016 Share Posted January 4, 2016 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 More sharing options...
BrenX Posted January 5, 2016 Share Posted January 5, 2016 FYI, I rolled back to Phaser 2.3.0 and my frame rate went back up. Anything from 2.4.0 and up kills it. Link to comment Share on other sites More sharing options...
Recommended Posts