Author Topic: Genetics  (Read 2319 times)

Offline Lash

  • Acquaintance
  • *
  • Posts: 21
    • View Profile
Genetics
« on: December 04, 2008, 06:41:05 AM »
Two concepts that really turned me on to Dead Souls are the use of genetics and infectious diseases.

I was interested in expanded these ideas. If this has been done or discussed elsewhere please point me in the right direction.

As far as genetics, I would like to get some input about the idea of inserting "code" into the player object that determines physical appearance as well as abilities. Specifically, I was thinking along the lines of having actual "genetic material" in the form of DNA that when "read" would determine the appearance of eye color, for instance.

The player object would include code for eye color such as:

ATG GCC CCT AGA GGT GAG CGC ATA CTA TTT TAG which determines the corresponding amino acid sequence:

MAPRGERILF*

One gene (33 nucleotides) coding for a ten amino acid protein that determines grey eyes.

Deviations from the nucleotide sequence could result in shades of grey. Furthermore, since the genetic code has some redundancy, changes at the DNA level may not affect grey color at all since the amino acid sequence would be identical. For example,

ATG GAC CCT AGA GGT GAG CGC ATA CTA TTT TAG would still result in the MAPRGERILF* aa sequence

however

ATG GAC C CCT AGA GGT GAG CGC ATA CTA TTT TAG would result in the MDPRGERILF* aa sequence and have an affect on the shade of grey.

The above is critical because ultimately changes in DNA sequence may result in a change to the protein or not. Functionality of the protein could be affected from minor to the point of being nonfunctional. For instance, if a stop codon in the DNA (TAG in this example) is introduced in the middle of the protein the creature may very well become blind.

These are simple examples to illustrate a point. A major omission is the role of RNA in the translation process of DNA to protein and may not be relevant in a MUD universe.

When a player develops a character at login they are able to choose phenotypic traits such that the DNA sequence defining those traits are included in their player object. Other traits would be hidden from the player, such as those that determine stats and abilities.  A drawback would be that one would have to design a gene for each trait specified and has the potential to become quite cumbersome. But the neat thing is that one could develop certain programming rules that result in phenotypic changes based on  random DNA sequence changes. That might be a pretty big database.

Now, if this is possible, imagine the use of infectious agents, such as a retrovirus, that could infect a player and alter the genetic sequence resulting in phenotypic change. Or, better yet, players developing technology to change their own, or others, DNA sequences.

Thoughts appreciated.

Lash



   
« Last Edit: December 04, 2008, 06:55:09 AM by Lash »

Offline Yarp

  • Acquaintance
  • *
  • Posts: 8
    • View Profile
Re: Genetics
« Reply #1 on: December 04, 2008, 08:03:06 AM »
The game Crusader Kings, by Paradox Interactive, uses a form of genetics code to store character information.  I've never really thought about  how it's done, but knowing the guy that's their lead developer, it probably involves some form of Swedish voodoo and sacrificing of Finns.

Anyways their code (theoretically) makes more sense, in that it looks much more like a hash rather than combinations of three proteins like you've done here.  Basically a string of numbers - if I had it installed on this system, I'd paste some samples, but it's basically something like dna = 29823487823748.  I imagine the game treats it like we treat strings in LPC, and just uses each character for a different thing - the first character being cheeks, the second being beard, third eyes, fourth hair, fifth facial type, sixth ethnicity, seventh religion, then 8-12 are probably converted over to an int which is the father's character id number, 12-17 are probably the mother's id number, and so on.

No need to overcomplicate things and go all ATG, in my opinion, especially when there's no need to limit yourself to biological concepts when we're dealing with machines (where biology is irrelevant).  Might as well just stick to strings of numbers and save yourself time writing crazy translation functions and what not.  Start simple, and if it doesn't fit what you're looking for, rewrite it!
« Last Edit: December 04, 2008, 08:05:32 AM by Yarp »

Offline Lash

  • Acquaintance
  • *
  • Posts: 21
    • View Profile
Re: Genetics
« Reply #2 on: December 04, 2008, 11:54:37 AM »
Thanks for the reply Yarp. Your suggestion to start simple and build complexity is a good one. I would rather like to use something akin to a DNA sequence eventually. It is the extraction, evaluation, and analysis of the "DNA" data by players that I want to ultimately incorporate. Whether strings of a' t's g's or c's   or numbers may not matter much at this point.

else return (failz);

Crap. I screwed up possibly leading to confusion (damn user error w/ copy and paste):

Quote from: Lash
ATG GAC CCT AGA GGT GAG CGC ATA CTA TTT TAG would still result in the MAPRGERILF* aa sequence
should be

ATG GCA CCT AGA GGT GAG CGC ATA CTA TTT TAG would still result in the MAPRGERILF* aa sequence.

So:

original is GCC = wild type protein
mutant 1 is GCA = mutant DNA but same protein
mutant 2 is GAC = mutant DNA and different protein.

Lash
« Last Edit: December 04, 2008, 11:56:48 AM by Lash »

Offline Yarp

  • Acquaintance
  • *
  • Posts: 8
    • View Profile
Re: Genetics
« Reply #3 on: December 04, 2008, 04:20:26 PM »
If you want something like honest to god DNA to be displayed in game, then just write a single function to translate everything into a readable form.  I think you'd be filling up your plate with something the size of rewriting MudOS if you were to actually try to work with the system at the DNA level, ie having code that actually goes case 'GAC': shade = 'grey'; case 'ACG': adjective = 'light'; shade = 'gray'; etc. or something wacky along those lines.

Not only would it be completely unreadable by anyone who isn't you (and probably you as well!), it would be a pain to work with as well.

Again, I want to stress how silly it is to try to limit yourself to the four proteins.  At the very worst, instead of using numbers like CK, use letters.  Then you have like 52 odd options per character.  If you can't get all of the weird adjectives involved in shading eye color to fit into [a..Z] then your mud will never be done, in my opinion.

Offline Tricky

  • BFF
  • ***
  • Posts: 187
  • I like what I code and I code what I like!
    • View Profile
Re: Genetics
« Reply #4 on: December 04, 2008, 06:34:47 PM »
2 words, "Genetic Algorithm"

Quote
Once upon a time there lived a species of creatures called Hooters. Hooters had evolved entirely within the darkened confines of a vast cave system hidden deep in the bowels of a mountain range. They'd had an easy life, feeling and smelling around the damp cave walls for the algae they so loved to eat, oozing between rocks and, at mating time, listening intently for the hoots of other Hooters. There were no predators in the caves, it was just the Hooters, the algae and the occasional friendly slug, so the Hooters never had anything to fear (except for maybe the occasional bad tempered Hooter). An underground river flowed through the cave system and water continuously dripped down through the water table bringing with it the fresh nutrients the algae thrived on so there was always plenty to eat and drink. However, although Hooters could feel and hear well they never had any need for eyes in the pitch blackness of the caves and as a result were totally blind. This never seemed to concern any of the Hooters though and they all had a whale of a time munching away and hooting in the darkness.

Then one day an earthquake caused part of the cave system to collapse and for the first time in many millennia the Hooters felt the warmth of sunlight upon their skin and the soft springiness of moss beneath their feet. A few daring Hooters tasted the moss and found that it was even better eating than the cave algae. "Ooooooooooh!" they hooted between mouthfuls of moss and promptly got gobbled up by the  marauding eagles who had flown in to see what all the commotion was about.

For a while it looked as though the Hooters may be hunted to extinction, for although they liked to eat the moss they could never tell if an eagle was flying above. Not only that, they couldn't even tell if they were concealed beneath a rock or not unless it was low enough to reach for with their feelers. Every day many Hooters would stumble out from the caves with the sweet smell of moss in their nostrils only to be swiftly carried away and eaten by an eagle. Their situation seemed grim indeed.

Fortunately, over the years,  the population of Hooters had grown to be enormous in the safety of the caves and enough of them were surviving to mate - after all, an eagle can only eat so much. One day, a brood of Hooters was born that shared a mutated skin cell gene. This particular gene was responsible for the development of the skin cells on their foreheads. During the development of the baby Hooters, when their skin cells grew from the mutated gene instructions they were slightly light sensitive. Each new baby Hooter could sense if something was blocking the light to its forehead or not. When these little baby Hooters grew up into bigger Hooters and ventured into the light to eat the moss they could tell if something was swooping overhead or not. So these Hooters grew up to have a slightly better chance of survival than their totally blind cousins.  And because they had a better chance of survival, they reproduced much more, therefore passing the new light sensitive skin cell gene to their offspring. After a very short while the population became dominated by the Hooters with this slight advantage.

Now let's zip a few thousand generations into the future. If you extrapolate this process over very many years and involving lots of tiny mutations occurring in the skin cell genes it's easy to imagine a process where one light sensitive cell may become a clump of light sensitive cells, and then how the interior cells of the clump may mutate to harden into a tiny lens shaped area, which would help to gather the light and focus it into one place. It's not too difficult to envision a mutation that gives rise to two of these light gathering areas thereby bestowing binocular vision upon the Hooters. This would be a huge advantage over their Cyclopsian cousins as the Hooters would now be able to judge distances accurately and have a greater field of view.


As you can see the processes of natural selection - survival of the fittest - and gene mutation have very powerful roles to play in the evolution of an organism. But how does recombination fit into the scheme of things? Well to show you that I need to tell about some other Hooters...

At around the same time the Hooters with the light sensitive cells were frolicking around in the moss and teasing the eagles, another brood of Hooters had been born who shared a mutated gene that affected their hooter. This mutation gave rise to a slightly bigger hooter than their cousins, and because it was bigger they could now hoot over longer distances. This turned out to be useful in the rapidly diminishing population because the Hooters with the bigger hooters could call out to potential mates situated far away. Not only that but the female Hooters began to show a slight preference to males with larger hooters . The upshot of this of course was that the better endowed Hooters stood a much better chance of mating than any not so well off Hooters. Over a period of time, large hooters became prevalent in the population.

Then one fine day a female Hooter with the gene for light sensitive skin cells met a male Hooter with the gene for producing huge hooters. They fell in love, and shortly afterwards produced a brood of lovely baby Hooters. Now, because the babies chromosomes were a recombination of both parents chromosomes, some of the babies shared both the special genes and grew up not only to have light sensitive skin cells, but huge hooters too! These new offspring were extremely good at avoiding the eagles and reproducing so the process of evolution began to favour them and once again this new improved type of Hooter became dominant in the population.

And so on. And so on...


Genetic Algorithm Tutorial

In other words, it isn't as difficult as you think.

Tricky

Offline Atomic

  • BFF
  • ***
  • Posts: 112
  • To infinity and beyond!
    • View Profile
Re: Genetics
« Reply #5 on: December 05, 2008, 04:11:27 AM »
(w)H00T!  :D
Man, this piece of Tricky's text is the best smile on my face for today.
« Last Edit: December 05, 2008, 04:13:04 AM by Atomic »
Always remember that the early bird gets the worm first, but the fi...*SNAP*...second mouse gets the cheese.