josedarioxyz Posted September 13, 2017 Share Posted September 13, 2017 Hey everyone, I have noob questions. I'm creating a platformer game with Phaser, as well as Tiled to create a layered JSON map. So far one of my tile layers is handling all of the inanimate object collisions via this.map.setCollisionBetween(0, 600, true, this.collisionLayer, false) to which I've passed indices to my entire tileset (only using one). Given that I've done this, does the number of tiles I actually create in that layer via Tiled affect performance? Would it be advisable for me to just use setCollision() or setCollisionBetween and pass only the necessary tiles that I plan on passing to that layer? My tileset is about 1/3 tiles I want to use for collision, and they're not totally organized but I can reasonable get that done if necessary. Also, what's better for performance, bigger tilesets or more, smaller tilesets. What would you consider a sweet spot for this in terms of size and number of tilesets? Note that I've already compressed my images etc and not having any performance issues so far, just taking preventative measures. Thanks for any help in advance. Link to comment Share on other sites More sharing options...
samme Posted September 13, 2017 Share Posted September 13, 2017 Phaser makes a list of collideIndexes, but I don't know if checking that is the bottleneck for collision tests. It finds the overlapping tiles first, then checks the indexes. josedarioxyz 1 Link to comment Share on other sites More sharing options...
josedarioxyz Posted September 14, 2017 Author Share Posted September 14, 2017 13 hours ago, samme said: Phaser makes a list of collideIndexes, but I don't know if checking that is the bottleneck for collision tests. It finds the overlapping tiles first, then checks the indexes. Ah I see, thanks for the information! I'll read more about this and see if I can find out if this is a bottleneck. Link to comment Share on other sites More sharing options...
Recommended Posts