Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Describing a functional working "Toy" Ecosystem

Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-10-2006 08:48
Sorry about the long thread but it's hard to describe this in a couple of sentences ...

a few pics here

Downtime gives me a chance to tell about my latest project. It isn't complete yet by any means, lots of work to do, as you will imagine if you have the patience to get to the end of this post, but I now have more than 3/4 of the functional core system actually working ...

For several months now I've been very slowly working toward integrating all my various wildlife products into a "living" environment. Just recently, having obtained an island I've been able to make a big leap forward in progress, to the point where I'm reasonably confident to discuss some of my findings and if anyone's at all interested I will soon release the simple protocols I'm using so people can add their own creations to my system in a modular fashion...

Bear in mind my aim here is a "toy" system, so overt reality can step sideways a little. The emphasis is on reasonably quick gratification from user participation or from simply being a spectator and watching the system 'evolve' and grow.

So these are the working components with far more planned if it's successful ...

Energy for growth is provided by the sun proportional to cloud density. Scripted rain clouds roam the sim providing water for localised nutrition. Trees and plants grow proportional to the amount of water and energy they receive. If they reach maturity without dying from lack of energy they seed one or more times and eventually die off.

When trees reach maturity one of the their tasks is to check the local environment. Trees will sprout Bee Hives and Birds Nests if none are within a set range.

Bees fly around during the daytime pollinating mature flowering plants. Pollen contains genes and these genes are mixed in the flowers as bees visit them. Genes can be used for any purpose I like. Currently I have colour, texture, size and growth rate as the main genes. Once pollinated a plant will release a seed which is blown by the wind.

If a seed lands on suitably flat ( not too steep ) terrain it waits for rain and will grow where it lands. If they land in water some seeds will sprout water plants such as lilies and reeds. Seeds will llDie() if they don't receive water in a set period.

Birds fly around pestering visitors just like they always have on my lands, but now they get hungry too ! When they get hungry they search out seeds and young seedlings and eat them up. ( I was working on this bit when they took SL down for maintainance today ! )

A system of camouflaged "marker" prims can signify various "habitats", like shady, sunny, boggy etc. and plants will use these markers to modify their energy use. This gives scope for a wide variety of localizable plant life. I already have one marker prim type, any prim with the word "ground" in it's name can be used by plants as a place to grow on. If blown seeds collide with prims other than "ground" prims they instantly die.

Plants also rez Linden plants around their bases to add some pretty dynamic effects and I'm using particle effects to show when trees produce flowers and when flowers are pollinated by the bees.

So rain comes along, seeds grow, cycle starts again. Currently this cycle takes a about day, but it's totally variable to any period. For development purposes I can make the plants grow almost instantly.

As a user/owner you start by releasing the clouds and planting the little seeds around the area you want to grow in and then sit back and wait for it to happen. I'm using llWind to push the clouds around and it appears my clouds cover the entire sim approximately once an hour, but they aren't always raining ! You can also manually "water" plants to keep them alive if you see them getting dry and want to make sure they survive.

So far I've made 2 kinds of seed, I call them basic flowers and basic trees because I plan far more complex and some very exciting life-forms if these work out well. Both types grow from tiny seeds, into seedlings, into mature trees or flowers if they survive lack of water and being eaten by the birds. This balance is something I'm currently constantly tweaking until I find a happy medium.

So you, the user, end up becoming a "gardener" in the true sense. You can plant seeds, tend them, prune them etc or just sit back and watch as Mama Nature slowly takes over your sim ;)

So lots and LOTs of work left to do, but the basics are now up and running in a corner of my sim, with a few little problems to iron out ...

- Birds currently eat too far much, logged in this morning and all the flowers were gone !
- Growth rate is being constantly tweaked until I find a happy medium.
- Scripts will need optimisation if the system is to cover the entire sim.


** BAD THINGS... !!..
Here are a few caveats I'm still concerned about ...

- Prims.
This can be extremely heavy on prims, of course detail can be lowered, and I intend to use particles too, but nonetheless it will still require at least 2000 or more prims for a decent system. No problem if you have an island or a sim, and I expect this kind of thing will only ever be possible on a private sim anyway, so maybe prim usage isn't such a big problem.

- Scripts!
LSL, what a bitch she is !
To grow a plant, every prim needs a script. Once grown to maturity I currently automatically delete the spurious growing scripts but it still leaves at least one script per plant to make it work properly. This means potentially 1000s of scripts! Just how many a sim can handle before performance drops too far I've yet to find out. I've had roughly a 1000 scripts running during development and it wasn't even noticeable compared to the lag caused by a couple of visiting AVs. And I can see myself deleting the extremely primmy dome on my castle which is by far the worst frame rate hitter in Svarga atm !!

-Bandwidth.
Each growing prim requires the client to do a full update. But this was only noticeable when I had several 100 prims all growing very rapidly indeed during development. In the real working situation the plants update infrequently and only one or two in any localized area will be growing simultaneously



** NUT SHELL:

* System Control
-- Cloud Controller turns off/on clouds, stops water flow, eventually kills all plants.
-- Touch hives to turn off/on, stops bees, stops re-seeding and expansion.
-- Touch nests to turn off/on, stops birds, speeds up expansion!
-- ToDo : have plants contact controller to give an approximate prim count.


* Sim
-- scripted clouds provide water
-- water + sun = energy for growth
-- sun density related to sim cloud density. ( llCloud() )
-- energy = life
-- energy keeps plants alive
-- stopping the scripted clouds stops the flow of water
-- no water = no growth
-- Everything dies after 6 hours of no water

* Marker prims with coded names represent habitats:
-- damp
-- dry
-- boggy
-- shady
-- etc

* ...or nutrients:
-- acid
-- alkaline
-- etc

* Plants
-- seeds grow into plants using energy
-- grow, spawn seed and die
-- pollinated by bees, can't seed unless this happens
-- compete for space
-- seeds falling into water become water plants or die
-- some only exist under trees
-- some are loners (hi prim) can only exist if no others are around
-- some look for marker prims
-- older plants should be stronger than seedlings ?
-- never die. this type would delete all its scripts.

* Trees
-- spawn birds nests if none are in range
-- spawn bee hives if none are in range
-- act as markers for certain plant types
-- grow, live for a while, die and fall over with a crashing noise !?
-- never die. this type would delete all its scripts.
--- fallen trees could be markers for fungi and other fun stuff ! ?

* Wildlife
-- Mostly already implemented.
-- Bees transfer pollen / plant genes
-- Birds eat seed and bees, could also move seed around the sim
-- Birds also eat young plant shoots.
-- More variety, ... small animals ?

* User Interaction
-- tending the garden
-- planting seeds
-- watering dry plants
-- weeding / removing spurious plant growth.
-- felling unwanted trees.
-- cross pollination / plant breeding

-- sit on the rain clouds, be taken for a trip around the sim on a cloud !

* cons
-- 1000s of scripts!
-- needs 2000 or 3000 prims
_____________________
Geometry is music frozen...
Morgana Aubret
Damaged Beyond Repair
Join date: 12 Jul 2005
Posts: 139
05-10-2006 10:42
Overall, I just have to say, "Wow!". This is an extremely interesting idea, and having seen many of your beautiful organics in world I can imagine how they would all work together to do this. One thing from the main body of text. Please don't make the "too steep" parameter too low. Some of us like very steep land. :)

Here are my thoughts on the summary at the bottom:

* System Control

Additionally - you might want some kind of "freeze" mode - nothing new grows and nothing dies. This could be for when the sim owner was going to be out of world for a vacation or something and doesn't want things changing when they are not around to see/supervise. You could get most of that effect right now with turning off nests and hives, but that still leaves things dying if the rainfall doesn't work out.

* Sim

The dying with no water in six hours concerns me a bit. Someone could go to bed, have something in the cloud script get borked and wake up to a dead sim. Also, is there any visible sign that things aren't getting enough water?

* Marker prims with coded names represent habitats: * ...or nutrients:

This could get very interesting - especially in terms of it interacting with the plant genes.

* Plants

It should be interesting to see how plants "evolve" over time using the plant genes.

* Trees

I like the idea of having fallen trees on the ground. It's rarely done ISL and it would make things more natural.

* Wildlife

Since birds eat shoots, seeds AND bees (which create the seeds along with the plants), could this be why the birds are eating too much now?

I would love to see some decent land based small animals. Natural movement is the obvious issue. :-/

* User Interaction

How can you tell when plants are dry? The sim tour on the raincloud sounds like fun!

* cons

Since each plant needs a script, I can't see how to cut down on this other than the solution you have already mentioned of deleting scripts when you are done with them. The primcount is going to be an issue for anyone who doesn't have a lot of land. I know you are planning on this being essentially full sim. Is there any possibility of somehow restricting the ecosystem to a smaller area - such as the land owned by a group that might not be full sim? Or going the other way, could this system be used in a contiguous multi-sim area?
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-10-2006 12:12
From: someone
One thing from the main body of text. Please don't make the "too steep" parameter too low. Some of us like very steep land. :)


heh, yes including me ! I'm really talking about letting the seed roll down vertical surfaces rather than try and embed itself. Trees look damn weird trying to grow out of cliff faces.

From: someone
Additionally - you might want some kind of "freeze" mode - nothing new grows and nothing dies.


yes, probably when the prim counter is implemented features like this will be too.

You can do it at the moment pretty much by turning off the hives and leaving the clouds running.


From: someone
The dying with no water in six hours concerns me a bit.


All quoted figures are arbitrary and could easilly be built in as options.

However, water use is dependent on plant and it's environment and lifetime without water varies per plant. The 6 hour figure is not for grown plants, it's for dormant seed to stop any buildup of unused prims. It's unlikely to be needed as I've graphed the clouds in the sim and they cover the entire sim at least once in 6 hours.

From: someone
It should be interesting to see how plants "evolve" over time using the plant genes.


especially as the genes start to get more complex :)

From: someone
Since birds eat shoots, seeds AND bees (which create the seeds along with the plants), could this be why the birds are eating too much now?


they're just greedy little critters, always have been ;) I was fixing that when I got logged off this morning ! The problem was/is a bug in the hopping bird that gets stuck in it's look for more food state!


From: someone
How can you tell when plants are dry?


3 ways currently,
- click on it and it tells you !
- look at it's colour, if it's going brown it's drying out
- some plants get textured with dry leaf textures.



From: someone
I know you are planning on this being essentially full sim. Is there any possibility of somehow restricting the ecosystem to a smaller area - such as the land owned by a group that might not be full sim? Or going the other way, could this system be used in a contiguous multi-sim area?


Currently I'm thinking along the lines of creating a tiered product line, for mainland parcels I think to keep it simple. Plants the owner waters and tends and grow accordingly but don't self replicate. Bigger parcels could have clouds. Whole sims are definately needed for the big self replicating picture though, processing all the scripts is a fairly heavy load I can just imagine the arguments people would have with neighbours who used this on the mainland ! Even a sim owner needs an open mind and little else going on in their sim. And multiple sims can only be better !
_____________________
Geometry is music frozen...
Lecktor Hannibal
YOUR MOM
Join date: 1 Jul 2004
Posts: 6,734
05-10-2006 12:40
How very intriguiing Lauk :) Is this open for visitors? I would love to see your latest work.
_____________________
YOUR MOM says, 'Come visit us at SC MKII http://secondcitizen.net '

From: Khamon Fate
Oh, Lecktor, you're terrible.

Bikers have more fun than people !
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-10-2006 12:56
From: Lecktor Hannibal
How very intriguiing Lauk :) Is this open for visitors? I would love to see your latest work.



Yes, the island is called Svarga, look in my profile picks, love to see you here Leck long time no see :)

The eco system is limited to my little work area by one the gates atm, at least for a few more days yet. And I'll get around to pictures and a SLurl for this thread soon ( ish )

__________________

Angels have more fun than bikers !

;)
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-11-2006 04:36
I thought I'd push it last night and left it running at a faster growth rate. This morning it was a jungle with around 1500 new scripts in the system and 0.8 time dilation, not so good.

So I'm deleting the whole garden and planting some new seeds slightly more optimised and slower growth again.

I've also added a FREEZE option to individual plants. So you can kill all the scripts and stop a plant growing / dieing if you like it. One of the things last night was a really great clump of natural looking trees that I wouldn't likely plant like that myself.

I have a hunch an entire sim of growth would need to be well managed. It might be a better idea to grow smaller sections and freeze them when you like them... mmmm
_____________________
Geometry is music frozen...
Kristian Ming
Head Like A Hole
Join date: 5 Feb 2005
Posts: 404
05-11-2006 08:37
This looks very cool, Lauk! I hope I can see it in world, the few screenshots I got from a friend last night were soooo tantalizing but I couldn't come. :(
_____________________
"When you're going through hell, keep going!" -- Winston Churchill
Morgana Aubret
Damaged Beyond Repair
Join date: 12 Jul 2005
Posts: 139
05-11-2006 10:13
Maybe the excess growth was from the birds being so full from their ealier feeding frenzy. ;)

Once the parameter tweaking is done, it sounds like the real issues are going to be the number of scripts and prims. I like the idea of a constantly evolving forest, but I also like the idea that you can freeze things and at least reduce the script load if things get overwhelming.

I wish I had seen the jungle before you deleted it!
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-11-2006 12:05
From: Morgana Aubret
Maybe the excess growth was from the birds being so full from their ealier feeding frenzy. ;)

Once the parameter tweaking is done, it sounds like the real issues are going to be the number of scripts and prims. I like the idea of a constantly evolving forest, but I also like the idea that you can freeze things and at least reduce the script load if things get overwhelming.

I wish I had seen the jungle before you deleted it!


I kicked myself for not taking a pic but I'm pretty sure there'll be a few more before too long ! ...
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-12-2006 05:03
Yesterday and today I've had objects that are given to other objects via llGiveInventory fail to arrive at their destination... ( thought this had been fixed ? )

Object to object transfer seems to be failing suddenly ?

could this be a bug introduced in the recent update or is it coincident with the fence ?

It's not all the time, it's intermittent. I'm going to see if I can test it somehow.

[edit]

a result ... I use

llRezObject( .. )

handle the rez in

object_rez( ... )


where it often does

llGiveInventory( ... )


so ...

CODE
llRezObject( ... )
...
object_rez( ... )
{
llGiveInventory( ... )
}

sometimes fails

but

CODE
llRezObject( ... )
...
object_rez( ... )
{
llSleep( 2.0 or more );
llGiveInventory( ... )
}

seems to work !

LSL bug ? or a laggy network error ?
is object_rez not waiting for the object to become fully rezzed ?



.
_____________________
Geometry is music frozen...
Andrew Linden
Linden staff
Join date: 18 Nov 2002
Posts: 692
05-12-2006 07:33
The grey goo fence does throttle llGiveInventory(),llGiveInventoryList(), llRezObject(), llBreakLink(), and llBreakAllLinks() events. However, if an llGiveInventory() fails due to the fence, then a few things will happen:

(1) All rezzes and inventory gives should fail for the corresponding family or asset until no more attempts have been made for 12 seconds. If a single attempt is made 11 seconds after the fence goes up then the fence will remain in force for another 12 seconds beyond that.

(2) Script errors should be visible for the affected objects that say something about hitting the fence (for the first 7 or 8 events in 2 seconds, after which the error will be suppressed).

(3) The energy budget of objects that attempt and hit the fence will be attenuated, so if they are using llSetBuoyancy() they will most likely fall to the ground.

It would be odd to hit the fence for only a few events. I'd expect it to act more like a sudden wall, at which point you would get a flood of failures.

What is the name of the region and the time of a known llGiveInventory() failure? I'll scan the logs to see if you are hitting the fence.
Andrew Linden
Linden staff
Join date: 18 Nov 2002
Posts: 692
05-12-2006 07:44
It is possible that the rez_object() callback is getting processed before the object actually rezzes. That is indeed a silent failure case.

There is a 0.1 second sleep associated with an llRezObject() call, but that might not be enough. I believe the rez-object request goes onto a queue and is not actually created within the llRezObject() call.
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-12-2006 07:47
From: Andrew Linden
The grey goo fence does throttle llGiveInventory(),llGiveInventoryList(), llRezObject(), llBreakLink(), and llBreakAllLinks() events. However, if an llGiveInventory() fails due to the fence, then a few things will happen:

(1) All rezzes and inventory gives should fail for the corresponding family or asset until no more attempts have been made for 12 seconds. If a single attempt is made 11 seconds after the fence goes up then the fence will remain in force for another 12 seconds beyond that.

(2) Script errors should be visible for the affected objects that say something about hitting the fence (for the first 7 or 8 events in 2 seconds, after which the error will be suppressed).

(3) The energy budget of objects that attempt and hit the fence will be attenuated, so if they are using llSetBuoyancy() they will most likely fall to the ground.

It would be odd to hit the fence for only a few events. I'd expect it to act more like a sudden wall, at which point you would get a flood of failures.

What is the name of the region and the time of a known llGiveInventory() failure? I'll scan the logs to see if you are hitting the fence.


Thanks!

When I see it again I'll send you some info.
I've not seen any specific "fence" errors, the error just says the object is missing from inventory. And it really does appear adding the small delay is working, at least it has for the past few hours.
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-12-2006 07:48
From: Andrew Linden
It is possible that the rez_object() callback is getting processed before the object actually rezzes. That is indeed a silent failure case.

There is a 0.1 second sleep associated with an llRezObject() call, but that might not be enough. I believe the rez-object request goes onto a queue and is not actually created within the llRezObject() call.


excellent information thank you, I'm sure this is what was happening :)
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
Some pics as promised
05-17-2006 09:05
As promised some pics at last ...

Now nicely balance growth is giving good results ...



A cloud roaming the sim on the wind...
http://static.flickr.com/54/148210210_81b9af288e.jpg?v=0


now it's raining on the plants below ...
http://static.flickr.com/55/148211716_cca5dbc4b4.jpg?v=0


a seed on the ground waits for rain to grow...
http://static.flickr.com/56/148211717_75ea93da14.jpg?v=0


when mature the plants are visited by bees, when a plant recieves pollen
from another plant of the same species it seeds ...
http://static.flickr.com/49/148210206_9d887c223c.jpg?v=0


basic flowers growing in a shady spot...
http://static.flickr.com/55/148210205_44115f1f55.jpg?v=0


trees rez flowers for the bees to visit, once pollinated a seed falls in the wind.
http://static.flickr.com/48/148212672_f3c427b492.jpg?v=0


orchids grow in boggy areas...
http://static.flickr.com/55/148211715_2c51803556.jpg?v=0


trees rez bee hives in their foliage if none are around...
http://static.flickr.com/53/148211712_25ce6a3fe2.jpg?v=0


and birds nests too...
http://static.flickr.com/51/148211714_e694ded073.jpg?v=0


birds fly around, sometimes coming down to hop around and eat seed they find on the ground...
http://static.flickr.com/55/148210208_197b1a4f70.jpg?v=0


globugs provide food for bats at night ( and look nice too )!
http://static.flickr.com/55/148210211_ad94548fa9.jpg?v=0


work in progress, a cannon lily, will fire it's seeds across the sim !
http://static.flickr.com/54/148210209_6d922903af.jpg?v=0


more to come :)




and here's a link to the album
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
Svarga is becoming a "Living" sim !
05-19-2006 03:28



Some new habitat rules for the basic flowers have payed off, resulting in thinner, less populated "clumps". I'm much happier with this distribution as it means I might shortly be able to release the system out into the wider sim ! :)

Also the entire system now adapts it's growth rate to the conditions of the sim and will slow down, stop or even delete a few scripts ( leaving "frozen" plants ) if the sim gets too laggy.
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-22-2006 07:09
My poor 2yr old powerbook suffered a catastrophic graphics card failure this morning, and I'm only able to access SL on an even older iMac atm! So running at 1 FPS with a 32 meg card isn't very condusive to masses of a-life. So I've temporarilly shut down the experiment. Back up as soon as I get my machine back from the repairers. Or even a new machine maybe ... !
_____________________
Geometry is music frozen...
Morgana Aubret
Damaged Beyond Repair
Join date: 12 Jul 2005
Posts: 139
05-22-2006 08:37
:( Sorry to hear you are shut out. I hope you get a new machine soon. I'm looking forward to seeing the progress on this!
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-26-2006 03:24
It's incredibly frustrating when all you can do is stand around and watch SL go by at around 2 frames per second ! But nonetheless I couldn't stay out and I've been popping in on my old white iMac but lawd it's a dog with SL !

When I stopped the eco system I turned off the bees to stop it expanding and turned off the clouds to stop the water supply. I expected the entire plantation to die within a day...

... 3 days later and it's only just showing signs of dehydration! ... erm looks like a error in my math there somewhere ! heh!




From: someone
Sorry to hear you are shut out. I hope you get a new machine soon. I'm looking forward to seeing the progress on this!


( new machine arrives on Tuesday hopefully :D, Apple treats the UK as 2nd class citizens but I'll be back up to steam in no time )
_____________________
Geometry is music frozen...
Morgana Aubret
Damaged Beyond Repair
Join date: 12 Jul 2005
Posts: 139
05-26-2006 09:44
From: Laukosargas Svarog
When I stopped the eco system I turned off the bees to stop it expanding and turned off the clouds to stop the water supply. I expected the entire plantation to die within a day...

... 3 days later and it's only just showing signs of dehydration! ... erm looks like a error in my math there somewhere ! heh!


It's those hardy drought resistant genes developing. :)
Ghoti Nyak
καλλιστι
Join date: 7 Aug 2004
Posts: 2,078
06-01-2006 06:48
Gotta say, Lauk, you've inspired me to try my hand at doing a little a-life!!

-Ghoti
_____________________
"Sometimes I believe that this less material life is our truer life, and that our vain presence on the terraqueous globe is itself the secondary or merely virtual phenomenon." ~ H.P. Lovecraft
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-04-2006 07:57
hah!

I've just been tracing the talkbacks for some of the blogs that have been remarking on my project since Hamlet posted God Game last week!

What a crazy world the blogging media is ! One thing I mentioned in the interview needs a bit of clarifying so I posted this comment to NWN ...


From: someone
Ok, something things need to be said as the wonderful world of blogging is spreading a misconception like chinese whispers around the web ...

At no time have I ever worked for Lionhead, I did work on a very small part of B&W as a tester and coder but NOT as a Lionhead employee. I mentioned B&W as an example of excellence in gaming and because it was a big inspiration to me. Please don't make such a big deal about this part of my history. Thanks :)

And once again thank you to everyone who has been around Svarga to see the project.

I'm totally amazed at the level of interest this has generated !
_____________________
Geometry is music frozen...