Nature of Code – Autonomous Agents

This week for Nature of Code we were asked to work with autonomous agents. I started with an example Sketch by Dan Shiffman designed to keep a vehicle within a boundary. I played with this sketch for a while and eventually ended up making a sort of flocking type behavior. I really wanted to try and work with prototyping again so I spent a good deal of time getting that to work the way I wanted.

Screen Shot 2016-03-02 at 1.51.22 AM

 

I ended up with three slightly different vehicles. The standard prototype Vehicle basically follows the same rules as in the example, It turns around once it passes a near edge boundary. One of the child vehicles that I called shyVehicle will tend to follow the same path as any other vehicle that passes it. These shy vehicles tend to form flocks. The other child vehicle is called soulmate (misspelled as Souldmate). These vehicles have a predetermined mate, until they meet their mate they act like the standard vehicles but once they find their mate they try to flock with it. One of the three vehicles is randomly generated each time the users clicks, up to a maximum of 50.

Screen Shot 2016-03-02 at 2.41.22 AM

Screen Shot 2016-03-02 at 2.10.00 AM

 

 

Using the prototyping was still tricky for me but I eventually figured it out which should be really really useful for creating more complicated sketches. I would have liked to spend more time on the appearance of this sketch but I was happy with the work I was able to in the structure of the code.

 

Vehicle sketch

Leave a Reply

Your email address will not be published. Required fields are marked *