![]() |
| ![]() |
Note: This project has been superseeded by the Mechasphere project as of 11/18/2004.
Last updated 10/17/2004
Download the VB.NET Project (Source Code)
Video Captures
Introduction
How to Use It
Your Feedback
The purpose of this project is simple: provide a "world" in which AI research entities can "live" and interact with a sufficiently rich environment. History has shown me this is not necessarily an easy thing to do for a lot of AI and A-life researchers. Their focus is mainly on the complexity of the brains or factors of evolution. As a result, they largely tend to develop feature-poor worlds, often around the venerable cellular automata (CA) model. (If you don't know what a "CA" is, they almost all look like checker board-style grids with different colored cells. "Conway's Life", with its black and white cells is the most popular example.)
While I've done my share of CA-type worlds, I believe a rich environment is important for doing rich problem solving. I decided to spend a little time now as I gear up for my next series of AI research creating such a world. Since I've been making my living lately developing with Visual Basic .NET and because of the benefits .NET offers, I decided to build this world using VB.NET. I know it doesn't offer the fastest execution speed, but it does really make coding much easier and helps to hone my own .NET skills.
I wanted to make this freely available to other people with similar interests. It may also serve as a helpful model of a physics engine to game programmers.
Take a look at the screen shot to the right, which illustrates a sample world constructed as I'm building and testing this program. In it, you'll see examples of each of the following types of entities that can exist in this world:
It's actually pretty fascinating to watch this sample world in action. The three free particles are linked to one another with simple spring-type links, so they move together as a single entity. Because the links are springy, you see the collective entity is "squishy" as it hits obstacles like the outer walls, barriers, and other particles.
Want to see more? Check out the videos I captured of runs of some of the test worlds I've created.
First, you have to know how to program in .NET. VB.NET is the easiest choice, but if you're more comfortable with C#, J#, Perl.NET, or whatever else, you can always change this project to output a DLL instead of an executable. Then you can create a reference to this project in your own project and start creating your own derived classes, UI, etc. in your preferred language.
I've endeavored to add lots of comments to the code and to make it as understandable as possible. For those who want to understand how all the data structures, math, and other algorithms work, you'll find the techniques and comments very helpful.
You'll find this project is very object oriented. I believe an AI or A-life project with a rich world is best implemented with three basic layers:
The current state of this project is such that only the first layer is basically done. I'm continuing my work now into the second layer, and I'll include it in this project as a helpful starting point for other researchers, too.
You'll find the essential machinery located in the World folder in the project. You'll find there the following classes' implementations:
The Planet class has a series of collections; one for each type of object
you can create within a planet. It also has a .Tick() method, which executes a single moment of time. With each tick, the free particles interact with their environment. This is actually a fairly complex process already, but if you study the algorithm, you'll see how all the forces in the system interact because they're clearly delineated and well-commented.
The Robotics folder contains the beginnings of an experimental world I'm working on to turn particles into robots. I intend to derive new classes from Particle and Link to engender computing, sensing, and motive power. For example, I intend to make it so certain kinds of particles can store energy and impart it to, say, thrusters. Thruster is derived from Particle and includes a reference to another particle it uses to determine which direction to apply thrust. Similarly, I might derive a single-pixel eye from the Link class, again because of the inherent directionality. I will probably also derive a sort of muscle class. Energy consumed by one will serve to increase or decrease a connecting spring-type link's resting length, thus applying force to expand or contract it.
The Viewer folder contains the UI code that provides the means for users to watch and interact with the world. There are simple means to zoom and pan (right-click while zoomed in and you can pan around easily). You can left-click on any particle and drag it around. Let it go while moving the mouse, and it will keep moving in that direction, so you can push particles around at will. You can take individual steps to see what's happening or resume full-speed motion. Also, if you're picky about optimization, you can make a small modification to make use of threaded execution instead of having it synchronized to a built-in timer.
In the latter stages of development of this product, I added support for XML files for configuring whole worlds. You'll probably find this preferable to hard-coding all the constructs. One reason is because you can simply modify the XML and hit the "Restart" button to load the latest version. Another is because it has an inheritance model that allows you to define a "segment" -- perhaps a leg composed of many particles -- and then reuse it in a different place, but with other modifications to angles, colors, sub-positions, and so forth. And you can instantiate a defined "body" any number of times to populate a planet.
One interesting feature of the viewer is that with each run, it creates a trail of GIF images in bin\Frames\ -- once every fifth frame you see on screen -- that I used to assemble the videos I've included here. You can easily do likewise if you get a utility like GIF Construction Set. Also, you can easily turn this off if you want to see the application run faster. Look for the SaveFrame() method in the SateliteView module and add a "Return" (or "End Sub") statement right at the top of its code to disable the feature.
I hope this gives you a sense of how much richness can be readily incorporated into this world. And I invite you to take the source code for your own use. It's still a work in progress, so I encourage you to come back again to track progress and get upgrades.
Send me email. How to Use It
Let's say you wanted to use this for your own project. How would you go about it?
Your Feedback
I encourage you to let me know if you intend to use or are using this in your own projects. Does this help solve some problems for you? What limitations get in the way of your research? To be sure, I don't really want to be a help desk for the software, but you're welcome to ask if you want some advice on how to apply these concepts to your work. Drop me a line.

Produced in cooperation with Carnell Information Systems, Inc.