I’m currently using the Flashplayer in more of an embedded system configuration. We’re evaluating multiple hardware configurations to decide what hardware to use and we’re also evaluating multiple version of the Flashplayer to decide which Flashplayer to use. So I made a quick open source test app to help with this evaluation. It allows you to compare animation performance between an EnterFrame animation vs a Tweener animation vs a Timeline animation. You can also apply various effects to see how they impact things. Since scaling can skew results, the app is designed to run at a specific resolution, but it is easily scalable to whatever resolution you wish to test (and steps are included in the source).
The results have been rather bewildering at times. Depending on the hardware (and I think the OS as well), I have seen filter effects drastically decrease the performance, drastically increase the performance, I have seen full screen mode have great impact or no impact, I have seen the AIR version help the performance and hurt the performance, and just about everything inbetween. Crazy! Anyway, tell me what your hardware/OS/Flashplayer version combination are, and what sort of results you get in the comments.
It should be fairly straight forward. Just drag the sliders to add a new ball that is animated in the specified method. You can click on the top half or bottom half of the DiagnosticStats window (thanks Mr. Doob!) to increase or decrease the max fps. Use the + or – keys to increase/decrease the maximum # of balls allowed. In the AIR version, press Q or X to quit and click and drag the background to move it around.
At the company I work for we use Functional Specification documents for any new Flash game that we make. Before any of the developers start any coding, the design team puts together a simple frame by frame Flash file to make it easy to see what things will look like in the various states of the game. This will eventually become screen shots put into the spec. There will be an additional section put into the spec that includes all of the top-left and center x,y coordinates for each MovieClip on the stage during each frame. That was usually a tedious part of the job that none of the designers liked doing. When they brought this to my attention, I decided to make a quick script to do this for them. Here are the results:
- Copy and paste the code into frame 1 of any Flash file
- Make sure all objects that you want wireframes for are Symbols (for some reason, the x,y is off if they aren’t)
- Run the swf
- Use the arrows keys to change frames
- Use space bar to toggle wireframe view
- You may press the space bar multiple times to get new random colors
- You can click and drag on the x,y text to move it to a new location
I was reading a post from Keith Peters today and noticed a comment made by Ryan Taylor mentioning that mouseEnabled and mouseChildren affect the CPU load. I had to know if this was true or not so I promptly created an experiment app. The app randomly creates 700 parent sprites and 700 nested children sprites. You press the SPACE bar to toggle .mouseEnabled and .mouseChildren for all of the objects.
I couldn’t believe it. Although disabling these properties did not seem to affect the FPS, it definitely affected my CPU. When tested on my WinXP,SP2 machine with a P4 3.4 HT CPU, the swf was taking 13-16% of my CPU. When I set mouseEnabled and mouseChildren = false, the CPU load dropped to 4-6% total! It cut down the CPU usage by about 300%! Very good to know. Thanks for the tip Ryan!
I have seen many particle systems released on many different blogs. I’ve always thought that they were pretty cool and I’ve thought multiple times about making one myself, but decided not to for the single reason that I didn’t want to be just the next guy to jump on the bandwagon of things that have already been done. But, after seeing Seb Lee-Delisle’s presentation on particle systems at Flash on the Beach ’07, I became a little more interested in doing it. Then, at the end of Robert Hodgin’s extremely cool presentation about processing, he left us with one simple image:
I don’t want to make the same crap that everyone else has been making, but I feel like you need somewhere to start. If a particle system was a good enough starting spot for Hodgin, it is for me to. So, on the plane ride home yesterday, I made my particle system from scratch. I didn’t want to look at anyone else’s code or algorithms, for better or worse, I just wanted to go for it. So, this may or may not be the most efficient way to do it, but here it is:
More work on this to come in the near future…