Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to get started?

Floog Stuart
Registered User
Join date: 28 Jun 2006
Posts: 12
08-24-2006 09:47
I want to start scripting artificial-life but I have no idea where to get started. I'm already an okay scripter.
Don Misfit
Registered User
Join date: 1 Jun 2006
Posts: 60
08-24-2006 23:32
Well Floog...

Creating Artificial Life 101: First, get a fresh cadaver, a set of jumper cables, string about a dozen car batteries together, and...

heh heh...

Best bet is to first sit down and write out - in plain-language - what you want to do. Then, start scripting it in little steps.

What kind of artificial life do you want to script?
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
08-25-2006 02:45
Hi Floog

You need to decide precisely what it is you want your creatures to do. Do you want them to develope their own social structure like ants? Do you want them to be solitary? Do you want them to do unexpected things or be predictable? Do you want them to mimic the RL behaviour of equivalent RL creatures?

Most AL programers here, including myself, have modeled groups of creatures where the interaction between them shows the signs of AL happening. Maybe you could try a solitary creature, like a pet rat or pet dog, that makes its own decisions rather than blindly following a preset command list like most SL pets.

For most creatures there are 3 groups of abilities you need to give.

Physical.
----------
You need to provide a set of routines that allow your creature to move. Try to make them as open ended as possible so that a controling script can pass a few params to control the entire range of movement that your creature should be able to perform. Remember that limitations in movement (and conversly to much freedom) will affect the results that you get. If your creature needs to be able to jump, you must provide the ability here.
Also in this group are input sensors to your creature. If it needs to "see" its surrounds or other creatures or detect collisions etc, write a few routines that produce a data stream that can be processed by the "brain" or control routines.

Behaviours.
-------------
There are certain things you'll just have to progam into your creatures so that they have a starting point to work from. eg, for fish, birds, sheep, etc. there is a "standard" flocking algorythm available on the net (Google Craig Reynolds and Boids). You won't get source code that you can run directly in LSL, but the principles are very easy and well explaind on his site.
As with the movement routines, make your behaviour routines open ended so that passing different params to them alters the way they work.
Behaviours you may need include..
Feeding
Flocking/shoaling
Breeding
Dieing
Seek
Flee

Control
---------
This is where the real ALife stuff gets going (finally). What you do here will make the difference between a pre-programed robot or a life like android. To my mind pure randomness is wrong, as is pre-determination. I believe "probability" is the way to go. In other words, if there is a decision to be made give several options that have more or less chance of success rather than just "do this or don't". My fish, for example, know about 8 types of food to choose from. The food to look for at any given time (just one at a time) is chosen by a "weighted random" method. Total amount of each food type successfuly eaten is stored and used as a weighting factor. At first any food type could be chosen equaly, but in an area where only one or two food types actually exist, those soon gain such a high weight factor that the others are never chosen. Hence the fish effectivly learn which food is available and what to look for.
This can be used for all sorts of decisions. See a predator, do I turn left, right or go back? If predator is evaded increase weight factor for that decision. If predator is closer, decrease weight factor...
The key here is in the ability to learn from the past and adjust future behaviour based on that knowledge.

How do these tie together? The physical bits are like our own senses and muscles, the control section is like our conscious thought and the behaviours are like our sub-conscious thoughts.

Inputs from sensors are modified directly by the behaviors in cases like shoaling, or passed to Control when searching. Control decides what needs to happen based on those inputs and request basic behaviours, (walk, run, seek, turn, etc.) The behaviours determine precisely what happens by activating the physical routines.

Good luck with your experiments.
_____________________
--------------------------------------------------------
Surina Skallagrimson
Queen of Amazon Nation
Rizal Sports Mentor

--------------------------------------------------------
Philip Linden: "we are not in the game business."
Adam Savage: "I reject your reality and substitue my own."
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
Great Adviice!
09-07-2006 17:30
Thanks, My Queen! i`m Book-marking this thread, for later re-reading of your advice!Toodle-oo!