Show HN: Richard Dawkins’ Biomorphs Implemented in JavaScript
emergentmind.com
emergentmind.com
Heres's also a fun little video of vintage Dawkins showing off his program: http://www.youtube.com/watch?v=oDxaCJmlIGo
I have fond memories of programming variants of Dawkin's Biomorphs program in my early teens. I even sent him one of my creations, to which a grad student of his replied with kind encouragement!
I have other JavaScript-based emergence and artificial life projects planned so if you liked these, you should sign up for the mailing list to get notified when new projects are released: http://www.emergentmind.com/newsletter
If anyone reading this finds these topics fascinating as well I'm always down for a chat: matthew.h.mazur@gmail.com or @mhmazur - cheers!
I wrote a small script that evolves them based on a scoring function, paste in your console and run evolve(1000, score)
function evolve(numGenerations, scoringFn, stepInterval) {
var children = document.querySelectorAll('[id*=child]'), generation = 0
if (stepInterval == null) stepInterval = 10
function run() {
var i, child, ctx, data, score, winner, winningScore = -Infinity
for (i = children.length - 1; i >= 0; i--) {
child = children[i]
ctx = child.getContext('2d')
data = ctx.getImageData(0, 0, 318, 148)
score = scoringFn(data)
if (score > winningScore) {
winningScore = score
winner = i
}
}
children[winner].click()
if (++generation < numGenerations) setTimeout(run, stepInterval)
// console.log(winner, winningScore)
}
run()
}
function score(imageData) {
var i, r, g, b, rv = 0,
data = imageData.data, l = data.length
for (i = 0; i < l; i += 4) {
r = 255 - data[i]
g = 255 - data[i+1]
b = 255 - data[i+2]
a = data[i+3] / 255
rv += (r + g + b) * a
}
return rv
}I'm going to shamelessly plug two abandonware projects of mine, being an agent-based neural network evolution sim [3] and a spatial game theory lab [4]. These might be interesting to people who like this kind of stuff.
But there's a huge amount of other stuff out there, e.g. projects like DarwinPond and prolific researchers like Martin Nowak [5].
[0] http://www.youtube.com/watch?v=ouF8wKxXWFQ
[2] http://adamilab.msu.edu/wp-content/uploads/Reprints/2003/Len...
[3] https://github.com/taliesinb/floatworld/wiki
"Artificial life links": http://www.alcyone.com/max/links/alife.html
International Society for Artifical Life links page: http://alife.org/links.html
Zooland Artificial Life links page: https://sites.google.com/site/myzooland/
My favorite is Darwinbots, which has a lot more physics and features and things to tinker with than the average simulation. You can also directly program the bots to do whatever.
When the biomorph gets too big for its canvas, I automatically reduce its branching depth until it's not too large. If you keep clicking on children that make it evolve towards larger entities, eventually it will shrink and look something like the biomorph in your screenshot.
Someone suggested that rather than automatically reduce its size, I should just make them unclickable (ie, you can only choose a child that fits within the canvas).
What do you think? Any other ideas?
Edit: I just updated the implementation so that instead of automatically reducing the child biomorph's size if it's too large, it simply becomes unclickable (you'll also get an notice if you try to click it). Should be a bit better -- thanks for the nudge!