PDA

View Full Version : flash gurus please help - processor intensive problem


zhaus
03-27-2003, 01:37 PM
my client commissioned me to make a piece which is 800x600 and full of 800x600 bitmaps. i know, problem off the bat. but we (THEY) decided to try it out anyway. the piece is a very linear movie, no interactivity, with masks moving over these huge static images -- about 35 of them (images) in total. i've taken great care to do everything i can to minimize processor effort -- i am not moving the images at all, performing fades by fading flat color over them (instead of fading the image itself -- does that help?), i resized them all perfectly in photoshop before bringing them in (as png's -- which, in my testing, produced the smallest output image by a 75% margin over jpeg. !)

well, it's about 5 minutes long. and it crawls. the frame rate is at 24, i can't go lower and have it look smooth (lots of fancy text animation too.) i'm trying to find a way to make it work on a computer with an average processor. i know it sounds rediculous, but it's a huge (fortune 50) client and we need to explore all avenues before revisiting the concept.

something i noticed is that the animation (which is currently all just one movie) - starts off fine on all machines, and becomes bogged down on some, only later. thus the solution i'm looking at is to break the animation into tiny little .swf's, and load and unload them. this would require fancy footwork to make it appear seamless, and im not even sure how to do it. but i'm wondering if someone out there can tell me if they think it will make a difference for the processor, or if there are other solutions i should consider?

if you need to see the piece, please let me know. i thank you for your wisdom in advance, and look forward to any help you may have.
thanks
zhaus

uber
03-27-2003, 01:52 PM
I've recently just completed a project just like that, from my experience "masks and alpha fades" especially over large bitmaps is like saying:

#include "..\100%CPU.as"

Try Guiding out key elements to focus in on the problem..

Also try and keep away from movement which happens at the same time. Try to stage your animation in phases.. So that one animation start as the other one ends.

If you also using onClipEvents for the movement be careful because if these are not removed properly, they will continue to execute for the duration of the movie.

If tweening animation, keep away from lengthy tweens..

If all else fail use director.....

Ub3r

CyanBlue
03-27-2003, 01:57 PM
If all else fail use director.....Amen to that... :D

What is that AS file you are including, uber???

zhaus
03-27-2003, 01:58 PM
hi, thanks for your response.

i hear your advice, but, of course, the piece is in constant, fluid motion, with text animations over it, emphasizing the point. before considering revamping that major part of the concept, i need to see if there's another way to do it.

there are no onClipEvents -- in fact very little actionscript at all... it's all tweened, and i've kept them short.

i am considering moving to director... though i know nothing about it. do you know if i would run into the same issues? or does the shockwave player use the processor resources better?

do you think cutting it up and loading and unloading the pieces would help?

uber
03-27-2003, 02:00 PM
Originally posted by CyanBlue
Amen to that... :D

What is that AS file you are including, uber???

it's a joke... for saying a flash movie is running like a 3 legged dog..

uber
03-27-2003, 02:15 PM
Originally posted by CyanBlue
Amen to that... :D

What is that AS file you are including, uber???

it's a joke... for saying a flash movie is running like a 3 legged dog..

tost
03-27-2003, 08:58 PM
zhaus, about cutting them up:
how big is the total movie? is it for the web or a cd? file size can be a problem for the flash player, when you say "five minutes 800x600pix images tweening, text all the time" i suppose we're talking megs and megs? the poor thing isn't really built for that :D
i don't know if i'm right on this, but i assume that when an swf is 30 MB, and it is loaded in the browser, it is also loaded in the RAM or virtual memory? i imagine that's pretty painfull when there's only 64MB ram all together and there are some other apps open. i'ld cut a little part out of it if i were you and check how that works, if i were you. if that goes smooth you can be sure it ain't the animation and chop it to pieces! :)
hope it helps a little :D
tost

tost
03-27-2003, 09:05 PM
btw, cyan, my man, could it be that you haven't slept for days and nights - again? that was soooooo obviously a joke! :D :D :D

no, really, the .as file has nothing but a for() loop in it:
for (i=1; i>0; i++) etc etc ;)

CyanBlue
03-27-2003, 11:22 PM
Nah... I am not just myself thesedays... :( I was sane when I said amen part though...

Mortimer Jazz
03-28-2003, 01:23 AM
Originally posted by zhaus
but we (THEY) decided to try it out anywayBlue chip client's are always a real pain in the arse ;)
It slows down as the movie goes on...... I wonder if it's a caching problem browser side or whether you could ease things by doing the following....
1)Divide the animation up into logical sections
2)Contain each section inside it's own mc
3)Create a container clip on the fly (using creatEmptyMovieClip) and load the first section into it
4)Delete the container, create a brand new container and load part 2 into it
5) Delete the container and create yet another new one ....etc

The reason I suggest using a dynamic container mc (as well as the clips already being inside their own mc) is that I remember reading something about flash retaining data even after it's supposedly been deleted - but that could have been a flash5 problem.

No guarantees it'll work but it may help ease the progressive lag. Worth a try I guess.

CreateN
03-29-2003, 03:54 AM
One more thing you might try.

Set all mc's to disabled.

mc.enabled = false;

On one project I was working on, this provided at least a 50% speed increase :)

Mortimer Jazz
03-29-2003, 03:16 PM
Nice one, that just wouldn't have occurred to me.

DanSolo
03-29-2003, 05:00 PM
Originally posted by CreateN
Set all mc's to disabled.

mc.enabled = false;


If this is the case, then it would probably make sense to set a prototype...

MovieClip.prototype.enabled = false;

uber
03-31-2003, 09:15 AM
question on this?

-----------------------------------------
mc.enabled = false;

MovieClip.prototype.enabled = false;
------------------------------------------

What exactly does it do?

Does it disable all actionscript including, onEnterFrames.
Also what about buttons contained with the MC's

Does anybody have any examples of this, ive just tried it quickly with little results..

Ub3r

fgf
03-31-2003, 09:33 AM
flash definitly retains guff in memory

(try watching a process meter in win2k while dynamically making sound objects and watch the mem usage creep up)

what may work is a full page reload (getURL a new page) but I'll go out on a limb and assume there are no convienient points to do that.

Director "uses compiled files while flash uses interpreted" and director is designed for bitmaps so it should make a better job of it but i've never really used shockwave much in reality (only toy uni things and a big cd project).

fgf

DanSolo
03-31-2003, 09:59 PM
From the MM actionscript dictionary... (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary518.html)

i++
05-14-2003, 07:59 PM
@zhaus:

if your movie is for a cd i would urgently recommend to move to director.
director allows a much better memory management (no problem with your 30+ 800x600 bitmaps) and it animates bitmaps MUCH better and fluid then flash does.

and as most of yout project seems to be animation, which is pretty similar in director, it is not too difficult. even if you have never worked with director.

i++