Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to transfer genes from one object to another ?

Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
05-31-2005 09:42
I recently made some carnivorous plants that eat my bees and grow as they feed and shrink as they get hungry again. Also just made some GloBugs, basically light emitting moths that flit around at night, and I'm thinking seriously about getting the bats to chase the globugs which might be fun. But mainly I've been working on evolving flower colour, pattern and shape...

As the bees move around the flowers, flowers could grow, get pollinated by bees, drop some seed, which could be picked up and moved by the birds and the resulting plant could be some hybrid from the pollen the bee brought.

So far I've got a system that can interpolate primitive parameters between various shapes, colour is simple and patterns can be handled with textures, but how to pass the genetic data around without using chat and email ?

I'm thinking of attempting to utilise primitive parameters in the seed prim, any other ideas ?

What I'm kind of thinking is that if we could agree on some system, perhaps our individual projects could intermix ... :: off into realms of fantasy ::
Hiro Queso
503less
Join date: 23 Feb 2005
Posts: 2,753
05-31-2005 10:41
From: Laukosargas Svarog
I recently made some carnivorous plants that eat my bees and grow as they feed and shrink as they get hungry again. Also just made some GloBugs, basically light emitting moths that flit around at night, and I'm thinking seriously about getting the bats to chase the globugs which might be fun. But mainly I've been working on evolving flower colour, pattern and shape...

As the bees move around the flowers, flowers could grow, get pollinated by bees, drop some seed, which could be picked up and moved by the birds and the resulting plant could be some hybrid from the pollen the bee brought.

So far I've got a system that can interpolate primitive parameters between various shapes, colour is simple and patterns can be handled with textures, but how to pass the genetic data around without using chat and email ?

I'm thinking of attempting to utilise primitive parameters in the seed prim, any other ideas ?

What I'm kind of thinking is that if we could agree on some system, perhaps our individual projects could intermix ... :: off into realms of fantasy ::

Sounds cool!

OK, now remember I am no scriptor, so forgive me if this idea doesn't work. Is there anyway to pass the genetic code on notecards? I mean could all the organisms have a script that reads a config notecard that contains characteristic parameters fr the shape and size etc? I am aware scripts have been used to build so wondered if this is an option.

If the above can be done??? probably not lol, but hey, if it could, then the next questions I would have-

Is there a way one object/organism can donate their own config card into the correct folder of the 2nd object/organism? And that maybe the script can create an organism with the average of paramaters on both config cards?

Now a non-scriptor is starting to see the possibilities that would open up with a write to notecard function ;)
_____________________
PetGirl Bergman
Fellow Creature:-)
Join date: 16 Feb 2005
Posts: 2,414
05-31-2005 10:46
My think of all GF and BF in SL...
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
06-01-2005 02:58
From: Hiro Queso
Sounds cool!

OK, now remember I am no scriptor, so forgive me if this idea doesn't work. Is there anyway to pass the genetic code on notecards? I mean could all the organisms have a script that reads a config notecard that contains characteristic parameters fr the shape and size etc? I am aware scripts have been used to build so wondered if this is an option.

If the above can be done??? probably not lol, but hey, if it could, then the next questions I would have-

Is there a way one object/organism can donate their own config card into the correct folder of the 2nd object/organism? And that maybe the script can create an organism with the average of paramaters on both config cards?

Now a non-scriptor is starting to see the possibilities that would open up with a write to notecard function ;)


Unfortunately writing to a notecard isn't available and it doesn't look like that will become available either from what LL have said. However, they are talking about adding some sort of database-like storage from what I've heard so this could certainly be an avenue in the future.

It's difficult to think of an efficient method of passing genetic information without the use of chat or emails at present. There are possibilities in using the primitive parameters but that will be extremely limiting for anything other than two or threee parameters I suspect.

I'd love to hear other people's thoughts on this as it's possible I'm missing something completely obvious :)
_____________________
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 03:59
This requires some effort but what if ...

- you can read notecards using their keys ( which is possible )
- you keep a repository of notecards.
- Each notecard key is coded in an index card as a loopup table.
- Each notecard contains the information for a single toy gene in our toy DNA.
- Each toy DNA strand has it's own index card in the repository.

? ...

Using a database like this you could use llGetObjectDesc() && llSetObjectDesc() to pass codes around scripted objects.

I'm going to try this :D

[edit]: the idea being that the organism gets it's base DNA from the repository and thereafter uses script memory to hold the mutations. Using Get/Set object desc to pass only the information that changes or is not the same as the repository. Any interesting mutated forms could be dumped from the organism and manually added to the repository.
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 04:04
another random thought also using llGetObjectDesc() && llSetObjectDesc(),

If you know "L Strings" or "Iterated Function Systems", you could encode a large amount of info as a hexadecimal number used as a seed value for the fractal.
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
06-01-2005 04:40
From: Laukosargas Svarog
another random thought also using llGetObjectDesc() && llSetObjectDesc(),

If you know "L Strings" or "Iterated Function Systems", you could encode a large amount of info as a hexadecimal number used as a seed value for the fractal.


Well, depends entirely on what and how many "genetic traits" you want to transfer/convey/ect... For example, if it's just a color vector you can simply use llGetColor, a say on your secret channel or IM telling the color vector, and llSetColor on the new object. Don't underestimate this, you can get the color, shape, size, texture, of each piece of each object without having to try to encode or store anything in each child item's description, ect.... Save that for other "traits". ;)
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 04:59
From: Logan Bauer
Well, depends entirely on what and how many "genetic traits" you want to transfer/convey/ect... For example, if it's just a color vector you can simply use llGetColor, a say on your secret channel or IM telling the color vector, and llSetColor on the new object. Don't underestimate this, you can get the color, shape, size, texture, of each piece of each object without having to try to encode or store anything in each child item's description, ect.... Save that for other "traits". ;)



You're quite right of course it depends. As I think I mentioned, colour and texture is simple but I'm talking about far more than simple appearance. Admittedly I did say I'm working on my flowers and changing colour and texture and size could well be enough for some simplistic projects.
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 05:09
From: Logan Bauer
Well, depends entirely on what and how many "genetic traits" you want to transfer/convey/ect...


100s and yes I'm quite serious. I'm attempting to discuss methods to enable complex mutations for appearance and behaviour using what we have available to us and keeping it in-world. Not sure I'd want to use email for this.
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
ALife DNA
06-01-2005 06:26
The method I'm developing for the fish is a DNA system. All the routines for shoaling, searching for food, etc are fixed pieces of code with lots of variables. The code does not need to change to effect different behaviour, only the values of the variables.

When the fish mate, the male will give (with whisper on a private channel) a code to the female which represents ALL of the variables used by his sub-routines. By definition this is DNA. The female will then average that data with her own, introducing some (or no) small random changes in the process. The female then rezzes a child from her inventry, passing the new DNA to the child with either a private chanel whisper or the 'on rez' parameter.

I'm compiling a list of all the variables I use in the fish that would affect their behaviour, as opposed to function. Things like max view distance, sight angle, max impulse strength, water drag, and lots of others.



An alternative is a digital DNA, where bits are passed as on/off rather than actual values. For the fish this would mean every child has a default set of values which are then altered by the DNA from father and mother.
An example would be:-

Max Impulse bit set in DNA, Increase by 10%
Max Impulse bit not set in DNA, Decrease by 10%

so if both M and F pass the MI bit set, MI is increased
if both M and F pass the MI bit not set, MI is decreased.
if one passes set, other passes not set, the MI remains the same.

in a random sample, 25% would be increased, 25% would be decreased, 50% remain as default.


This on its own gives three speeds of fish, but combine this with the water drag factor (again 3 variations) and you get 9 speeds.

The advantage of the digital version is the ability to pass a lot of information in only a few bytes of data. A single 32 bit integer for example would pass information to change 32 different values in the child.
_____________________
--------------------------------------------------------
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."
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 06:41
From: someone
The advantage of the digital version is the ability to pass a lot of information in only a few bytes of data. A single 32 bit integer for example would pass information to change 32 different values in the child.


Exactly what I meant, bifields to turn on/off genes in a DNA string. I think this can be done without using listeners. Although if the listener only turned on for the duration of the transfer maybe the idea of using the description field is moot.
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
06-01-2005 09:25
I was under the impression that the description field could not be read by another object...

The method of choice for me atm is to pass an integer with the script as a startup param and use that as the bitfield. My fish currently have 3 seperate scripts for different functions, so 3 integers can be passed while transfering the scripts from parent to child.
_____________________
--------------------------------------------------------
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."
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-01-2005 14:05
From: Surina Skallagrimson
I was under the impression that the description field could not be read by another object...
.


puts pay to that then :p
Have to use a temporary chat state then.
I hope LL are listening to all the calls for object-object comms.

I've got this thing against using loads of scripts, perhaps I need persuading it's ok to do.
I once saw a dog with 25 scripts in it and I thought it was mad.
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
06-02-2005 03:29
I'm making a specific effort to keep the number of scripts low.

The main reason for using several scripts in the first place is to seperate out different behaviours. Where two or more behaviours need to interact it is not possible with a single script. I refer to my scripts as instincts. The fish currently have 3, shoaling, feeding and evasion.

The instincts are not always singular though, for example if a fish is alone it cannot shoal... hence the shoal instinct also includes code for 'wander'. The two forms of movement being mutually exclusive. Also, the feeding instinct includes the code for breeding and dieing as those actions are dependent on feeding.
_____________________
--------------------------------------------------------
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."
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-03-2005 05:47
From: Surina Skallagrimson
I'm making a specific effort to keep the number of scripts low.

The main reason for using several scripts in the first place is to seperate out different behaviours. Where two or more behaviours need to interact it is not possible with a single script. I refer to my scripts as instincts. The fish currently have 3, shoaling, feeding and evasion.

The instincts are not always singular though, for example if a fish is alone it cannot shoal... hence the shoal instinct also includes code for 'wander'. The two forms of movement being mutually exclusive. Also, the feeding instinct includes the code for breeding and dieing as those actions are dependent on feeding.


Does this mean that each script has it's own timers and sensors ? There is definately an advantage to owning your own island sim ! ;)

But perhaps there is no other really good way to pass data, do you use link messages to communicate between scripts ?
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
06-03-2005 07:51
So far I've not needed any messaging between scripts at all. Each script has a specific task that is independent of the other tasks.

Yes, each script has it's own llSensors and timers as required, however they are limited to only one per script as no more are needed. The aim is to keep each script as simple as possible.
_____________________
--------------------------------------------------------
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."
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
06-13-2005 11:42
I joined 2ndLife forever ago, but haven't been active for many a month, so forgive my naivette at the specifics of the coding.

I do, however, have some experience specifically with swarm programming (from some computer modelling work), including 'genetic' material. The solution I used was basically a sort of barcode; you had a long string with a specific formatting style (e.g. binary or hex or whatever), and the "birth" function of each object read through it's DNA-barcode, parsing those values out to the appropriate variables. Originally, the order of values was static, but I eventually even incorporated the ordering being part of the DNA, i.e. it was possible for a radical mutation to occur wherein the "ordering" dna was shifted, completely re-writing the organism. Those radical mutants almost always died, but occasionally something cool happened.

I believe you said you wanted 100s of variables? The question is just how often you want to communicate this data. That said, it wouldn't be too inefficient to exchange 2-300 1s and 0s, but it would be even less inefficient to exchange more deeply encoded data. Basically, I'm suggesting that you look at compressing the data somehow, although in a very simplistic manner.

Here's an easy example:

Suppose you're working with a binary DNA (string of 1s and 0s). The 'pure' DNA looks something like "10001010111101", as an example. One solution would to be to encode this to Hex or some other format that is 'shorter'. Another would be to do simple compression on it, in the following manner: "13010104101". Notice what happened: whenever a number other than 1 or 0 is 'read' by the receiving entity, it knows that that number is indicating how many times it should repeat the next digit. This is VERY basic, but could compress data significantly, depending on your format. You should look around at compression algorithms; since you're not looking for security but rather efficiency, I'm sure there are a few interesting routes to take.
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
06-13-2005 11:49
I seperated this post because the topic is slightly different.

In terms of keeping the objects simple, consider the following as a life cycle example:

1) Male 'inseminates' female by providing half of it's DNA sequence (you could pick any number of ways of dividing the DNA in two, depending on your DNA formatting).
2) Female generates a composite DNA from half of it's own DNA, and that of the male (standard zygote formation).
3) A new "Object" is created, and the Female provides it with the DNA sequence.
4) Within the new object (call it Child), a "Birth" sub-program is called.
5) The 'birth' subprogram reads the DNA and translates it into the relevant variables, hard-coding them into this Child.
6) The child lives, works and loves.

Of course, this assumes some amount of sexual dimorphism, but that's has a serious efficiency value: it reduces the effective calculation load of the population. The male is free to simply inseminate the female and scurry on it's way, and thus males act as the primary "carrier" of new genes, while the females perform the more tedious (and computationally expensive) task of creating the Child. You could even move the "birth" subprogram from the child back into the female, further achieving this goal. The females will act as limits on the speed of mutation (especially if gestation is included), while the males are pushing those limits.

In other words, you've split the task of "evolving" into two roles, just like nature has for most complex animals here on earth.
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
06-13-2005 14:20
Have you been reading my secret research files Johnny? *giggles*
_____________________
--------------------------------------------------------
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."
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-13-2005 16:45
This thread was started to discuss LSLs limitations for transfering data between objects and I've decided to use private chat, with compressed data, partly for the reasons Johnny mentioned. DNA only needs to be transferred at conception and doesn't need to be done in real time or sent across great distances so chat is fine.
Rhysling Greenacre
Registered User
Join date: 15 Nov 2003
Posts: 132
06-13-2005 18:23
I used shout 1st, but then I switched to email because chat is restricted to 255 chars.
Surina Skallagrimson
Queen of Amazon Nations
Join date: 19 Jun 2003
Posts: 941
06-14-2005 00:16
From: Laukosargas Svarog
This thread was started to discuss LSLs limitations for transfering data between objects and I've decided to use private chat, with compressed data, partly for the reasons Johnny mentioned. DNA only needs to be transferred at conception and doesn't need to be done in real time or sent across great distances so chat is fine.


This is the method I'm investigating also. I'm planning on using a random channel where the channel number is passed as the startup param. This should prevent cross 'contamination' between several critters that are breeding within hearing range of each other.
_____________________
--------------------------------------------------------
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."
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
06-14-2005 06:08
From: Surina Skallagrimson
This is the method I'm investigating also. I'm planning on using a random channel where the channel number is passed as the startup param. This should prevent cross 'contamination' between several critters that are breeding within hearing range of each other.



That's funny! I was actually thinking missed chat or cross chat might well produce some interesting deviations!
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
06-14-2005 08:17
From: Laukosargas Svarog
That's funny! I was actually thinking missed chat or cross chat might well produce some interesting deviations!


One characteristic I'm looking to implement is variability in breeding methods.

My ultimate goal here - now that I've found a truly inspiring use for SecondLife - is to create truly evolving species. One of the key factors in that is the idea of speciation, i.e. that from a single population at time0, two incompatible populations may emerge at time1. The methods for speciation include genetic incompatibility AND other incompatibilities such as breeding time, breeding location, lack of recognition, etc.

I'm thinking that one way to achieve this is to start with a very robust method of exchanging DNA. Instead of just having it be an instantaneous code exchange, I want to have an actual exchange of DNA objects (gametes). In other words, my males are going to shoot sperm at the females. The beauty (hah) of this is in its versitility: I'm hoping to enable the system such that females may acquire the ability to desposit their eggs somewhere (or alternately, that males may deposit their sperm somewhere), allowing fertilization to occur outside of "sex". I'm still working this out (and arguably it's going to be rather complex, in the end), but think of how cool this could be: imagine females leaving their eggs in a central area, only to have males competing to access that area first, or alternately males who aggressively fire their sperm at females, who themselves are carrying eggs? The possibilities are endless.

Getting back to your point - accidental crosspollination - I was intending to avoid that by some sort of locational check (i.e. if the distance is greater that a certain distance, the gametes ignore each other) but it would certainly be interesting to simply allow anyone to cross-pollinate within 'earshot'. Unfortunately, it would result in an extremely high propogation rate for the loudest critter, i.e. creating an evolutionary bump for that loud fellow.
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
06-14-2005 08:22
From: Laukosargas Svarog

What I'm kind of thinking is that if we could agree on some system, perhaps our individual projects could intermix ... :: off into realms of fantasy ::


This is generally impossible to implement (you need a defined 'format' for DNA, which could be done but would require some sort of authentication, e.g. certification by the group for 'released' animals, or alternately the implementation of a standardized 'checker' function, etc.), but one thing to consider is that just spying on adjacent critters (from someone else) can still give you the info: many/most of us are implementing a chat-based method of DNA exchange. Just program your parasitic critters to listen in.

Another thought is this: if you design a robust enough system, release enough swarms so that they're a diverse ecosystem and then also release the relevant scripts, people could be drawn to that area specifically out of the desire to be part of something larger.

I'd suggest that whomever gets to the point where they think their digital DNA is robust enough to support this type of variety should announce as such, and see if they can get people to work with them.