gskinner.com: gBlog: FlashMX 2004 source code, news, reviews and opinions
Back to gBlog Main gskinner.com website: source code, portfolio, etc. contact Grant Skinner

Syndication
RSS 1.0
RSS 2.0


Subscribe
Enter your email address to be notified when posts are added.

Search

Resources
Conference Session Notes

Flash Blogs
Waxpraxis
Philterblog
W3Blog
Jonas Galvez
Josh Dura
Quasimondo
Flashguru
Sean Voisen
Colin Moock
Flazoom
Greg Burch
Pope De Flash
Peter Hall
Glyn Thomas
actionscript.com
Princess Pegg


Aggregators
Flog
FullAsAGoog
MXNA
Hall of Justhese


« Back from Flashing London | Back to Main | Conference Session Notes »

June 02, 2004


IMPORTANT NOTE: This is an old archive. It is only here to support outdated external links. To view the updated version of this archive, please go to the blog index, and search for the title of this document using the search form.

Experiment: Crystallization in AS2
Posted by Grant

I recently decided to see what would happen if I recreated my Flash 4 crystallization experiment using ActionScript 2.0. With the speed gains in Flash Player 7, and some pretty heavy algorithm optimizations, the results are pretty impressive, at least from a pure data handling perspective. Unfortunately, it still slows down on slower systems due to the heavy graphics requirements.

This first experiment ("bio foam") was meant to be a close facsimile of the original F4 experiment, but I added in additional motion, and broke out of square grid a bit to make it feel a little more organic. This version has 3000 grid nodes over an area of 250x250 versus the original experiment's 900 grid nodes over 96x96. The main limiting factor is the graphics compositing, which is minimized by dynamically adding movieclips to the grid only when they are visible, and removing them as soon as their animation has ended.

Simply click in the black area below to initiate the crystallization process. When it is complete, you can click again to restart the effect.







In this second experiment ("subatomic firecrackers"), I tried to reduce the impact of graphic compositing by utilizing quite simple shapes/animations, and minimizing the time each movieclip remains on stage (thereby decreasing the total number of clips on stage at any point in time). In this demo, there are over 15 thousand (!) grid nodes in the same 250x250 space. Again, this is attributable to a highly optimized algorithm, that deals only with "activated" nodes, and the speed gains in Flash player 7.







I'll continue to play with this engine and post the more interesting results (these two were the results of an hour or two's tinkering).

If you're on a fast PC, let me know what these experiments look like... my poor powerbook can't quite keep up with them (~25fps, instead of the 40fps they're designed for).

If you're interested in a bit of nostalgia (or are a bit masochistic), you can download the FLA for the original experiment. I might release the new AS2 CrystalFarm class at some time in the future when I'm done playing with it, but not quite yet. ;)

Posted @ 10:31 AM by Grant | TrackBack


Comments

Pretty neat stuff.
As for the speed, the "bio foam" one slows down a bit as its spreads its self out, but the "subatomic firecrackers" seems to run smoothly throughout.

p4 2.5ghz, 1gb ram.

Posted by: Ryan at June 2, 2004 11:30 AM

the first slow down just when the circumference need 10pixels to touch the borders
athlon64 3000

Posted by: beaver82 at June 2, 2004 11:54 AM

Wow, really neat stuff. The first one's more impressive - just a shame the Flash Player slows up so much.

Posted by: Paul Neave at June 4, 2004 04:44 AM

Yes bio foam slows slightly as it spreads then speeds up as it dissipates, but they can both run without subatomic firecrackers slowing at all.

Dual @ Ghz PowerPC G5, 1.5 GB DDR SDRAM

Posted by: Martin Ryan at July 1, 2004 06:57 PM

Yup the first one slows down big time.

Dell Optiplex GX270 p4 2.8Ghz with 1 gig RAM

Posted by: Arif Amirani at October 27, 2004 04:22 AM


Hosting by NetKeepers.ca | Powered by Movable Type 2.661
The text content of this blog is licensed under a Creative Commons License. Graphics are ©2003 Grant Skinner.