1 decade ago by lazer
Hi guys,
I'm having a problem. Two, actually. I've been at this all night and got nowhere at all, so wondering if anyone here might have any ideas.
----------------------------------------
Issue 1 - Win version of Firefox not drawing image (Update below)
The game I'm working on is done, baked, and uploaded. However, in a particular level something isn't being drawn properly in the Windows version of Firefox. It is being drawn properly in the Mac version. It is basically an image with semi-transparent text being overlayed over the tile sheet in a level.
It works in Safari and FF on Mac (and seems to work locally in Chrome, but I can't test it on the server because of the other issue below). It also works in IE 9 on Windows and Chrome (intermittently, due to issue below). But in Firefox on windows that layer just does not appear. I don't see any errors in the log and when I type ig.resources into the console that image appears...it's just not visible for some reason.
Update: Graphikos helped me figure out what the problem with the Firefox bug was (an image not appearing). The problem was that at over 20000px wide the sheer dimensions of this image were causing it to crash and not load. So instead I cut that image into ~5000px chunks and drew them side by side in the level. This worked, but started to cause major performance issues within that level. So next I tried putting in an if statement to only draw each segment when the player's position on the x axis is close enough to see that area of the map. This worked, but performance was still not good.
I ended up reverting to the 20000px image and just telling the person running this thing not to run in Firefox on Windows. A cop out, I know, but only one person will ever see this particular thing and next time I can find a more elegant solution. Big thanks to Graphikos for helping me figure out what the issue was in the first place.
----------------------------------
And issue #2: - Chrome not loading images (Update below)
Chrome fails to load some of the images in the preloader unless I refresh the page after the first load, especially on Mac. So if I clear the cache, load the game, the loader won't finish and will give me things like:
And it's a different image that doesn't load each time, sometimes more than one. As a result the loader never finishes and the game is unplayable. The images are definitely there and I can't reproduce this in any other browser. It doesn't happen nearly as consistently in Windows version of Chrome, but I think I've seen it there as well.
Update: This can't be reproduced consistently across all machines, but I suspect may have something to do with this Chromium bug: http://code.google.com/p/chromium/issues/detail?id=68109
I'm having a problem. Two, actually. I've been at this all night and got nowhere at all, so wondering if anyone here might have any ideas.
----------------------------------------
Issue 1 - Win version of Firefox not drawing image (Update below)
The game I'm working on is done, baked, and uploaded. However, in a particular level something isn't being drawn properly in the Windows version of Firefox. It is being drawn properly in the Mac version. It is basically an image with semi-transparent text being overlayed over the tile sheet in a level.
It works in Safari and FF on Mac (and seems to work locally in Chrome, but I can't test it on the server because of the other issue below). It also works in IE 9 on Windows and Chrome (intermittently, due to issue below). But in Firefox on windows that layer just does not appear. I don't see any errors in the log and when I type ig.resources into the console that image appears...it's just not visible for some reason.
Update: Graphikos helped me figure out what the problem with the Firefox bug was (an image not appearing). The problem was that at over 20000px wide the sheer dimensions of this image were causing it to crash and not load. So instead I cut that image into ~5000px chunks and drew them side by side in the level. This worked, but started to cause major performance issues within that level. So next I tried putting in an if statement to only draw each segment when the player's position on the x axis is close enough to see that area of the map. This worked, but performance was still not good.
I ended up reverting to the 20000px image and just telling the person running this thing not to run in Firefox on Windows. A cop out, I know, but only one person will ever see this particular thing and next time I can find a more elegant solution. Big thanks to Graphikos for helping me figure out what the issue was in the first place.
----------------------------------
And issue #2: - Chrome not loading images (Update below)
Chrome fails to load some of the images in the preloader unless I refresh the page after the first load, especially on Mac. So if I clear the cache, load the game, the loader won't finish and will give me things like:
Failed to load resource game.min.js:93 Uncaught Failed to load resource: media/titles/end.jpg
And it's a different image that doesn't load each time, sometimes more than one. As a result the loader never finishes and the game is unplayable. The images are definitely there and I can't reproduce this in any other browser. It doesn't happen nearly as consistently in Windows version of Chrome, but I think I've seen it there as well.
Update: This can't be reproduced consistently across all machines, but I suspect may have something to do with this Chromium bug: http://code.google.com/p/chromium/issues/detail?id=68109