Geeks With Blogs
Sasha Krsmanovic Canadian Developer Community Update

I guess my first blog here will be about the terrarium competition we are running in Canada. This seem to be the best place to pick up the slack, as that is the last thing I blogged about at theSpoke (www.theSpoke.net).

 

 

So what is Terrarium?

 

Terrarium is a multiplayer ecosystem game developed using the .NET Framework. Developers can create their own creatures and add them into the game on their own client machine. The creatures get teleported between clients in the Terrarium peer-to-peer network. So, your bug (herbivore, carnivore or plant) gets teleported and starts fighting against other bugs. The best part is, you can be a beginner and still compete on par with professional developers as there are plenty of sample bugs you can use to get you started.

 

 

 

First, a couple of rules for all those interested to play

1. Plants serve as food to Herbivores

2. Herbivores eat plants and generally dont fight unless attacked

3. Carnivores are the warriors, they kill and eat whatever they see

 

Here is some code on how to create a sample plant. You may want to introduce platns to the system first, followed by the herbivores.

So,

  1. Start up Visual Studio.NET
  2. Click File->New->Project
  3. In the Project Types pane, click Visual C# Projects
  4. In the Templates pane, click Class Library
  5. Come up with a creative name for your project. This will be the name for your plant when you introduce it to the system
  6. Click OK
  7. Open Class1.cs source file
  8. Select all code in the file and erase it.
  9. Copy the code below and paste it instead of the code you just deleted 
     

using System;

using System.Drawing;

using System.Collections;

using System.IO;

using OrganismBase;

[assembly: OrganismClass("Food3")] // The class that derives from Food

[assembly: AuthorInformation("YOUR NAME HERE", "YOUR E MAIL HERE")]

[MatureSize (26)]
                                                                      
 

// Point Based Attributes

// You get 100 points to distribute among these attributes to define

// what your organism can do.  Choose them based on the strategy your organism

// will use

[MaximumEnergyPoints(10)]

[SeedSpreadDistanceAttribute(90)]

public class Food3 : Plant

            public override void SerializePlant(MemoryStream m)

            {

            }

            public override void DeserializePlant(MemoryStream m)

            {

            }

}

Now you need to add references to 2 libraries you are using

  1. Select Project | Add Reference
  2. Select System.Drawing.Dll and click Select
  3. Then click Browse… and browse to organismbase.dll. This dll will be in the folder that Terrarium is installed in (usually c:\Program Files\Terrarium\Bin). Select organismbase.dll
  4. Click Open
  5. Click OK
  6. Go back to the code and enter your name instead of “YOUR NAME HERE”
  7. Go back to the code and enter your e mail instead of “YOUR E MAIL HERE”
  8. Build the executable file from within the IDE by selecting Build | Build Solution
  9. You shouldn’t have any build errors. If you do, you have done something wrong. Go back and retrace your steps.
  10. This should do it, you are now ready to submit the plant to the terrarium ecosystem,

Provided you downloaded the Terrarium Client, all you need to do now is

  1. Click on Introduce
  2. Browse to the folder your plant is located at à Depending on what you called your plant in step 5 (ie. ReallySimplePlant), then your plant DLL is at “C:\Documents and Settings\v-sashak\My Documents\Visual Studio Projects\ReallySimplePlant\bin\Debug”
  3. Select your plant
  4. Click on open

There are several tutorials available on how to create herbivores and carnivores at http://64.201.37.243/Terrarium/documentation/tutorial_cs.aspx

Sasha

 

Posted on Monday, November 8, 2004 3:44 PM | Back to top


Comments on this post: Terrarium Competition in Canada + sample code and instructions

# re: Terrarium Competition in Canada + sample code and instructions
Requesting Gravatar...
Hey Sasha, the contest is a great idea.

I'm giving it a go and am happily coding my animals. I've re-learned a lot of useful things that I've pretty much forgotten since exclusively programming business applications. My clients rarely need path finding and "fight-or-flee" algorithms in their E-Commerce sites :)

I just have a couple of questions and comments:

1) Is the contest still alive? I noticed that the registration page isn't working.
2) Can I only submit one type of creature (herb, carn, plant) or all three?
3) Is there a central location for gettings news and updates regarding the contest (as well as perhaps a message board?) or are you just using the server on 64.201.37.243? From what I can tell, there doesn’t seem to be a centralized place for posting questions or getting news.
4) I noticed that you're advertising the contest at local MSDN events. You may want to highlight the prizes as well as the fact that it's really a wide-open game right now. There really isn’t a dominant, sophisticated animal out there (yet.) As much as I'd like to win, I'd also really like to go head-to-head with as many creatures as possible. It’s a hell of a lot of fun.

Thanks!!
Richard
Left by Richard on Nov 29, 2004 12:35 PM

# re: Terrarium Competition in Canada + sample code and instructions
Requesting Gravatar...
Hey Richard

Here are some answers to your questions

1) Is the contest still alive? I noticed that the registration page isn't working.

--> We fixed this, thanks for pointing this out to me

2) Can I only submit one type of creature (herb, carn, plant) or all three?

--> You can submit all three
3) Is there a central location for gettings news and updates regarding the contest (as well as perhaps a message board?) or are you just using the server on 64.201.37.243? From what I can tell, there doesn’t seem to be a centralized place for posting questions or getting news.

--> we would post news, if any, on 64.201.37.243

4) I noticed that you're advertising the contest at local MSDN events. You may want to highlight the prizes as well as the fact that it's really a wide-open game right now. There really isn’t a dominant, sophisticated animal out there (yet.) As much as I'd like to win, I'd also really like to go head-to-head with as many creatures as possible. It’s a hell of a lot of fun.

--> we are talking about the competition at all events and user groups, as well as in the newsletter.

Thanks!!
Richard
Left by sashak on Dec 07, 2004 1:16 PM

# re: Terrarium Competition in Canada + sample code and instructions
Requesting Gravatar...
Great site !!!
Left by bender on Dec 24, 2004 4:38 PM

Your comment:
 (will show your gravatar)


Copyright © Sasha Krsmanovic | Powered by: GeeksWithBlogs.net