stamas47 Posted February 4, 2016 Share Posted February 4, 2016 So I have been writing this Chunk system for my tilemap game the last couple of days for maps created in Tiled. My map dimensions are 12288px x 3072px => 384x96 tiles with 4 layers. One of the most important criterias was that the map had to perform great on any screen size. What I managed to get was 60 FPS below 1920x1080 and about 32FPS at 2560x1331 with an Intel i5 and Gefore GTX650. At 2560x1331 I achieve this by rendering 113 chunks every frame and checking only adjacent chunk collisions ~30 collisions, with a chunk size of 8x8 tiles with tiles of 32x32 pixels. What do you guys think, is this good performance for a HTML5 (WegGL) game? or compared to what Phaser has to offer out of the box. drhayes 1 Link to comment Share on other sites More sharing options...
drhayes Posted February 4, 2016 Share Posted February 4, 2016 Sounds good to me. I'd love to see the code for that. I'm working on a low-res game with a tilemap so haven't had any real performance issues, but still. Link to comment Share on other sites More sharing options...
WombatTurkey Posted February 5, 2016 Share Posted February 5, 2016 Are you using phaser-tiled? Link to comment Share on other sites More sharing options...
stamas47 Posted February 5, 2016 Author Share Posted February 5, 2016 I checked out phaser-tiled but it isn't compatible with the current version of phaser. My code: https://github.com/SimonTamas/TiledChunks Link to comment Share on other sites More sharing options...
WombatTurkey Posted February 5, 2016 Share Posted February 5, 2016 5 hours ago, stamas47 said: I checked out phaser-tiled but it isn't compatible with the current version of phaser. My code: https://github.com/SimonTamas/TiledChunks There is a guide to make it compatible, you just have to fix a couple lines... cannot find it though. It's on their github somewhere. The performance is around 60% better. You can test the difference with the attached, edited one. Phaser-Tiled.js Link to comment Share on other sites More sharing options...
stamas47 Posted February 5, 2016 Author Share Posted February 5, 2016 So I managed to load my Tiled map. Performance is great but how do I add my character or for that matter any sprite between 2 particular layers? Collision handling is also limited. Where could I find examples of games made with phaser-tiled? Link to comment Share on other sites More sharing options...
WombatTurkey Posted February 5, 2016 Share Posted February 5, 2016 2 hours ago, stamas47 said: So I managed to load my Tiled map. Performance is great but how do I add my character or for that matter any sprite between 2 particular layers? Collision handling is also limited. Where could I find examples of games made with phaser-tiled? https://github.com/englercj/phaser-tiled Go down a bit and search for collision you'll see. Create a collision layer in tiled and use a red block as the tileset to help. Not really alot of games published made with phaser-tiled, but a developer from Blizzard works on it. It's a great performance increase (Well over 60% more fps) and no lag ever with my game using 4000x4000px maps. And other's feel the same. It should be added into Phaser's core, but I don't want to bug @rich about it because he's super busy Link to comment Share on other sites More sharing options...
stamas47 Posted February 5, 2016 Author Share Posted February 5, 2016 Yeah thats how my map works atm. but that still does not answer how i render other sprites between certain layers. Link to comment Share on other sites More sharing options...
Recommended Posts