Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.