Playing With Particles Pt.2

Since my previous post I have had a chance to play around with a very basic implementation of soft body physics in Flash, using Verlet integration. Using lots of particles constrained into one blob would have required far more processing power than is feasible, and hopefully using Verlet integration will give the results I want without such a great performance cost. A very useful introduction and further details about the basics of the Verlet integration method can be found here, from Thomas Jakobsen. This paper describes in brief the algorithms that were developed for IO Interactive’s game ‘Hitman: Codename 47′, the details of the Verlet integration are abstract enough that they can be applied elsewhere. In this case, AS3!


After much trial and error I was able to get a simple version of verlet integration running for my blobs. After more tweaking, and adding a secondary internal boundary for stability, I was getting somewhere closer to the end result I wanted. As you can see there are still issues when the blobs collide with each other, and when the force applied to the blob is too great it can sometimes fold in on itself.

For this reason I decided to try and adapt some of what I had here and combine it with both the fluid filters I had already come up with, to merge boundaries, and the particle engine to control the position and velocity of the blobs.


Using a tweaked version of the soft body physics blobs (to fix some of the more erratic behaviour) I have so far only added the fluid filters (as shown above). Controlling the position of the blobs using Flint is proving to be a little more tricky and will likely require some reworking of the Verlet integration used. The performance at smaller scales such as above is quite satisfactory, but scaling it up to the large resolutions I will need means the frame-rate dropping to 10fps and below when a large number of blobs are colliding. Hopefully I can regain some of the lost performance by doing as much of the bitmap processing in Pixel Blender as possible, and controlling the particle motion with Flint.

Posted at Feb 11th | 1 comment | Filed Under: Coding read on

Playing With Particles Pt.1

I have recently started playing around with particles in Flash for an upcoming project and thought I might share some of the results I have had with the FLINT particle system. You can click on the examples to move the particles around.


I started by experimenting with the basic behaviours and actions available in FLINT. Combining different actions such attractors, velocity matching, minimum distance, collision and many more allow you to quickly and easily come up with complex particle behaviour and flocking.


I then used some basic filters to create a fluid effect when particles are close to each other, a bit too much like a lava-lamp for what I want, but nice nonetheless! Ultimately I want to create large ‘blobs’ with boundaries that can ripple and respond to collisions in a way that is convincingly fluid-like. I did some quick tests (shown in the video below) to try and achieve this, but the CPU usage is far above what I will have available for this project. Hopefully I can get something similar to this running efficiently enough to work on a Mac Mini. I think I may end up using a combination of what I have here along with an implementation of soft-body physics using Verlet integration, however, that in itself is likely to be rather CPU intensive so I think more research is needed first…


Watch ‘Blob Test’ in HD from birdsigh on Vimeo.


Read Pt.2 of ‘Playing with Partilcles’…

Posted at Feb 6th | 1 comment | Filed Under: Coding read on

My Flickr

Self Aware BananaLewis Floyd HenryArtviewTempted...Friday ChatRouletteHow To DoodleMore Mish FaceSketching in HTML5A week at AllofUsFixie Polo TournamentBone MarrowiPhone BoxesPraha At NightMetronome DancePraha Castle ChurchStrictly No Fun AllowedGuardingZMRDI