The Particle Sessions : Prologue

We've got the gun Max!

Last week I reveiled my plan to revive this blog and start getting regular posts on here again. It had been cooking for a while and I had decided that the first thing to do to revive the blog was to start with a long overdue post about particles, mainly sparked because of the interest in the Bloom Particles (mirror without preloader) I did for the unfortunately cancelled Bloom conference. The other part was that I really wanted to get it out and get particles out of my system for a while. I had promised to post about this for quite some time, but with the blog not being used, it was a daunting task. It turns out I find it much harder to make blogposts then little experiments. This post is about that. I apologize up front for it being a bit of a personal story before anything else. It is however, the start of …

The Particle Sessions

I decided I wanted to take and expand and continue on what I explained in my Skunkworks talk (video of that talk at FFK here), where I used this example to show how simple these systems work in ActionScript and how something can create seemingly visual complexity with fairly simple and atomic code. But since this is not a 1 hour long session, but a blog, I can dive much deeper in the technical parts. Never truly 100% happy about the code in the Bloom piece, I had since then already done a couple of new things which particles. I slightly elaborated on that  and my other distractions in my session titled “The Discontinuity” at Flash on the Beach in a combination of Cinder and Flash Experiments (experiments one and two). That session was taped and will hopefully find it’s way online as a video soon, in the mean time watch some of the fantastic speakers here. I wanted to include the newer things in that talk. I’ll be posting multiple things here, and bundle them under the name, the Particles Sessions.

The Discontinuity

As I stated in my previous post, I’ve decided to take it easy with the conferences this year. The title I chose for that Flash on the Beach talk, was indeed pre-concieved. Taking a bit off from that would free up some time for the blog and experiments too; I have been thinking about what I want to communicate through this blog and how it can substitute what I normally talk about at conferences. I had decided that for the first particle post, I wanted not only to use another simple example of particles to explain particles, but to explain many facets of Flash, ActionScript, Pixelbender, Alchemy and creative development in general.

The Distractions

So I set out writing a new version of the fairly simple particles for the blog. In a fractal-like twist, what happened is that I for the 4th time I started exploring particles by writing code for this “tutorial” and then getting entirely distracted with just playing around with it. It’s the creative part about development I truly love. Play, learn and play. The side effect of toying around with ideas is that mostly you fail and every now and then find something interesting and new to play with. But in both instances you learn valuable lessons. This time this play lead me to something similar, yet new. What I failed at was the original goal of getting the blog post finally done.

Quasimondo : ” Have you tried it with video yet ? “

After writing the new example code, I felt it was missing something and I showed it to Mario Klingemann, who while discussing it said : “Have you tried it with video yet ?”. The code wasn’t well suited for that, and I didn’t think much of it, but as a quick distraction and experiment, I started hacking the nicely clean particle code to do some video. It didn’t work well in the first instance, but after a little bit more of code cluttering and quick hacks it worked nicely. Then I added in some of Keith Peters’s minimalcomps way to quick (they’re so easy to put in, I didn’t really do it nicely) and put it online and tweeted it. I then started looking at my blog and found it was broken. Who thought digital things would break out of lack of maintenance ?

Even more distractions

What happened with the particles experiment somewhat surprised me. I didn’t see it as a particular different thing of what I normally play around with and execution could have been way better. But the particle video experiment quickly got some strangely high amounts of hits. Most of them from Twitter, StumbleUpon, Reddit and Hackernews. At this point, my website has trafficked near 1Tb worth of data of that experiment, and amassed a for this site truly staggering amount of visitors. I started checking the comments out.

With very positive reviews, one thing stood out; I had preselected 3 videos and put those in, to show the effect on different video’s. But based on the feedback of above mentioned blogs, people wanted to be able to select their own videos. In my mind I had a small part of the following Saturday aside to actually write the particles post, but instead used that time to add in quick, hacked and experimental support for YouTube. It’s been working pretty stable. But again I failed at finishing the particles post.

The Fail, not again.

So after mutilating the code yet more I had now running a bandwidth eating experiment on my website, but no blogpost, the goal which started this to begin with. The normal work week hit and I do also enjoy working on Aviary, which has priority. I ended up using pieces of time normally wasted on CoD:BO to write snippets of code and chunks of explanatory text. It became apparent one post wouldn’t be enough alone, and I’ve decided to make it into a series. This is to be thorough and an actual reference towards the technologies and ideas used, rather then quickly touching upon something. The prologue alone had almost become to long for one post and had been going to a couple of revisions.

Yesterday I had a quick peek at compiling a WebM decoder for Flash using Alchemy and the opensource libvpx, which contains the VP8 codec. Although it does work in the form of a very early form of their examples running using swfbridge, it’s quite slow at this point in time. I was tempted to not post anything about the particles again and play with it more this night. But I decided I didn’t want to fail again, so particles first. WebM can wait.

Next Monday you can expect the first post surrounding the technical details of a simple but fast particle system in Flash. I’ll start out explaining the bloom particles, it’s working and it’s flaws. And then we’ll start looking at (yet again) combining Alchemy and Pixelbender to make a faster version of that. We’ll dive deep into the details of Alchemy and some experiments to combine them with Pixelbender.

This post is also way of forcing myself to get Part 1 of this multipart part series neatly together this weekend. And finally get particles of my todo list and out of my system for a while…unless I get distracted. My apologies for the delay.

This entry was posted in Flash, Particles, Random Thoughts and tagged , , , , , , , . Bookmark the permalink.

8 Responses to The Particle Sessions : Prologue

  1. permanyer says:

    you can make a scattering particle system algorithm with your ideas and might result into something similiar to this post :P (specially if reader does not follow you on twitter)
    Anyway, really looking forward to your posts.
    keep it up!

  2. Lawrie says:

    I was amazed when I saw this – really cool idea, and the performance is amazing. I’m glad it got loads of attention from outside the flash community and I can’t wait to see more details on its use of Alchemy and PB.
    I’ve been playing about with a Kinect using Flash this week, and would love to use a particle system like this to animate the depth camera data.

  3. gary says:

    i think to work on the particle stuff makes more sense then the webm. Native AS3 decoding of HD frames requires a lot of cpu and iam sure Adobe will include the libvx lib soon in their next flashplayer release. maybe the new coming GPU support will bring us more chance to develope own codecs in flash.

    do you have any experiments for converting ffmpeg to as3 with alchemy? there are a lot of filecontainer that we can use for video converting. that would be a cool project. right now i failed for the converting. i only was able to convert a mkv c muxer to AS3.

    have a nice weekend.

    • UnitZeroOne says:

      Gary, yes, I have a working compile of FFMPEG being used by a Flash project, using alchemy conversion. The problem with compiling it using the current version of Alchemy lies in a bug which I will cover in the particle sessions.

      • gary says: got a working swc of ffmpeg… cool..when you write a book about the convert process i would love to buy it :)

        is there a chance to know how you have done the ffmpeg converting process or is it possible to get a lib,license, payed support?

        • UnitZeroOne says:

          The specific implementation is not just a swc of just ffmpeg, but a wrapper with AS helper functions, for for instance streamed input and output, asynchronous execution and codec initialisation + memory management.

          That wrapper is not just for FFMPEG, but more a generic implementation with adapters for differing projects, I have built for Aviary, and won’t be available for the public.

      • gregs67 says:

        I’m searching for a while someone who had a working .swc of ffmpeg compliled with alchemy.

        Can you send me it ?

  4. Zhonghua says:

    Thanks to this. I started to see my dog in particles…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.