« New Modules for IIS7: Application Reques... | Main | ASP.NET MVC Preview 4 - Using Ajax and A... »

Bil Simser has just done the .NET Community a huge solid. Bil has dug up and re-released Terrarium to CodePlex wtih the intent to update it to use new language features and new usability features like ClickOnce.

If you're newish to the .NET Community (<3-5 years?) you might not have heard of Terrarium. There was a time when it was the tool for getting newbies excited about learning .NET. I showed dozens of high-school and college students how to program using Terrarium. Back at my last company one of our engineers did brown bag lunches on good bug design and ran a Terrarium Server internally.

terriarium

Terrarium hasn't been even looked at by the Microsoft SDK team in two years, as live happens, you know. Bil hunted them down, did a bunch of paperwork and it's back. You can check out the source or download the release.

You can run it alone, just a world in a box, or you can hook it up to a server and that's where it gets interesting, as your bugs all live in a connected world.

Your animals have Idle (event-based) loops that you can react to, and who amongst us hasn't wanted to write these lines of code at least once?

// Reproduce as often as possible 
if (CanReproduce)
BeginReproduction(null);

Now you have the chance.

A great lunchtime project is to get a bunch of the nerds from your company in a room, teach them Terrarium and have a battle!

Personally, I'm a lover, not a fighter, so I run away when attacked.

private void MyAnimal_Attacked(object sender, AttackedEventArgs e)
{
if (e.Attacker.IsAlive)
{
AnimalState TheAttacker = e.Attacker;

BeginDefending(TheAttacker); //defend against the attacker
WriteTrace("Run away to some random point");

int X = OrganismRandom.Next(0, WorldWidth - 1);
int Y = OrganismRandom.Next(0, WorldHeight - 1);

BeginMoving(new MovementVector(new Point(X, Y), 10));
}
}

Go check out the release of Terrarium and download the app, SDK and server. There will be more to come on Bil's Blog, I'm sure. He'll also be running a public Terrarium Server. It's exciting to see this blast from the past. Now I think it's time for me to visit a local High School Computer Science class again some lunchtime...

One of the things I think will be interesting to see, is if folks come up with better patterns for managing state within these animals. Many Terrarium animals end up with Idle loops that look like Arrow Code.

if
if
if
if
do something
endif
endif
endif
endif

This isn't nice to look at, and it would promote bad habits if it was the first kind of code someone new to programming ever saw.

The world has changed since this was released in 2002. The race is on and now I ask:

  • Who will write the first aesthetically pleasing (from a code perspective) Terrarium Animal?
  • The first F# Terrarium animal?
  • The first Ruby (DLR) Terrarium animal?
  • Boo? Nemerle? IronPython?

Enjoy!

UPDATE: I've got this running on my XP machine and my XP VMs but because of missing DirectX 6/7 DLLs I can't get it running under Vista. Possible workaround in the comments below. It'll likely be faster to just recompile it. I'll talk to Bil and see what's up.

 

Related Links



Wednesday, July 16, 2008 11:42:44 AM (Pacific Standard Time, UTC-08:00)
What is a 'huge solid?' ;)

This things rocks. I had forgotten all about it, and can't wait to start playing around with it.
Wednesday, July 16, 2008 11:46:33 AM (Pacific Standard Time, UTC-08:00)
Thanks for the link love Scott. I think an F# or Ruby critter would be way cool. Here's hoping to see popularity rise in the tool and not let this cool way to write games at work die off again. As for the arrow code, strategy pattern my friend, strategy.
Wednesday, July 16, 2008 11:52:14 AM (Pacific Standard Time, UTC-08:00)
Josh - Doing a solid is to do a kindness, a favor, a really nice thing.

Bil - I will expect to see your "Strategic Animal" within the hour, sir!
Wednesday, July 16, 2008 12:27:28 PM (Pacific Standard Time, UTC-08:00)
I've never heard of this before, but it looks really cool. I'll have to look into it.
Wednesday, July 16, 2008 12:43:53 PM (Pacific Standard Time, UTC-08:00)
Damn... I was in College when I first installed this application. That brings back some memory.

I'll install the client and try once more ;)
Wednesday, July 16, 2008 12:57:11 PM (Pacific Standard Time, UTC-08:00)
Sadly It isn't working on Windows Vista :(
Wednesday, July 16, 2008 1:01:32 PM (Pacific Standard Time, UTC-08:00)
Fábio: You're kidding. What doesn't work?
Wednesday, July 16, 2008 1:13:16 PM (Pacific Standard Time, UTC-08:00)
Vista doesn't like the DX7 code.
Wednesday, July 16, 2008 2:00:39 PM (Pacific Standard Time, UTC-08:00)
Dave - You're right. It works on my XP machine, but not on Vista. I believe this is a workaround http://www.railforums.co.uk/showthread.php?p=141444 but it'll just be easier to update the code.
Wednesday, July 16, 2008 4:57:54 PM (Pacific Standard Time, UTC-08:00)
Talked to Scott about this and realized it's the DirectX version (I don't run Vista and didn't realize it doesn't support DX7). I'm just getting the DX9 SDK now and will be doing a Vista update hopefully tonight (depends on how many things the upgrade breaks). Thanks!
Wednesday, July 16, 2008 6:53:06 PM (Pacific Standard Time, UTC-08:00)
Wow! This totally brings me back to like my first PDC ever.
Wednesday, July 16, 2008 7:28:01 PM (Pacific Standard Time, UTC-08:00)
Haha. Terrarium is the shit! Too bad you can't do this stuff with Spore...
Wednesday, July 16, 2008 7:59:57 PM (Pacific Standard Time, UTC-08:00)
Seems like fun, I'll be checking it out later this week.
Thursday, July 17, 2008 7:06:25 AM (Pacific Standard Time, UTC-08:00)
Awesome! Back in the day all I really got going was a light-phobic plant and a scardy-cat herbivore while learning VB.NET! Time to put some teeth into that sucker! Me thinks C# this time around...
Friday, July 18, 2008 8:10:41 AM (Pacific Standard Time, UTC-08:00)
Thanks for the link to the workaround for Vista.
I ran through the steps and I'm up and running now!
Monday, July 21, 2008 5:10:34 AM (Pacific Standard Time, UTC-08:00)
> BeginReproduction(null);

I, um . . . so many inappropriate jokes come to mind . . .
Tuesday, July 22, 2008 1:10:24 AM (Pacific Standard Time, UTC-08:00)
Hi,

Just another idea: It might be interesting to have some custom WF activity library with common behaviours of plants and animals. So one would code the inhabitant's event-driven behaviour by WF state machines.

Martin
Comments are closed.

Contact

Sponsors

Hosting By

Hot Topics

Tags

Calendar

<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

November, 2009 (2)
October, 2009 (19)
September, 2009 (11)
August, 2009 (12)
July, 2009 (21)
June, 2009 (26)
May, 2009 (16)
April, 2009 (13)
March, 2009 (17)
February, 2009 (17)
January, 2009 (18)
December, 2008 (32)
November, 2008 (17)
October, 2008 (22)
September, 2008 (16)
August, 2008 (14)
July, 2008 (25)
June, 2008 (19)
May, 2008 (17)
April, 2008 (17)
March, 2008 (26)
February, 2008 (21)
January, 2008 (28)
December, 2007 (19)
November, 2007 (17)
October, 2007 (31)
September, 2007 (39)
August, 2007 (37)
July, 2007 (43)
June, 2007 (37)
May, 2007 (32)
April, 2007 (38)
March, 2007 (29)
February, 2007 (46)
January, 2007 (31)
December, 2006 (27)
November, 2006 (31)
October, 2006 (32)
September, 2006 (39)
August, 2006 (34)
July, 2006 (40)
June, 2006 (18)
May, 2006 (31)
April, 2006 (34)
March, 2006 (30)
February, 2006 (38)
January, 2006 (44)
December, 2005 (19)
November, 2005 (34)
October, 2005 (24)
September, 2005 (37)
August, 2005 (20)
July, 2005 (24)
June, 2005 (33)
May, 2005 (16)
April, 2005 (22)
March, 2005 (34)
February, 2005 (15)
January, 2005 (37)
December, 2004 (28)
November, 2004 (30)
October, 2004 (34)
September, 2004 (22)
August, 2004 (34)
July, 2004 (18)
June, 2004 (64)
May, 2004 (49)
April, 2004 (21)
March, 2004 (29)
February, 2004 (29)
January, 2004 (36)
December, 2003 (25)
November, 2003 (24)
October, 2003 (59)
September, 2003 (42)
August, 2003 (24)
July, 2003 (44)
June, 2003 (29)
May, 2003 (21)
April, 2003 (30)
March, 2003 (27)
February, 2003 (47)
January, 2003 (50)
December, 2002 (31)
November, 2002 (38)
October, 2002 (44)
September, 2002 (15)
May, 2002 (2)
April, 2002 (4)

Google Ads