How I Spent Christmas

Warning: I am not a biologist. I am not even a scientist. I am just a foolish game dev who's read a little bit on biology and decided to explore some of the ideas in code without the benefit of seeing what's already been accomplished in this field. My assumptions will be wrong. I will make major mistakes. If in doubt, seek a proper scientist. Do not pass Go. Do not collect $200.


For quite a while now, I've been pondering some fairly heavy stuff. Ideas that are probably far outside my usual bailiwick.

One of them is in relation to emergent behavior and biology.  If you're not familiar with emergent behavior, the simplest way to describe it is a more complicated, unplanned construct formed from interaction of simpler components.

Can you identify which
one stole your purse?
Snowflakes are often a good example of this in nature. A simple consequence of molecular structure and atmospheric conditions causes a nearly infinite combination of visually pleasing, often complex designs.   And those designs have even greater consequences.  The flakes accumulate, causing snow to form.  And that snow caused Jessica to start her own snow plowing company, which now has 12 employees, etc, etc.

Why am I here? For the powah...
Humans are almost entirely composed of oxygen, carbon, hydrogen, phosphorus, calcium, potassium, sulfur, sodium, chlorine, and magnesium.

And that bag of chemicals lounges on the couch binge watching House of Cards on Netflix.  Other chemical bags also created the show.

And that's basically what got me thinking. The last year or two I've been doing a lot of reading on biology, how cells work, and so forth.  It's absolutely fascinating stuff.  (In a parallel timeline I totally got into that field.)

I decided to take Christmas Day off from my other obligations and just kind of explore some of my ideas using Unity.

What was the idea I was interested in looking at? Cells multiplying based on their DNA programming. Each cell has a copy of the human 'source code'.  I wanted cells to multiply based on a layout specified in a bytecode script.

Rather than go full on with what I was thinking (which is what usually gets me into trouble), I wanted to paint this with very broad strokes, at first.

So no scripting. No "DNA".  No major genetic mutation.  Just cells replicating.

In code...

So I have an Atom class. I mean 'atom' in the abstract sense, not literally representing a real atom. This is simply the smallest, indivisible unit. (I didn't want to be a jerk and call it a 'cell' for some reason, but I needed something. In retrospect this was ridiculous, but the bed is made!)

An Atom object can "bud", meaning it copies itself, undergoes minor mutation of its parameters (currently just it's size), and then attaches the new child to itself.

Actual e.coli just
doin' it's thing.
Each Update() cycle, I walk the tree of Atom objects and Bud() each one, growing the tree... around this point you should be absolutely panicking and trying to throw the Wikipedia entry on exponential growth at me.  Trust me.  I know. I bloody know. I had to murder the Unity process at least a dozen times while debugging the thing while it ran wild.

Eventually I threw down limits to contain it's growth. Each Atom object would only spawn n siblings. And there was a maximum number of generations each 'strand' could hold.  Turns out 4 siblings out to 5 generations each branch was tolerable.

At first, I didn't do anything but make them grow downward on the y-axis:

So Atom objects were overlapping each other. It looks neat, sure, but there's more to do. First, I made them randomly distribute a bit along the x-axis:

And then the z-axis (after a bit of tweaking):

Looks rather neat.  

Then I added rigid bodies to each one... pop:


Aaaaand then I attached a FixedJoint component between each Atom, hooking each parent to it's sibling...

Then I tweaked the 'break force' attribute, and suddenly...

Whoa. Gettin' all astronomical in here!

I tweaked it a bit, cranked up the Generations/Siblings a bit and ran it again...

I accidentally big banged.

From what I can tell, the 'pressure' of all these objects spawning so fast in close quarters made them be violently thrown outward, causing the break force limit to be reached, but only sometimes. 

This caused entire clusters to splinter off, yet stay together.  It's kind of like gravity holding bodies together, I guess.

But damn if that isn't an interesting, unexpected side effect!  Here I was trying to naively simulate something very small, but wound up stumbling on something entirely different. Not the emergent behavior I was curious about, but I'll take it! ;)

Eventually I tried to slowly increase the generation/sibling values to see how high I could go. Here's what it looked like a couple frames after I cranked it rather high:

I have a feeling we're hitting the limits of the physics engine here, instead of discovering a new side effect.  Still, looks rather neat, and you can cook eggs on the CPU, too.

Another neat shot, flying the camera into that mess:

I assumed the spheres, especially in this quantity, were ridiculously high poly for the job. So I went into Blender and created the cheapest, vaguely sphere-like shape I could muster.  It didn't change much. 

But, again, neat visuals ensued:

So, that's how I spent my Christmas.

What did I learn here? Well, this reinforced in my mind the necessity of taking a potentially ambitious idea and doing something much simpler first.

All of this code was ridiculously unoptimized. I didn't even attempt it. Hell, I'm not even going to post it, it's so awful. In something simple like this, its best to get the basic idea out.  Make it work first. Then go in and optimize, if it's worth it. In this case, it's probably not.

There may be some value here in procedurally generating somewhat realistic looking space maps. I didn't go into this with that intention, but it's what I came out of it with.

I'll still play around with it a bit, though. If anything interesting 'emerges', I'll post an update.


Game Development Resources

Every indie game developer has a list like this on their site. Why should I be any different? :D  Let's start off with audio. More to come!

Updated constantly.  Last update: 2014 Dec 14

Sound Effects


  • Freesound - One of the biggest public collections of Creative Commons licensed sound effects. Often my first and last stop.
  • LaptopNoise.com - A large collection of random 'glitchy' computer effects free for use. Check out the rest of the site, too, for more curiosities.
  • SoundBible.com - Huge, searchable collection of Creative Commons, public domain, and other licensed sound effects in WAV and MP3 format.
  • RCP Tones - A deliciously professional collection of professionally created sound effects. Good for user interfaces, notifications, ringtones. The full collection is $35, but the author offers a subset free for use by app developers, with attribution.
  • Octave - Free library of user interface sound effects; attribution optional. Can also be contracted to create custom sounds.
  • PacDV - A decent collection of various sound effects from Pacific Digital Video. Free use with optional, but encouraged, attribution.
  • OpenGameArt.org - Open Game Art maintains a sound effects collection.
  • Transformers Animated Sound Effects - This isn't legal for use in your commercial projects, but if you're building a prototype, or doing something fun for a game jam, or some other non-commercial project, you may get a thrill throwing in some of these old school, and more modern Transformers cartoon sound effects.

Generators and Tools

  • bfxr - An extremely popular fork of the Sfxr tool, for creating your own, unique sound effects. Flip switches and sliders until things sound good and then render it out as a WAV file. Available as a desktop app, too.  (Also, check out this super pimped out version, jfxr.)
  • LabChirp - Similar to bfxr; a Windows desktop tool for creating sound effects.



  • incompetech - The master collection of Creative Commons (or no-attribution, with a fee) professional, royalty free music.
  • Free Music Archive - An interactive library of high-quality, legal audio from WFMU. License varies by title, but most are quite liberal.
  • Partners In Rhyme - Modest selection of free, royalty-free music. Only asks for attribution.
  • Looperman - "Royalty free loops, samples and sounds kindly uploaded by other users; free to use in your project"
  • OpenGameArt.org - Open Game Art maintains a music collection.

Generators and Tools

  • Musopen - A non-profit focused on increasing access to music by creating free resources; free, without restrictions.
  • Fake Music Generator - I haven't used this in anything, myself, but you may find it useful.


Whack-a-Burster (Final, Post LD48 Revision)

I finally decided I'd put enough time and effort into polishing up my Ludum Dare #29 game jam entry, Whack-a-Burster.  

Give it a shot over on Itch.io: fortyseven.itch.io/whack-a-burster

It's been a fun and extremely educational experience, but it's time to move on.  There's still some rough edges, but it's come a long way from this:

to this:

Picked up a lot of skills (working with shaders, etc), most importantly working with Blender to create new models.

While I replaced most of the found or Asset Store art with hand-crafted objects, there still remain some things not created by me.  The texture on the soldier was revised a bit, but the mesh is still the original one from the Asset Store.  The terrific UI graphics on the control panel and walls were taken from a website showcasing graphics from the movie Prometheus.  The texture on the planet was taken from a pack of planet textures obtained elsewhere.  And of course, things like flares on the laser and so forth are stock Unity assets.

Other than obvious bug fixes, and possibly the addition of a crosshair cursor (it's easy to get lost, visually), I'm done with this and I'm about to move on to more important projects that have been waiting.  I also hope to be participating in the MiniLD #53 this weekend!