Ecology Musings, Part II

Continued from Part I

Here are some of the basic “rules” I’ve come up with so far, for my ecology-aware plant agents:

Seeds will sprout, if they’re in soil, whether the room has the required CAs or not.

It’s no fun for users if things don’t work at all, so I don’t want to “penalize” players for room developers who haven’t paid attention to CAs. So things will still grow in CA-less rooms, just a lot more slowly.

Right now I’m not differentiating between types of soil (boggy, normal, drained), on the assumption that the moisture CA levels may already reflect this. When I learn more about the CA levels, I’ll have a better idea whether I need to change this.

Plants require light, moisture, and nutrients.

I’ll probably add in heat later on, but I haven’t gotten a good feel yet for what “temperature” ranges are in the game, and how cold or hot they are.

My current calculation for this is pretty simple. I add up the CA numbers for light, moisture, and nutrients in the room, and divide by 3 — this just averages the numbers. If this number is zero (there are no CA levels), I arbitrarily set it to 0.01. Here are some results of this calculation from the C3/DS areas that have soil:

Aquarium: 0.02
Desert: 0.25 – 0.89
Jungle: 0.39 – 0.49
Norn Terrarium: 0.47 – 0.72
Norn Meso: 0.54 – 0.89

Each plant has a “base” growth rate, which is the TICK setting for the timer script. For the bleubells, for example, this rate is set to 50. I divide the base growth rate by the CA average to get the modified TICK setting for the current plant in the current room. For the CA averages shown above, this results in a modified growth rate ranging from 3000 ticks per stage in the aquarium to 56 ticks per stage in the desert and meso.

Plants should live for at least as long as it took them to grow.

Bleubells, for example, take 10 timer cycles to reach adulthoood. So it seems fair that they should live for at least 10 more cycles beyond that.

This is pretty arbitrary, and is in line with my “it’s no fun if you can’t have plants just because the developer was lazy” theme. I decided this when I realized, after coming up with the modified tick rate based on resources, that it made sense to slow down plant growth, but the result was that those plants also lived MUCH longer than their counterparts in other, richer areas. Which led to…

Beyond that, their lifespan will depend on availability of resources.

The bleubells take 10 cycles to grow, and their unmodified lifespan was set to last 50 more cycles once they were fully-grown. My latest modification to them, which will be posted in the next few days (and soon after that for the starflowers), shortens this lifespan. Here’s the math: First I subtract the minimum lifespan (10) from the total (50). This leaves me with 40, which represents the base additional lifespan possible, depending on availability of resources. I multiply this number by the CA average determined earlier, which, for the C3/DS rooms results in a number ranging from 0.67 to 35.5, and then add back the “minimum” lifespan of 10. This number then becomes the setting for how many times the timer script will run before the plant is set to die.

My alarm has just informed me that it’s time to stop playing and get ready for work. In my next installment I’ll talk about use of CAs, death, and returning CAs to the environment. In the meantime, tell me what you think! Would you do things differently? How/why? What other factors (seasons, day/night) should come into play, and how?

Other things I’ve thought of while writing this post (Look! A bunny!):

  • What should happen to a plant that is picked up, while it is being carried? (Right now, the timer just stops until it’s dropped.)
  • What happens after it’s dropped? (I think right now they just keep on growing, even if not dropped back in soil. I should probably fix this.)
  • I also need to talk about population controls and minimum spacing.
  • I really need to take the sandbags out of the bed of my truck.

3 thoughts on “Ecology Musings, Part II

  1. Very useful. I wouldn’t worry about time of day unless you wanted to create a flower that only blooms at night – that could be fun. Seasons however very useful to have plants that flower in spring, fruit in the fall, die in winter etc.

Leave a Reply to ylukyun Cancel reply

Your email address will not be published. Required fields are marked *