bateleur
|
|
« on: March 17, 2010, 01:40:55 PM » |
|
I've recently started running my current Flash project in a web browser having developed it mostly using a combination of AIR and Adobe's standalone Flash Player. Part of the difference one normally expects when doing this is for the application to run more slowly. However, I am instead seeing a very odd effect I've never encountered before and was wondering if anyone else knew what it was.
Every so often, with no apparent pattern, the game freezes for about 1/4 of a second. This is not just a skipped frame, it's significantly longer. The phenomenon has the following properties:
* It is not periodic. * Affects only the user thread. Music continues to play smoothly. * Still happens with the same frequency if I turn the music bitrate down or even disable it entirely. * Still happens with the same frequency if I run the game at 20fps instead of 30fps. * Is unlikely to be a garbage collection cycle since it is much too long and I do very little allocation in a typical game loop. * Happens reliably on Firefox 3.6 but never on IE8. Not tested Chrome or Opera yet. * Does not happen on the standalone player or when using AIR. * Happens even on extremely simple levels with very few objects. Does not happen more often on complex levels. * So far I have only tested this on my dev machine, which is a pretty meaty dual core machine with plenty of RAM. This game is hardly heavyweight anyway.
I haven't completed my own investigations yet, but I wanted to ask about this because I already cannot come up with any really convincing possibilities for what it could be. Anyone got any ideas?
|
|
|
Logged
|
|
|
|
Zachary Lewis
Level 1
Professional by day, indie by night.
|
|
« Reply #1 on: March 17, 2010, 01:47:06 PM » |
|
What framework are you using to develop your application?
Do all the browsers have the same version of Flash installed?
Are you ever communicating with an object outside your Flash project?
|
|
|
Logged
|
|
|
|
jotapeh
|
|
« Reply #2 on: March 17, 2010, 01:51:15 PM » |
|
I've had performance issues with Firefox since sometime in 3.5. I was hoping 3.6 would end the madness, but alas, it does not. In fact 3.6 seems to break some things that worked just fine in 3.5, I suspect they are imposing new security restrictions or sandboxing it differently, I'm not sure.
My 'solution' was to use Safari. Not much of one.
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #3 on: March 17, 2010, 02:01:18 PM » |
|
My 'solution' was to use Safari. Not much of one. An acceptable solution for a user, but not so much for a developer. What framework are you using to develop your application? CS4 (set to Actionscript 3 / Flash Player 10). Do all the browsers have the same version of Flash installed? 10.0.45.2 in both cases. Are you ever communicating with an object outside your Flash project? No. No network use of any kind. FWIW my current guess is that Flash is somehow managing to cache a Sprite as a Bitmap in such a way that it inappropriately reallocates the BitmapData every frame, eventually triggering a monster GC. It shouldn't be, but I can't currently think of anything else that would be quite so time consuming.
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #4 on: March 17, 2010, 03:16:07 PM » |
|
How are you embedding it? I once got rid of a problem like this using SWFObject rather than a plain object tag. In general, Firefox just doesn't seem to get on that well with flash. *sigh*
Could it be related to when Firefox does it's GC, considering how monolithic it is? Some developer extension can probably let you know.
|
|
|
Logged
|
|
|
|
jotapeh
|
|
« Reply #5 on: March 17, 2010, 06:25:35 PM » |
|
My 'solution' was to use Safari. Not much of one. An acceptable solution for a user, but not so much for a developer. Eh. Not even, really. Most users will tell you where to stick it if you require that they use a certain browser. That said, my day job involves pandering to the web needs of IE6 corporate customers ... pretty much any browser looks golden after a day in the office
|
|
|
Logged
|
|
|
|
BlueSweatshirt
|
|
« Reply #6 on: March 17, 2010, 08:57:44 PM » |
|
I constantly had this problem in Firefox, the 1/4-or-so second freeze. Except for me, this problem wasn't just with Flash, it was for the entire browser. It was just considerably less noticeable when just viewing web pages. It began to become apparent when I was getting the same issues with Unity games.
My solution: Move to Chrome.
|
|
|
Logged
|
|
|
|
Triplefox
|
|
« Reply #7 on: March 17, 2010, 09:18:21 PM » |
|
Try upping the amount of local storage allocated for Flash. When it gets crowded Flash/FF tends to start getting intermittent pausing.
|
|
|
Logged
|
|
|
|
Zachary Lewis
Level 1
Professional by day, indie by night.
|
|
« Reply #8 on: March 17, 2010, 09:22:00 PM » |
|
I constantly had this problem in Firefox, the 1/4-or-so second freeze. Except for me, this problem wasn't just with Flash, it was for the entire browser. It was just considerably less noticeable when just viewing web pages. It began to become apparent when I was getting the same issues with Unity games.
My solution: Move to Chrome.
I had that same problem, but with Chrome. It would freeze whenever I was running my laptop on battery power. Opera seemed to work well, but I like Chrome the best. @bateleur: By framework, I meant flixel or FlashPunk or whatever. It's good to know you're targeting Flash 10, though. The more I hear about it, it doesn't seem like a Flash problem (or if so, it's one you're not going to be able to fix).
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #9 on: March 17, 2010, 11:36:55 PM » |
|
How are you embedding it? Using object tags. (Well OK, actually using Adobe's 200+ line autogenerated magic code, but I'm pretty sure that amounts to an object element in this particular case.) Try upping the amount of local storage allocated for Flash. Well yes, this might work. But again, this is a user end solution. It doesn't help me, because I need to distribute this game. @bateleur: By framework, I meant flixel or FlashPunk or whatever. Ah, right. No, not using a framework.
|
|
|
Logged
|
|
|
|
Triplefox
|
|
« Reply #10 on: March 18, 2010, 08:02:47 PM » |
|
Well yes, this might work. But again, this is a user end solution. It doesn't help me, because I need to distribute this game.
It's a known problem afflicting many shipped Flash titles. I don't think you can reject it out of hand, unless you think you're smarter than the other devs that have run aground of it.
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #11 on: March 18, 2010, 11:41:52 PM » |
|
I don't think you can reject it out of hand, unless you think you're smarter than the other devs that have run aground of it. Indeed not, but I need to at least try to fix it.
|
|
|
Logged
|
|
|
|
|