blprnt.blg
blprnt.com is a collection of digital curiosities built by Jer Thorp in Vancouver, BC. This blog is a place to find out what's new on the site, and to collect some extranea from the rest of the web. Here's what's been going on as of late:

7.10.05

FLASH 8: particle.swarm.draw



Here's a slightly modified version of the particle.swarm .swf from two days ago. Time the agents are acting as drawing points, illustrating the history of the swarm. Clicking anywhere will change color - pressing any key will swap between blur and non-blur.

This example used a modified version of Grant Skinner's bitmap caching routine to enable a whole tonne of lines to be drawn without hampering the memory. The lines are cached into a bitmap 6 times a second, and then the vectors are cleared from the memory.

There are 60 agents again in this example - a nice demo again of the performance increases in Flash 8. Not quite near the 10,000 agents that I have running in war.paint, but definitely an improvement.

10 Comments:

Gavin said...

Hi,

Nice work. I attended your workshop at flashInTheCan - remember a section about loops and attachmovieclip. I was trying that out today, but can't seem to figure it out. Can you send me some of that code as examples.

Sorry I would have sent an e-mail, but I couldn't find the address.

11:16 AM  
gavin said...

I'd really appreciate it.

Oh, btw my e-mail is:
gavin@epochapex.com

7:24 AM  
blprnt said...

Hi Gavin,

I'll dig up the FlashBelt demo files and fire them off to you.

Cheers,

-Jer

7:43 PM  
Anonymous said...

Thanks Jer,

I'd really appreciate it. Can't seem to find code examples as elegant as those you used.

gavin@epochapex.com

5:57 AM  
Anonymous said...

Very cool stuff!!! I'm trying to access the source, but cannot..Im getting error 404: file not found. I'd like to try the code with more agents - say 1000?

9:26 AM  
blprnt said...

Hey... I miss-spelled the URL. Try it now - it should work fine!

Glad you liked it. 1000 might be pushing it... the F8 player us better, but not quite that good. 1000 would be easy as pie in processing, though. Maybe I should port it.

9:32 AM  
Anonymous said...

SWEETNESS! yep! the link worked. thanks! you said 1000 would be pushing it, but what did you mean by 1000 would be easy in processing? does this only work for flash 8? not on flash mx 2004 pro? I'll try a test with 100 then go up to 1000, I'll report my findings here. thanks again!

12:25 PM  
blprnt said...

This piece is in Flash 8 - the bitmap caching in F8 is what makes the drawing possible without bogging down the processor. I think 100 should be doable on a PC, but 1000 would almost definitely be pushing it in Flash.

Processing - a program written in Java and made specifically for this kind of task, has more processing power and would be able to run a lot more particles... 10,000 probably wouldn't be a problem.

1:16 PM  
Anonymous said...

Do you have the same swarming behavior but written in Processing?

1:15 PM  
Gavin said...

Hey,

I stupidly posted my e-mail address on this blog post a long time ago and the SPAM is getting a big crazy.

If you could delete that comment up- above with my e-mail addy in it, I would really really appreciate it.

Thanks Man!

Gav

8:37 AM  

Post a Comment

<< Home