Critters

From Air0Day Software

Jump to: navigation, search

Critters is an engine for writing small agents and simulating them in a virtual environment.

About Critters

Critters was a senior project I wrote with two friends as an undergraduate. The basic idea is loading large numbers of very simple autonomous agents that can communicate with each other and consume resources. It was used to simulate various 'life' models such as algae, as well as a number of 'fun' simulations such as the 'zombie' simulation which pitted fast-moving humans against slow-moving zombies to see how long it would take for all of the humans to be eaten.

'Critters' was only our nickname for the project. The real name was S.L.I.D.E. (Simulated Life In a Distributed Environment), and the project was meant to spread across multiple distributed machines to host the extremely large environment for the agents. The shared memory model used was MPI. The library was written in C and, therefore, so was Critters.

Each machine that ran the engine focused on its own section of the world. These sections were restructured according to load in each section during the simulation. Each section was divided into a grid, and all interactivity between agents (see, talk, shout, etc) was restricted to adjacent gridspaces. Each processor shared bordering columns and rows using shared memory, so that agents could collide or talk to each other on different machines, so long as they were on adjacent borders.

You could connect a renderer (written in Java) to any given machine via TCP/IP and watch an animation of the simulation as it was happening on that processor.

Download

Critters cannot currently be downloaded, as I'd like to remove the dependence on the MPI library as well as rewrite the application in Java for multiplatform support and an easier api for writing agents (writing them in C is a pain).

Screenshots

Here are some screenshots of the renderer, connected to different simulation instances.


Image:Algae.jpg Algae Demo. This demo consisted of agents that consumed resources on the map, growing in size until they could spawn another agent. As time went on, resources were consumed and spatial growth patterns would emerge.
Image:Runner.jpg Runner Demo. These were extremely simple agents, whose only goal was to look around for other agents and move as far away from them as possible. No matter what the starting configuration was for the agents, they would always end up in the pattern pictured here.
Image:Zombie.jpg Zombie Demo. An attempt to answer the age-old question: how can a small number of slow-moving zombies kill all of the fast-moving humans? In the simulation, a small number of slow-walking zombies (gray dots) spawned with fast-running humans (green dots). The green dots would run as fast as they could away from the zombies, and the zombies would slowly stalk the closest human. If a zombie got within touching range of a human, the human would be turned into a zombie. As it turns out, the simulation would eventually get to a point of all gray dots.
Personal tools