It’s nothing over-the-top, but a little script I wrote that solves basic genetic crosses.
Try it out here.
Would like some feedback, thanks.
It’s nothing over-the-top, but a little script I wrote that solves basic genetic crosses.
Try it out here.
Would like some feedback, thanks.
I looked at it, but I literally have no idea what’s going on.
Any chance of a simple explanation in layman’s terms?
It’s biology related.
In organisms’ DNA, they have genes that code for certain trait. For each gene, they have two alleles.
The most simply type (the one I demonstrate here) is to have two possible alleles, one being completely dominant.
This could be written as a capital and lowercase letter for each allele.
For example, in pea plants, wrinkled seeds are dominant to smooth seeds. So, the possible genotypes of a pea plant are “AA”, “Aa”, and “aa”. “A” represents the wrinkled gene and “a” represents the smooth gene. So in “AA”, the pea would be wrinkled. In “Aa”, the pea would be wrinkled. In “aa”, the pea would be smooth.
When organisms breed, the offspring each inherit one allele from each parent randomly.
A better explanation can be found on Wikipedia
http://en.wikipedia.org/wiki/Genotype
Interesting.
So why do you need unity to make this? Or there is a visualization and I missed?
I used Unity because I like Unity.
Isn’t this what all 15-year-olds do when they’re bored? ![]()
Maybe genetics isn’t as widely understood as I thought?
This is pretty cool; while you don’t need Unity to make it, having it in Unity gives it possible applications in games and other apps (for example to populate a place with NPCs that share traits in a more biological manner instead of just random).
good you could try and add percentages calculations as well
real nice man, code seems perfect, but i am no genetics guy but from what i remember tiss spot on. this has 1000s of usable applications, from generating crowds for city scapes, sports games, to child birth predictions and mutation , as the genes represent traits such as eye/hair/skin color even height and stuff can be pre determined with ur nifty calculator. Could use it to produce reasonable accurate child birth between to differing avatars, reproduce bugs that can evolve, 1000s of things this type of gene calculate can do.
Kudos mate
Genetic algorithms are used in the NEAT AI algorithm; further Genetic Algorithms are an accepted AI practice.
There’s good call for this type of project. While it lacks glamor and glitz…very well done!
Thank you very much Werewraith, MrSmive, and Asvarduil.
Yes, I know this project is a very simple one, but I thought it was a good idea to throw around the community.
I checked this out and I was like " WoW I’m in Biology class once again
" , I’m lucky I’ve remembered that.
This would be great, I’ve been covering genetics in school and I can definitely see the applications for a game. Good work!
I could see it being very useful in AI spawning, even if it’s as simple as weapon swaps (most trolls have swords, but some have axes)… Pretty cool.
Hi,
very interesting ! Do you plan to release the source code sometimes ? I would love to play with it ![]()
–
oxl
Yes, I’d be happy to release the source code. All I did was attach a single script to a camera and adjust the camera background color. You would probably only want to have the .js text then, eh?
I’ll post it here as a .txt file:
http://www.unitybiology.webs.com/source.txt
Thanks very much , I’m surprised that it’s not looking very complicated … argh , maybe I should bring out my 20 year old school books again ![]()
–
oxl
Also, if anybody wants some simple functions, I could make some to give you.
The simple functions I have in mind would take four variables: the dominant trait, the recessive trait, the genotype of Parent1, and the genotype of Parent2
It would then just calculate the ratios of offspring likeliness, do a “random” selection based on the percentages and return one offspring genotype. This means that the function would do it all.
SingleTraitDominant("Aa","aa");
The above function would return “Aa” 50% of the time and “aa” 50% of the time.