Articles Archive
Articles Search
Director Wiki

Teaching Old Turtles New Tricks: Artificial Life Simulation Using Lingo, Part 1

May 23, 2001
by Andrew M. Phelps & Daniel R. Kunkle

The new and expanding interdisciplinary field of artificial life (A-life) is not yet well defined and will mean various things to different people. [2000] states broadly "The term Artificial Life is used to describe research into human-made systems that possess some of the essential properties of life." This article details the simulation of one such lifelike system implemented using Macromedia Director. Though many of the ideas and techniques relating to a-life that are explored in this project have been studied for many years, this project breaks new ground as it uses Director to allow the user to easily visualize the lifelike processes occurring within the simulation.

Specifically, this project aims to explore the visualization of two components of complex, lifelike systems: decision making and evolution. This article contains four main sections, the first describing the simulation interface and it's components, the second detailing the underlying representation of individual life forms and their environment, the third exploring the mechanism for decision making along with other life like features and the last concerned with the use of a genetic algorithm for the evolution of artificial life. Additionally, possible future explorations for the project are proposed.

The Simulation Environment

Tutorial File Setup

This project was developed through a seminar in artificial life involving faculty and students of the Department of Information Technology at the Rochester Institute of Technology. It's main goal is an introduction to the simulation of lifelike functions in an artificial environment.

To get started, take a look at the Shockwave demo. Starting the movie will create a number of artificial life forms and start the simulation. This group of life forms is the first generation. They will begin performing actions based on their genetic code. These actions may involve changing their movement speed and direction based on a number of perceive environmental conditions and consuming food to survive.

Figure 1: View of simulation, running with default parameters and variable setup.

Visualization of Life

The moving, blue forms represent the living individuals. They are sometimes referred to as "Turtles" because of their Logo-based heritage. The plane of green and black squares represents the land that the individuals move on. These squares are termed "patches". This term comes from StarLOGO [MIT, 2001], the simulation tool on which this project's environment is based. The more green a patch has the more food it contains. A turtle will eat when it is on a patch that contains food. Eating is the only way a turtle can increase its energy level. A turtle is constantly using energy to maintain the functions of life and will spend energy faster when it moves more quickly. So, a turtle must spend energy to move to find food to get more energy, just like real life. If a turtle is unable to find enough food, its energy level will reach zero and it will die. When a turtle dies it becomes red and is placed in the "graveyard" at the back of the environment.

After a certain amount of time the simulation halts and reproduction takes place. The population replenishes itself with a new generation of turtles and the simulation restarts. The generation number and the time left until the next generation will be generated are displayed in the upper left along with statistics detailing how well the last generation fared, including the number of individuals that survived the last generation (out of 72) and the average age of all of the individuals at the end of the last generation (a maximum of 350 if all individuals survive to the end).

This simulation is set to start with no automatic rebounding behaviour to keep the turtles on the board. In fact, you may notice a substantial number of them flying off in all directions in the first few stages of evolution. Over time however (10-20 generations) you should notice that many of the turtles develop their own rebounding behaviour (as well as a number of other behaviours which this paper will describe). Such was our intent - to allow an object to develop behaviour without explicitly programming that model into the object. Turtles rebound because by doing so they can continue to get food, and live longer, both of which are goals of the overall ecology.

The controls in the upper right change the user's view of the world, allowing them to move and zoom their view relative to the scene. Experiment by watching turtles close up to note their individual difference, and by zooming out to note the trends in the entire population.

Simulation Engine

Patches and Turtles

The entire basis of this simulation revolves around two very important concepts, the "turtle" and the "patch". The "turtle" traces its heritage back to the MIT "Turtle Graphics" work, which was first presented by Abelson and diSessa [1980]. Also of interest are the similarities of this work to the "vehicles" presented by Braitenberg [1984, 1996]. A "turtle" has the following characteristics: it can perform a limited number of self-contained actions, and in the original implementation these were geometrical. Examples of simple actions were things like move which would move a turtle along its forward vector the number of units specified by its speed. Additionally it could turn right or left, set its speed to a different value, and (by combining these actions) rebound itself from collisions. The turtle can be thought of in programming terms as the collection of a local coordinate system within an object, with the methods of that object providing manipulation of that coordinate axis. Additionally, turtles usually had the ability to represent themselves, as some element that is drawn to the screen, in our implementation we have given the turtle a sprite property, and it uses that sprite to represent each turtle, or instance of the object (see figure 2).

Figure 2: A few instances of the turtle object visualized as blue 'mushrooms' on the ground.

Andrew (Andy!) is a professor at the Rochester Institute of Technology (RIT) serving in the Dept. of Information Technology, specializing in Multimedia and Web Programming. He is developing a game programming curriculum, with an emphasis on Lingo based solutions as well as more traditional approaches. Visit his home at Dan Kunkle is an undergraduate in the Information Technology program at RIT. Artificial Life and Genetics are his passion. He hopes to pursue this line of study in graduate school as well. Andrew Phelps says that he's a fabulously smart kid.

Copyright 1997-2019, Director Online. Article content copyright by respective authors.