Lomaz Posted November 10, 2014 Share Posted November 10, 2014 Hello! I just started with Phaser the other day, and I am running into an issue. I am using a camera, and a world with large bounds... The issue I have is i'd like to have a larger world, but at that size it runs very slowly (also takes ages to load) The best I can get fluid motion at is around 2400x2400, but I'd like to bring it as high as 9600x9600, Is there a way to optimize this by only rendering tiles close to the viewport? My map is made up of several hundred 48x48 tiles, who's values are pulled from a JSON object. Let me know if you need links or source or anything! again, I'm new to Phaser, so there may be something simple I'm missing. Link to comment Share on other sites More sharing options...
valueerror Posted November 11, 2014 Share Posted November 11, 2014 there is a tilemap plugin that should handle tilemaps in a way like you described... http://www.html5gamedevs.com/topic/9573-phaser-tiled-plugin/ Link to comment Share on other sites More sharing options...
lewster32 Posted November 11, 2014 Share Posted November 11, 2014 Just so you know Lomaz, the existing Tilemap renderer does actually only render the tiles visible, but there are many other optimisations in the one valueerror linked which make it much faster. Link to comment Share on other sites More sharing options...
Lomaz Posted November 11, 2014 Author Share Posted November 11, 2014 Got it working, thanks guys, yeah I didn't even know about the tilemap thing at all, I was just rendering every tile programmatic from a database, so it was horridly slow, swiching to tilemaps has improved things greatly, just need to re-draw things! Link to comment Share on other sites More sharing options...
Lomaz Posted November 28, 2014 Author Share Posted November 28, 2014 I was unable to figure out the tiledmap plugin D: oh well, couldn't get it to work... When my canvas is 900x900 I experience 10-12fps Link to comment Share on other sites More sharing options...
lewster32 Posted November 28, 2014 Share Posted November 28, 2014 Both the TileMap and TiledMap plug-ins are designed for use with Tiled, I assume you have your own format though, so you'll probably either have to write your own importer or recreate your world in Tiled. Link to comment Share on other sites More sharing options...
Lomaz Posted November 28, 2014 Author Share Posted November 28, 2014 I am using tiled. I got things working, but not with the plugin listed above, as of now a 900x900 viewport gives me 11FPS, not exactly smooth. I tried following the code listed in the GIT but to no avail, is there a full project anywhere I can see it at work to compare and see what I'm doing wrong? Link to comment Share on other sites More sharing options...
Recommended Posts