Ziff-Davis Enterprise 
DevSource: Microsoft Developer Resource
Add OnsArchitectureLanguagesTechniquesUsing VSForums
 
Home arrow Using VS arrow A Bug in the Terrarium
A Bug in the Terrarium
By Lynn Greiner

Rate This Article:
Add This Article To:
This multi-player game for developers tests aspects of the .NET Framework and the CLR. It teaches you about .NET programming. And boy, is it cool!

There's a bug in my program, and I'm delighted.

No, really — I created this bug on purpose. It looks rather like an ant with an attitude, and it's prowling the landscape of the Terrarium, in search of prey. It's kind of small now, but give it a snack and it will grow. Assuming, that is, it doesn't get eaten first.

ADVERTISEMENT

The Terrarium, you see, is a multi-player game for developers, based on .NET, in which competitors create plants and critters (both carnivores and herbivores) and turn them loose in a peer-to-peer virtual world. A piece of the world lurks on your PC. The game "teleports" creatures from place to place, so your local slice of the ecosystem is constantly invaded by foreign bugs, and your bugs can go a-hunting elsewhere on the network. Every six minutes, stats get sent to a central server for aggregation and reporting.

Microsoft developers built the Terrarium as a proof of concept, to test aspects of the .NET Framework and the CLR, according to Mitch Walker, program manager with the Longhorn SDK team and the current owner of Terrarium (to "meet" its original authors, check out this episode of the .NET Show on the Web).

The public first saw the Terrarium at the Microsoft Professional Developer's Conference (PDC) in 2001, and it took the place by storm. People lined up to get onto a machine in the hands-on lab and design a critter. It got to the point, said Walker, that it disrupted the other components of the lab.

As a peer-to-peer program, Terrarium has the potential to effectively disrupt a network, or its host system, as well. Walker says that Microsoft's developers learned a lot about efficient networking from Terrarium. They even use it internally as a stress tester.

It's also a great way to learn about .NET programming. When you install the game, you get tutorials and sample code, and the online Terrarium Farm offers all sorts of useful code snippets and algorithms to download. For example, there are skeletons for a carnivore and an herbivore, a "decide to attack" algorithm, and an avoidance routine to help your beast sidestep becoming another creature's lunch.

When you build your beast (in C# or Visual Basic .NET), you have complete control over everything from genetic traits like eyesight, speed, defensive power, and attacking power to behavior attributes, like the way it locates prey. The creatures can even reproduce, and you determine the rules there, too. You can build a menagerie and see how it fares.

Once development is complete, you compile the code into an assembly (dynamically linked library, or DLL) and load it into the local ecosystem slice, where ten instances of the critter will appear, viewable through the Terrarium console.

Then you watch to see how successful your design is, as it prowls its virtual world, hunting and feeding and mating. If it encounters the blue teleportation ball that randomly wanders the screen, it will disappear, only to materialize on someone else's Terrarium desktop. The game tries to protect your system if any beasts get too successful — the critters get sick and die if the population is too high. In newer versions, according to the FAQ, carnivores will attempt to restore balance the natural way before the sickness algorithm is invoked.

Walker says he is winding down development of the current Terrarium. He is thinking about a version that will run on Longhorn, the next version of Windows, and take advantage of features like Avalon (the new presentation subsystem) and Indigo (the Longhorn communication subsystem). Walker plans to make the new game more customizable and extensible as well. But that doesn't mean that we can't continue to enjoy this version; it just means we can look forward to a treat in the not too distant future, maybe as soon as the PDC in September.

Meanwhile, however, it's a bug eat bug world out there — and, darn it, someone just ate mine.

Back to the drawing board.

Want to come and play? You'll find everything you need here.


Discuss A Bug in the Terrarium
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Using VS Articles          >>> More By Lynn Greiner
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog

Julia explores the Robotics Studio! (It's for more than you think.)

MSDev Blog

Messages for Bill Gates!

Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.