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.

Why removing evolution from science textbooks might not really matter

This needs more thought, but writing this has helped me to join up a few ideas I was stewing over with my coffee yesterday morning while my son was napping. So I’ll publish this as is, and your thoughts are welcome.

Question the Answers
Question the Answers

While it’s useful to teach the fundamentals of physics, chemistry and biology in schools, I think what we need to start with and to prioritize is teaching the scientific method, the importance of curiosity and the need to question the answers. As an aside: Question the Answers is also the name of my favourite Bosstones album.

Rather than teaching the latest and best hypotheses, we should be showing kids how science as a whole works. How a community of disparate researchers come to agreement on an idea, and how people continue to challenge that idea as best as possible even when it looks like we’ve answered the question well. The value of a published scientific paper is more than just the text it contains; it’s the fact that it has been offered up for critique by the rest of the world, and it has passed this initial test, at least for now. Until people understand the differing value of the words in a newspaper opinion column and the words in a scientific publication, we will struggle as a society to make sound decisions.

This doesn’t mean everyone has to be a scientist, but ideally everyone would know enough to understand what “scientific consensus” means, and not to be surprised when every other day their favourite newspaper is giving them the latest contradicting health advice from “scientists”. Rather than complaining that “scientists keep changing their mind”, we would instead hear people praising scientists for never really making up their mind (which is much more difficult to do). And in this ideal world, people would know enough to understand what a double-blind controlled clinical trial is before they spend money on alternative medicine (though they should of course be free to take whatever medication they want).

The information people need today to research important issues is widely available online. But without an understanding and appreciation of the value of the real scientific process, it’s easy to get lost in a world of pseudo-science websites trying to sell you fifty shades of crap. It’s also worth noting that the the pseudo-scientists and propagators of urban myths spin a fine yarn, and the scientific world can definitely learn from their methods.

It’s good to see that people are bridging the communication gap between the world of science and the general public, without compromising the integrity of the information provided. And in this world of multi-directional communication, the communication itself gets a form of peer-review if the publisher is doing things properly. Rigorous science can be served up perfectly well alongside animated GIFs and cats in space, though I’m going a bit off track with my thoughts here.

What I was thinking about over coffee was that the future of scientific journals will surely require an open-access model to replace the currently prohibitive subscription models and, as an aside, that covering the cost of publishing these journals would be an amazingly good use of public funds given the value it would offer to society in relation to the cost. It would be interesting to compare what Wikipedia has done in terms of access to information versus the public funds spent on distributing educational content in recent years; especially on a global level.

Even if the scientific journals that exist today don’t change their business/access model, it only needs one challenging system to make the open-access model work, and in turn to make the existing publishers obsolete. Again, think of Wikipedia, and then Encarta and then Encyclopedia Britannica.

I’d like to think the future of peer-reviewed science will look something like Stack Overflow does today, where consensus on best-practice programming (including chunks of computer science) bubble up from constructive public debate, and it becomes easy for a member of the public with a small amount of knowledge and an understanding of the process to find a tried-and-tested answer to their given question. And if the answer fails for them in practice, to feedback into the process.

This is a consensus, not a debate.

When people understand the scientific method, we can stop using silly phrases like “climate change debate”, and the media will struggle to profit from their deliberate distortion of scientific discoveries. When the scientific method is understood, it doesn’t really matter if some people want to remove a topic like evolution from their local school syllabus. All the evidence, debate and research children need to read in order to understand why evolution makes so much sense is available online right now. They just have to be curious, connected and aware of how science (as a whole) works. And while children have always been curious, today they are more connected than ever.

If the Stack Overflow of science emerges, peer-review and the scientific process can move from being an abstract concept (which is all they are to most people) into something laypeople can witness, interact with and review first-hand. It may not even need specific teaching in schools. Today, if you want to learn how to program or build websites, you don’t need to enrol in a class, you can just start doing. And the people who do, very quickly find themselves reviewing the discussions and conclusions on Stack Overflow.

So maybe we don’t need to worry about the specific topics on the science syllabus any more, so long as we teach the principles of science. After all, it’s the job of the next generation to prove our theories wrong anyway.

Interwoven with bits

The Internet, as a malleable collection of bits, responds to and evolves with the cumulative needs of the connected human race. It rewards, condemns or ignores elements of itself in line with our primitive human desires; growing in places and dying in others. So we, as human beings with our natural, non-digital desires, shape the Internet.

Simultaneously, the Internet changes how we (cumulatively at least) behave. It creates and destroys jobs, it makes and breaks marriages, and it redefines where, how and with who we live and share our lives. And at the deepest level it rewires the chemical makeup of our brains by changing the way we think, speak and remember. While it divides two generations, it keeps them in touch.

We and the Internet are now dependent on one other; we are interwoven with bits. As we shape it, it shapes us.

Just as we are interwoven with books, advertising, commerce, tools, religion, industry, government, agriculture, transport and much much more.

This is not something to be afraid of, but it’s something worth trying to understand.

On Pokemon and evolution


This week I’ve been reading Richard Dawkins’ The Blind Watchmaker and The Devil’s Chaplain, thinking about evolution, and how this topic could be better taught in schools. Or in many cases, just taught at all.

Then today, I had a lesson in Pokemon from my 10 year old nephew…

Now if we ignore the issues around the merchandising of Pokemon combined with the slogan ‘Gotta catch em all’, it’s amazing how many of the concepts required to understand evolution are already developing in the mindset of a young Pokemon fan.

My Pokemon lesson included:

  • 50+ weird and wonderful names of Pokemon species (like listening to a biologist)
  • Groupings of species by functions or appearance (taxonomy)
  • Catching wild Pokemon (wild and domesticated animals)
  • Seasonal Pokemon (whose appearance changes throughout the year, like an arctic fox)
  • And evolving Pokemon (including the discernible visual lineage between one variation and the next)

So in my quick Wikipedia look into the subject, it made sense to read this:

“The concept of…[]…of Pokémon, stems from the hobby of insect collecting, a popular pastime which Pokémon executive director Satoshi Tajiri-Oniwa enjoyed as a child.”

Now we just need to encourage the Pokemon fans to spend a similar amount of time outdoors looking at the countless, fascinating, real ‘Pocket Monsters’ that we share the world with.