My first generative Twitter bot (with a little obsession)


/* italian version : */

I’m so happy to say that I just finished a working prototype of my generative twitter bot!
It’s part of an undergoing study on the concept of emergence, which I find quite fascinating.
As wikipedia cleverly points out,

“In philosophy, systems theory, science, and art, emergence is a process whereby larger entities arise through interactions among smaller or simpler entities such that the larger entities exhibit properties the smaller/simpler entities do not exhibit”

In this case, the resulting picture created from the bot is the sum of all the interactions of a boids simulation. If you don’t know what boids are, see and for a deeper understanding on the origins or watch this for a clear visualisation of the sim.
For now, I will simply tell you that a boid is a bird-oid object which is part of a simulation of the organic behaviours of a flock.


At the moment of writing my bot operates with 32 boids (so it is a 32 boid system, I suppose :) ).
Each boid it’s invisible, but leaves a painted trail behind itself.
Obviously, depending on the path and the movement of the boid, the trail will be drastically different: smooth and curvy or jagged and so on
(on a poetic plane, each trail tells the story of a boid).
And conceptually talking, that’s all!

The bot runs once per hour (for now, locally on my mac since the OF app it’s compiled for macOs) and every time it gives to the simulation 10 different parameters that regulate its behaviour.
These 10 params are randomised every time, so the rules that control the simulation are each time different and their intersection creates also different visual outputs. Also, not every parameter has the same weight on the final simulation, so the behaviour can change greatly or not depending on the current and previous value of those “leading” parameters.

( pic: a schreenshot with the app gui and the 10 parameters)

Screen Shot 2016-09-07 at 15.01.05

Technically speaking, this 10 params are then used as inputs for 3 basic functions that determine the behaviour of the boids flock. Many more functions will be added as soon as the simulation becomes more and more complex.

The functions model the flock using this beautiful formula, created by Craig Reynolds:

steering = desire – velocity

in order to move the boids according to their current desires.

Each of these terms is a 2d vector.

The formula says the following thing: steering is how much the boid moves towards a certain direction, and is a vector pointing from where it is currently moving (velocity) to where it wants to go (desire).

The desire of a boid depends on the parameters (and in the future also on the distance from the boid and its desired target, as it is for the follow behaviour).

Sure enough, basic Calculus says that when we subtract a vector A  from a vector B we get a vector pointing from A to B.


Currently, the functions (or as Craig Reynolds calls them: the behaviours) are:

1.  Align: each boid has the desire to have the same orientation has the other boids

2. Separate: each boid has a desire to separate from the other boids

3. Get attracted by flow field: each boid has a desire to follow the underlying flow field (more on this later, for now just consider it a 2d matrix full of random 2d vectors)

The most intriguing thing in this kind of approach, I think, is that a few basic relationship rules mixed thanks to a small number of parameters we can achieve every time a singular and different “painting” (double quotes are uber-necessary). This brings us back to emergence: the interaction of small entities creates a larger entity with emerged properties.


This is a personal study, so the article will probably get updated as I make some progress, but for now that’s all, folks.

If you’re interested in emergence, I highly recommend watching the following video by Casey Reas, one the creator of the Processing software.

Finally, here’s the link to the images generated from CCRTDROID, my bot: .

Lascia una risposta

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *


È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">