13.7.09

Something not technical

I was playing my mom's keyboard last week when I realized that I don't know any songs for piano. **Mary Had A Little Lamb does not count.** I took piano lessons for years and years when I was younger, yet here I am struggling to remember even a single song. I finally did remember a song, but was one I had written my freshman/sophomore year of college. Surprised that I remembered all the words, I thought I'd keep a record of it on soundcloud.


I don't consider this a finished 'piece' because it lacks polish, but it's interesting if only because the song is so different from what I normally work on.

3.7.09

Ichigo Flock Simulation



These guys above are way fun to play with! (those of you in an RSS reader will probably have to click through.) Click on the stage for more boids.

I started this project with Phil a while back and have decided to stop working on it, at least for now. Ichigo was my introduction to programming in Actionscript 3.0 but also turned out to be my introduction to boid theory. Every boid above has several forces that influence its interactions, including:

  • alignment: heading towards the mouse cursor
  • cohesion: heading towards the center of the flock
  • separation: maintaining ample distance from flockmates
  • steerResistance: momentum that provides resistance to turning or stopping
  • randomness: some slight randomization of their movements
Our codebase allows flocks to collect Collectables, avoid Obstacles, and even merge with other flocks (although the above demo doesn't show this functionality). Eventually I hope to add more support for dynamic sound generation via flock behavior as well. This was meant to be a game prototype, but as you can see, not a lot was implemented except for the core functionality :P

One of the trickier bits during the process was telling the boids which direction to face. Simply pointing them in the direction of their velocity vector resulted in boids that could instantaneously flip their faces from back to front or left to right. Not only did we end up interpolating the sprite's rotation, but we also programmed each boid so it begins to turn only if its new velocity vector is at least theta degrees away from its old velocity vector. This last adjustment resulted in more flock-like and fish-like behavior.

The public build is here, and the source code is of course up on github if you're curious.