Templates - Plant?

Jul 31, 2008 at 1:34 AM
Anyone know of a plant template with the required attributes?
Jul 31, 2008 at 6:19 AM
Edited Jul 31, 2008 at 6:26 AM
Try this code:
using System;
using System.Drawing;
using System.Collections;
using System.IO;
using OrganismBase;

// The following Assembly attributes must be applied to each Organism Assembly
[assembly: OrganismClass("CSharpCreatures.Plant2")]
// The class that derives from Animal

[assembly: AuthorInformation("Your Name", "someone@microsoft.com")]
// Provide Author Information
// Author Name, Email

namespace CSharpCreatures {
//3.2 Plants
//The definition of a plant is relatively easy since plants do not have to have any sort of movement defined to allow them to locate sources of food.
//Each plant has three basic functions:
//1. Grow
//2. Reproduce by spreading seeds
//3. Be eaten by herbivores
//A plant organism does not need to contain any methods, it just has three properties that define how a plant functions.
//1. The “MaximumEnergyPoints” property allows the developer to state how many energy points a herbivore will gain by consuming this plant. The maximum allowed is 10.
//2. The “MatureSize” property which must be a number between 24 and 48 states the maximum size a plant can grow to when it has survived for some amount of time without being consumed. The smaller a plant is, the faster it will be able to reproduce. As a plant gets larger it will become easier for herbivores to see and will more likely be consumed.
//3. The “SeedSpreadDistanceAttribute” states the maximum distance a plant can spread seeds from its current location. The maximum allowed is 100. These three properties alone are enough to define a functioning plant for the Terrarium game.
// This value must be between 26 and 48, 26 means faster reproduction
// while 48 would give more defense and attack power
// Make it smaller for reproduction


// 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. This organism hides and has good eyesight to find plants.

public class Plant2 : Plant
// This gets called whenever your animal is being saved -- either the game is closing
// or you are being teleported. Store anything you want to remember when you are
// instantiated again in the stream.
public override void SerializePlant(MemoryStream m) { }
// This gets called when you are instantiated again after being saved. You get a
// chance to pull out any information that you put into the stream when you were saved
public override void DeserializePlant(MemoryStream m) { } } }
Jul 31, 2008 at 2:04 PM

Thanks for the post and the code.

Plants are pretty boring and have very little logic. I'm looking to get plants have behavior so you can create something like a Venus Fly Trap which eats other animals (but doesn't move). With that you could create a more dynamic eco system (for example, some herbivores that would be able to co-exist with killer plants much like how the Clown Fish/Sea Anenome works).

At some point I'm getting the wiki setup (http://wiki.terrariumserver.com) which will house a lot of this information and creating a new Animal Farm (http://creations.terrariumserver.com) where you can go shopping to get new creatures.

Jul 31, 2008 at 4:36 PM
I saw in the code some notes about plant height and various other incomplete features.  They would definitely enhance the desire to make plants.  Maybe really tall plants can't be eaten by small creatures.  I was thinking a plant defense mechanism would be cool too, but would have to be simplified so as to not eat up too many cycles.  Things like "thorns" could be fun, but then you need creatures to be able to overcome them (thus adding to the complexity).  Also, maybe plants can come in "types".  Herbivores might have to pick a type or two.  Eating the wrong type might make them sick or simply not give them energy.  Just some ideas to spark some thought.
Aug 1, 2008 at 3:42 AM
Totally this is the way to go. Plants in 1.x was underdone and you only create them so your herbivores don't die (Which reminds me, I have to get some added to the server). The idea of some animals not being able to eat them due to size and even introducing sickness into plants really blows the whole eco-system open wide. Then we can have terrariums where they get infected with some kind of crop bug which damages one plant and through polination, infects others which in turn could affect animals that eat it. Lots of great ideas here (that we should solidify when I get the wiki setup, working on that tonight).
Aug 1, 2008 at 3:09 PM
Ohh, I like this idea, Plants were pretty lame, I created only a couple years ago just to see what could be done with them. I tried a couple herbavores, those were ok, mainly for a defensive strategy, but I primarily made carnivores. This might interest me in getting creative with plants. I have long since believed herbavores are my mortal enemy so I would be tempted to create some killer plants.

I have a big smile on my face just thinking abou this.