Jump to content

is it possible to merge down the images of 2 tilemap layers to gain performance?


valueerror
 Share

Recommended Posts

I re-checked the two methods since you said that you don't see any different.

I can say that createFromObjects is much better than just export the layer as an image (even after tinypng).

 

To check that, I increased the resolution so the fps difference will be more visible in both methods.

Checked wite Galaxy s2/s3 phaser 2.0.7 and cocoonjs 2.0.2:

 

res: 1200x900
createFromObjects: 60+ fps
Tiled image export with tinypng: 47 fps
 
res: 1920x1080
createFromObjects: 54 fps
Tiled image export with tinypng: 33fps
 
 
Anyhow, I'm glad it worked out for you in your way, just wanted to post this to anyone who'll see this post in the future.
Link to comment
Share on other sites

well.. as i wrote i think this depends on how many tiles/objects you have..

besides.. i compared objects to layers - not images

but i guess there comes a point where rendering all the individual objects becomes more expensive than one huge image.. my image is 6400x480 that means a LOT of deco objects..

in the end one could say layers > image > objects (as long as you dont have 200 or more objects.. if so maybe its layers = objects > image

i chose to convert the layer with ~200 tiles into objects and the layer with 600+ tiles into an image.. max performance for me...

Link to comment
Share on other sites

well.. as i wrote i think this depends on how many tiles/objects you have..

besides.. i compared objects to layers - not images

but i guess there comes a point where rendering all the individual objects becomes more expensive than one huge image.. my image is 6400x480 that means a LOT of deco objects..

in the end one could say layers > image > objects (as long as you dont have 200 or more objects.. if so maybe its layers = objects > image

i chose to convert the layer with ~200 tiles into objects and the layer with 600+ tiles into an image.. max performance for me...

 

Got you. It's probably individual to what works for your game (tile size, deco objects ...)

Anyhow, I'm glad it worked out for you cause I struggled in the same thing :) Hopefully Phaser will have a better out of the box support with Tiled layers in its next versions.

Link to comment
Share on other sites

Be aware that tinypng or any other image compression tool will not give you ANY extra performance, just less bandwidth usage and faster load times. Whether the image file size is 2kb or 2mb, when it's loaded into memory it's essentially an uncompressed 32-bit image. The only thing that affects performance with imagery is the amount of pixels (i.e. the dimensions).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...