Jump to content


Photo
- - - - -

Genetic - Adding Dna To Critters To Define Looks


  • Please log in to reply
15 replies to this topic

#1 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 27 May 2008 - 03:52 AM

  • Title: Critter DNA
  • Description: Shows how to add DNA type structure to allow generational inheritance in game gritters.
  • GM Version: :GM7:
  • Registered: Yes (Pro)
  • File Type: .zip (6 Tutorial files)
  • File Size: 107KB
  • File Link: http://host-a.net/ic...42/genetics.zip
  • Required Extensions: None
  • Required DLLs: None
Summary

I decided to share my technique for making babies LOL.


Using a DNA type system, you can define how a character will look in the game. The DNA is simply a string that holds character properties in each byte of the string.

When the character is created, it's DNA string is setup and the character's look is defined based on the data in the string...


The string simply holds the genes for the character. During the game, right after the instance is created, the string data is read and a series of variables are set accordingly. That way we don't loop though the string character every step.


Creating babies is relatively simple.

You have a male and a female critter. Each hold both male and female dna. But when the critter is female, we use the female DNA and when it's male, we use the male DNA.

When the critters touch (mate) the exchange DNA for the baby. Passing on both male and female DNA from the 2 parents.

The effect is that the child now looks like both it's parents and contains the DNA for the next generation. A merging of both parent DNA.


Read the info in each of the files to gradually get introduced to the concept.


There are 3 body types, 3 eye types and an millions of possibilities for body and eye color.


You move the males as a group in the 3rd file onward. Touch a female to mate with and move away and see a baby get born. See the traits that are inherited...


The next file set will add behaviour inheritance if I am not too busy with something else.


Use the arrows in file 3 to move the males. Touch a femal and move away. *Careful, at one point, you may endup having a lot of males touching a lot of females when they get born... Resulting in a lot of instances being created... At that point, better end the simulation.

Edited by icuurd12b42, 11 August 2011 - 07:08 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#2 Foxx

Foxx

    GMC Member

  • GMC Member
  • 887 posts
  • Version:GM:Studio

Posted 01 June 2008 - 09:11 AM

very nice can't wait till the next file set
  • 0

If I helped you why not give me a rep_up.png ya salty dawg
#Yolo #HardCoreSwag #KingOfTheElfs #Gm6Represent

It's 'Questions And Answers' Not 'Can Someone Else Do All The Hard Work For Me'


#3 Stathio

Stathio

    GMC Member

  • GMC Member
  • 9 posts

Posted 01 June 2008 - 01:27 PM

You, my friend, are awesome.
If I can work this out, it'll make my life sim game about a million times better! :)
  • 0

#4 evilnms

evilnms

    GMC Member

  • New Member
  • 6 posts

Posted 02 July 2008 - 06:17 AM

This is amazing, and incredibly fun.
Watch out, theres a baby maker on the loose! :P
  • 0

#5 SerMSYS

SerMSYS

    GMC Member

  • New Member
  • 180 posts

Posted 03 July 2008 - 05:12 AM

You have a male and a female critter. Each hold both male and female dna. But when the critter is female, we use the female DNA and when it's male, we use the male DNA.


In-game info:
the baby inherits the male dna from the mother and the female dna from the father


You've got it confused a little bit. The father passes his shuffled genes of his mother AND father side, and so does the mother.
You should make a string of the father's recombinated side and a string of mother's recombinated side (law of segregation), pass both strings to the offspring, and then make only dominant genes show up (law of dominance). (not to mention incomplete/co-dominance, multiple alleles, polygenic traits, and chromosomal crossover :) )

You can look up more info here: http://en.wikipedia....i/Punnet_square

edit: http://en.wikipedia....ian_inheritance
  • 0
Battlefield 2/CoD 4/Fallout 3/GTA IV player | Quad-Core owner

#6 weylin

weylin

    GMC Member

  • Banned Users
  • 1327 posts

Posted 05 July 2008 - 09:01 AM

can this be saved as a GM6?

StarQuest: Online Our dream, your world universe.

"Some people are like slinkies. Not really good for anything, but they still bring a smile to your face when you push them down a flight of stairs."
"I'm not a vegan because I love animals I'm a vegan because I hate plants"

#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 08 July 2008 - 02:46 AM

can this be saved as a GM6?


Sorry, gm7 only. Get your hands on a gm7 to gm6 converter, there are a few out there.

Or simply get gm7... image_blend will have to be commented out for GM7 lite...
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#8 linkt

linkt

    GMC Member

  • New Member
  • 61 posts

Posted 13 October 2008 - 01:33 AM

i didnt work on my computer it said "no files exist"
  • 0

#9 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 13 October 2008 - 05:00 AM

i didnt work on my computer it said "no files exist"


You must have gotten a bad download. Try again
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#10 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 11 August 2011 - 06:59 AM

Std Msg: Please use the tutorial template header.

Std Msg: Please remove the Local Moderator Said quote.
  • 0

U1FVsm3.png

40799.png


#11 IQbrew

IQbrew

    Pro-Grammar

  • Banned Users
  • 2607 posts
  • Version:Unknown

Posted 11 August 2011 - 07:31 AM

Std Msg: Please use the tutorial template header.

Std Msg: Please remove the Local Moderator Said quote.

Why are moderators telling people to make their old tutorials follow the new standard when they aren't doing it themselves?
"Personally, I rather look forward to a computer program winning the world chess championship. Humanity needs a lesson in humility. "

#12 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 11 August 2011 - 07:36 AM

Std Msg: Please use the tutorial template header.

Std Msg: Please remove the Local Moderator Said quote.

Why are moderators telling people to make their old tutorials follow the new standard when they aren't doing it themselves?


Because we can? And look mine is fixed now
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#13 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 05 March 2012 - 11:02 PM

This is kind of cool. Basic evolution would be better: mutations (changes) in the DNA strings and some way of killing them off that's affected by either color, eye color, body type, or eye type. But that's not too hard to do, I'm just too lazy to do it :P . I'd be interested to see what evolves from that...

-IMP
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#14 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1044 posts
  • Version:GM8

Posted 05 March 2012 - 11:12 PM

I remember creating a neural network evolution simulation before where the node connections were stored in an array. Parents could 'mate', merge their synaptic map, and create small variations. I deliberately killed off those who collected the least food every minute, and they got better and better at collecting it after a time... I might go back to that and change it. Thanks for sharing!

Zesterer
  • 0

Fortified - The sword thrusting, castle busting, catapult adjusting new Tower Defense game!

More projects and work coming soon... If you need help on voxels, mesh rendering, physics, perlin noise generation, 3D, mathematics or more just contact me and I'll be happy to help!

Skype: zesterer                Email: barry.of.smith@gmail.com <---- Actually, don't use this address, I never check it.


#15 CrazyGamer

CrazyGamer

    GMC Member

  • GMC Member
  • 90 posts
  • Version:GM:Studio

Posted 06 March 2012 - 07:42 PM

I didn't read your code too carefully but you should make it like this:
Female gene is "X X"
Male gene is "X Y"
When they procreate the gene that decides the baby's sex is from the male.(the male decides the sex of the new baby). So you got the "X" gene from the mother and there will be a choose what gene will be passed from the father "X" or "Y" if you get from the father the "X" gene you will get a female baby "X X" and if you get the "Y" gene from the father you will get a Male Baby "X Y".
Also for diseases the female can be :
XX (the female is wealthy)
XdX (the female only cares the disease but it does not manifest,where "d" is the disease gene)
Xdxd (the female is ill,she has the disease and it manifests)
So the female can be ill,wealthy or she can care the disease.
The male can only be ill or wealthy(he cannot just care the disease and not be ill)Like this:
XY - wealthy
XdY - Ill
I am working too on some thing like this(i am trying to program AI animal like cells that would multiplicate and work together)
Hope this helps :) anyway nice work :) ,hope to see more.
  • 0

#16 ddan49

ddan49

    GMC Member

  • New Member
  • 101 posts
  • Version:GM8

Posted 06 March 2012 - 09:07 PM

You have a male and a female critter. Each hold both male and female dna. But when the critter is female, we use the female DNA and when it's male, we use the male DNA.


In-game info:
the baby inherits the male dna from the mother and the female dna from the father


You've got it confused a little bit. The father passes his shuffled genes of his mother AND father side, and so does the mother.
You should make a string of the father's recombinated side and a string of mother's recombinated side (law of segregation), pass both strings to the offspring, and then make only dominant genes show up (law of dominance). (not to mention incomplete/co-dominance, multiple alleles, polygenic traits, and chromosomal crossover :) )

You can look up more info here: http://en.wikipedia....i/Punnet_square

edit: http://en.wikipedia....ian_inheritance


Whoa. If you want Dominant genes and that kind of thing, you should also incorporate chances of mutations. If you want to make those modifications, chances are, you already know enough GML to do it yourself. Once you do that, it's getting very specific, and takes way too much power/space for a typical game.
  • 0
Keep in mind that whatever I say, there will always be someone somewhere who will say something stupider and more embarrassing than what is above.
Working with a team? For some tips, go to this awesomely informative link.