kidos Posted August 14, 2014 Share Posted August 14, 2014 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: 1200x900createFromObjects: 60+ fpsTiled image export with tinypng: 47 fps res: 1920x1080createFromObjects: 54 fpsTiled 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 More sharing options...
valueerror Posted August 15, 2014 Author Share Posted August 15, 2014 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 > imagei 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 More sharing options...
kidos Posted August 15, 2014 Share Posted August 15, 2014 well.. as i wrote i think this depends on how many tiles/objects you have..besides.. i compared objects to layers - not imagesbut 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 > imagei 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 More sharing options...
lewster32 Posted August 15, 2014 Share Posted August 15, 2014 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 More sharing options...
valueerror Posted August 15, 2014 Author Share Posted August 15, 2014 thx lewster.. that's why i use pngquant.. to reduce the downloadsize.. i'm aware that this has no impact on performance because you recently tought me that in memory it will have the uncompressed size... Link to comment Share on other sites More sharing options...
lewster32 Posted August 15, 2014 Share Posted August 15, 2014 Yeah, that was directed at kidos, sorry! Link to comment Share on other sites More sharing options...
Recommended Posts