LifeBox community project

By Russell Barnes. Posted

Creating artificial intelligence on the Pi may sound like the start of the robot uprising, but the LifeBox isn’t taking any chances, and has imprisoned them in lights…

The full article can be found in The MagPi 35

There are so many different type of light-display projects on Raspberry Pi that you could be forgiven for thinking that the LifeBox was just another neat little programmed series of LEDs. This would be a huge mistake to make because the little lights are a lot cleverer than you could imagine: they’re alive. Well, sort of. At the very least, they have been programmed with behaviour. Instead of launching into a thesis on when artificial intelligence can be classed as alive, we’re going to concentrate on the LifeBox itself. Here’s what it says on the side of the box:

“In this box live two pixelic entities, the blue and yellow species. These two species compete to survive and reproduce, feeding with the white mana that grows under [their] feet.

“Each species has eight configurable variables that can change their behaviour. The white mana also has five parameters that determine their behaviour and also rule the future of the two species that feeds.

“Learn the basic concepts of programming and biology being the god of these entities, varying all the parameters and seeing the consequences of your actions in the LifeBox!”

 Powered only by a Raspberry Pi, the AI isn’t quite able to take over the world, but it makes for a really cool experiment

Its creator, Ferran Fàbregas, explains it to us in a less poetic manner, but one that makes more technical sense.

“LifeBox, in short, is a virtual ecosystem simulator on a 32×32 RGB led panel,” Ferran tells us. “It’s composed of two species that compete for the resources (mana) to get energy, survive, reproduce, and grow.

“Both species and the mana (which actually acts as a different species itself) have a user-defined parameterization that allows [the user] to change their behaviour and see the consequences on the panel, acting as a god of the virtual ecosystem.”

Ferran’s god complex has been with him a while, as well as the interest in simulating these kind of ecosystems:

“Since I was a child, I was attracted to robotics and the possibilities of simple life simulations. I programmed some basic life simulators software before, but one day I found a shiny, beautiful, and cheap 32×32 RGB LED panel at a fair and I decided to create the LifeBox. I was captivated by the idea of seeing the evolution of a programmable ecosystem on a beautiful box on my dining room [table], like other people can enjoy with a fishbowl.”

Inside the box is just a Pi, the LED panel, and a driver to connect the two. Because of this, the code is split up into two sections: one part to control the driver, and one part that controls the simulation.

 The most interesting night light you’ve ever used: maybe it will be this decade’s lava lamp?

“The driver is based on the great work of the original C++ driver by Henner Zeller and a reimplementation in C by Peter Onion with slight modifications,” Ferran explains.

“The simulator is build in C and the main goal is to maintain it as simple as possible, so anybody can change not only the species parameterization but also the simulation algorithm itself (although this is not the objective, because it can result in an unusable LifeBox situation).”

The whole thing is configurable via specific files, and you don’t need to recompile it each time either. The code is still being improved, and you can find it on GitHub, or, if you really like the project, you can look at getting one of the LifeBox kits by checking out the crowdfunding page.

From The MagPi store


Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.