- Home /
Logo image in Facebook Canvas increases loading time.
I have a game that runs on the WebPlayer platform. The build size is around 27MB. The game is playable on Facebook and it uses the Facebook web canvas and Unity integration. On Mac/Apple, not on Windows, the loading of the un-cached application takes several minutes.
I spent a lot times figuring out why, and I realized that if I removed the image for the Logo Image Url, the loading would come down to a third of what it used to be, sometimes below a minute. The image itself is 707KB, 760x653 pixels.
If you remove the the url for the logo image, the canvas will use the game's icon. If there isn't any, it will use unity's icon. By removed I mean to remove the link in the settings page, leaving it blank. If I modified the image so it was the same size of the game's icon, the loading was almost as fast as loading with the game's icon.
I don't really understand why this image would increase the load times so great since it has nothing to do with the actual game (the .unity3d file) itself. To make sure it was not me going crazy, I did the experiment (loading the game with/without the image, cached & un-cached) several times in front of different people and it behaved like described above every single time.
I am sure other people here have published games on Facebook and used the canvas and it's features, has anyone encountered this issue before ?
Thank you !
Is it downloading the image from a webpage?
Is it happening all at once via coroutine? Or is it being inadvertently spam loaded by having repeat calls in Update?
$$anonymous$$ake sure your code isnt structured in such a way as to make unimportant elements cause the rest of the code to wait. Don't use while loops etc.
The image is downloaded from a server. Sorry if I was not clear : the loading of the image is done by the canvas, not the game. The game has nothing to do with the image. It is the Facebook canvas that fetches the image with the given url while the actual app/game is loading.
Is there any sort of flag for the completion of this event within the game?
I do not think this so : The Facebook canvas page loads it's assets (the Logo Image URL, the progress bar image Url and the progress bar frame Image Url) first and once that is loaded, starts loading the game and starts filling the loading bar. So even before the game starts to load, the logo image is fully loaded.
The loading of the logo image is very fast, it is the loading of game that is extremely slow if the logo image is large. And it is not even that large at 707$$anonymous$$B and 760x653 pixels.
If I remove the link/url to the logo image in the settings page, the canvas will use the game's icon, which is very small. In that case the game will load very quickly, in about 30 secs to 1 $$anonymous$$ute ins$$anonymous$$d of 3 to 4 $$anonymous$$utes.
The logo image does not interact directly with the game, ever.