Concept Game – Simple Evolutionary Model

I’ve spent enough time on this now to submit it, even if it’s still a bit rough around the edges. I’ve included a bit of a write up below. This demo will run best in Chrome or Opera. Click to play.

I’ve built a simple ‘game’ called Digital Husbandry. It’s more of a time killer as it doesn’t have any serious game mechanics, but there is a visual reward to keep the user engaged.

It’s based on the idea of simulating progressive evolution through selective breeding. Much as generations of farmers have done with livestock. The player brings together critters on the screen based on visual qualities that appeal to them, and produces offspring that drive the overall appearance of the group closer to those qualities selected by the player. The ‘critters’ die when they reach the ‘deadzone’ at the bottom of the screen, freeing up space for new critters in the population. So choosing which critters to sacrifice is as important as choosing which ones to breed.

The critters are recursively drawn from a simplified ‘genetic’ code. This allows the game to have millions of possible variations of critters, and the longer you play, the more varied the critters will appear.

I ‘composed’ some music in (which is a hugely fun distraction from fixing bugs in code). The music gets more layered and complex in line with the number of critters in the population. The audio tracks aren’t perfectly synced, but I’m happy enough with the effect for now.

NOTE: I ran into problems publishing the sketch with audio and I’ve run out of time to do any more work on this, so I’ve had to submit this version without sound.

A quick review of the Coursera Creative Programming Course, and using Processing for this kind work:

  • It was nice to write some code that isn’t about capturing web form data or sanitizing user input!
  • The format of the course, and the challenge I set myself were a good way to revise some of the classic programming concepts I don’t actually have to use much these days
  • I was jumping between Java and JavaScript quite a bit – which is a good study exercise, especially when porting code from one to the other. My basic Java knowledge is rustier than I thought, but I got there in the end.
  • Processing isn’t quite right (yet) to take a project like this and polish it into a publishable product (which is partly why I haven’t worried too much about the finer details of this ‘game’)
  • Processing is excellent for teaching creative programming
  • It was a shame to loose the sound, I had a slightly mental retro game tune going by the end. This was the base tune, which built in complexity with each additional critter.
  • I wouldn’t want to put this project through a code review! But it does the job for this assignment.


Critters Sketch in Processing

If your browser is up to scratch, here’s a little JavaScript based sketch from a current personal project…

This is some early code for a simple game I’m working on for the Coursera Creative Programming course (it’s my first time building a game rather than regular software).

These shapes are generated from a limited range of numbers, which can later be turned into a simple genetic code to define these critters.

I’ve hosted this on, so you can get to the source-code etc.