Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]

Author Topic: Making more diverse genetics  (Read 9283 times)

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Making more diverse genetics
« Reply #30 on: February 21, 2011, 04:57:48 pm »

If we are talking about a per-character color gene, then you'd just have to double the number of color bits, but you could represent which was the dominant gene just by having it come first (or last, all that matters is that you differentiate by position), and you can handle how the colors are dominant to one another through the raws, without having to carry any sort of dominance table down per character, so it wouldn't cause some explosion in data storage.

The attribute/stats that range from 0 to 5000, I think, aren't tracked in worldgen.  They certainly don't seem to have the "all members of The Bronze Pulleys are crazy agile but very sickly" trend that you see with all dwarves from one civ being blonde-haired and purple-eyed.  I think I recall talk about how attributes are basically averaged from between both parents, and maybe randomized a little from there.  I can't find much useful with a few search attempts on several keywords.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Granite26

  • Bay Watcher
    • View Profile
Re: Making more diverse genetics
« Reply #31 on: February 21, 2011, 06:14:25 pm »

Genes aren't merely dominant or recessive.  You'd need an int (or a short) to track HOW dominant and recessive they are.

From Wiki:
Quote
Multiple alleles
Although any individual has at most two different alleles, most genes exist in a large number of allelic forms in the population as a whole. In some cases, the alleles have different effects on the phenotype, and their dominance interactions with each other can be described as a series. For example, the best known human blood groups, the ABO system,[2] comprises three sets of alleles at the I locus, IA, IB, and IO. The first two are dominant to the latter: that is, the AA and AO genotypes produce indistinguishable blood group phenotypes, called "Type A", as do BB and BO, which produce "Type B" blood. In another example, coat color in siamese cats[3] and related breeds is determined by a series of alleles at the albino gene locus (c) that produce different levels of pigment and hence different levels of color dilution. Four of these are c+, cb, cs, and ca (standard, Burmese, siamese, and albino, respectively), where the first allele is completely dominant to the last three, and the last is completely recessive to the first three

Not that I don't think that actual genetics is best, I just think that there's a way to get 90% of the idea without changing what's stored for individuals.

Point taken on the expressed gene already being in the unit data though.  I hadn't thought of that.

You're right on the proclivities not being inherited.

Also: DF wiki thinks recessive is in

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Making more diverse genetics
« Reply #32 on: February 21, 2011, 06:37:22 pm »

I know that different genes have differening amounts of dominance, what I'm saying is that this doesn't have to be recorded on a per-character basis, it can simply be a part of the creature raw saying that such-and-such a gene has dominance power 5 and another one has dominance power 3, and all the creatures check that raw to see how to determine which of the two genes they have will win the dominance fight. 

In other words, you do need data set aside for that, but it's something that can be caste-wide or species-wide, so that it isn't going to be the problematic "across 10,000 individuals in a civilization" type of thing.



Hmm... I'm not sure about that wiki bit saying it has recessive and dominant.  It's the first I've seen of it, and it seems to have been there from April 3rd when 31.01 was first introduced, and the genetics page is just useless.  There's also something below that which says you can modify what professions you can take by caste, which seems like they were confused by something like having caste profession names, since as far as I know, there isn't a way to make certain jobs caste-specific (aside from positions, and even then, only based upon gender).

If that's true, then nevermind, I guess, if it's not, then maybe Toady will read this suggestion and consider revising the genetics code.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Thundercraft

  • Bay Watcher
    • View Profile
Re: Making more diverse genetics
« Reply #33 on: February 21, 2011, 06:48:51 pm »

If we are talking about a per-character color gene, then you'd just have to double the number of color bits, but you could represent which was the dominant gene just by having it come first (or last, all that matters is that you differentiate by position)...
I agree that this is probably the easiest method of incorporating the inheritance of a color gene without also having an unnecessary explosion in data size.

I think I recall talk about how attributes are basically averaged from between both parents, and maybe randomized a little from there.  I can't find much useful with a few search attempts on several keywords.
So, you're saying that DF has already implemented the inheritance of attribute genes, such as strength and agility. But it seems the question remains on exactly how the current implementation works and how it can be improved upon, correct?
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Making more diverse genetics
« Reply #34 on: February 21, 2011, 06:52:14 pm »

So, you're saying that DF has already implemented the inheritance of attribute genes, such as strength and agility. But it seems the question remains on exactly how the current implementation works and how it can be improved upon, correct?

Yes, as far as my memory serves, I believe that the way it works is that every creature has a "genetic" value for each attribute, and a "current" value.  The current value can't be more than double the genetic value a creature is born with. Then, the genetic value is averaged out with the other parent and then randomized slightly to find the child's genetic value on birth.

This was all from way back when 31.01 first came out, however, so I'm not very sure about any of this ever being tested thoroughly.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Granite26

  • Bay Watcher
    • View Profile
Re: Making more diverse genetics
« Reply #35 on: February 21, 2011, 06:54:51 pm »

I get your point about the genes in the raws.  A pointer is 4 bytes, so...

I agree about the Wiki, but I wasn't able to find release notes for 31.1, so, I figured I'd throw it out there, see if anybody knew better

Thundercraft

  • Bay Watcher
    • View Profile
Re: Making more diverse genetics
« Reply #36 on: February 21, 2011, 07:53:01 pm »

Uncivilized 2: I think that uncivilized creatures are simply spawned wholecloth when they walk onto your fortress map or you see them, and genetics are not tracked for them as a population, but that when they are on your map, you can do your little eugenics programs.

No wonder it seems so limited! While it does allow dwarves to experiment with animal husbandry, that method is not very dynamic or realistic.

I assume that Toady eventually plans on having the genetics of uncivilized creatures tracked as a population during Worldgen. But on the other hand, that seems to imply a need for Natural Selection of the fittest, which (unless greatly simplified) could be way too complex to simulate in a game. While the inheritance of stats such as higher than normal strength and endurance could contribute to inheritance by giving said creatures a better in-game chance at survival, it would be much more difficult to have a Natural Selection preference for, say, certain color genes.

In real life, certain color traits contribute greatly to survivability through certain schemes, such as camouflage with their native habitat (and nocturnal creatures might tend to have a darker coloration), the mimicking of other dangerous or harmless creatures (such as a harmless garden snake sharing identical color markings with a poisonous snake), or for the selection of healthy mates that were able to maintain a healthy diet. But in DF those things would be difficult, if not impossible to simulate.

Also, there would need to be enough evolutionary pressure to maintain certain attributes. For example, I'm thinking creatures may need to have a high enough disease resistance to survive an encounter with disease-carrying undead or enough disease or poison resistance to survive an encounter the body fluids of a poisonous or disease carrying FB (with exposure to said fluids not being a certain death sentence).

Finally, additional constraints would be needed to prevent all creatures from having the maximum in each attribute. For instance, in DF the body size and height/broadness/length contribute to combat potential, making larger creatures much more likely to survive in a fight. So what's stopping Natural Selection from forcing all creatures into a "growth explosion" to equal the dinosaurs, given enough worldgen years of simulation? There would have to be consequences for a larger body size - with an increased need for food intake being the most obvious. (Being able to move swiftly and hide with camouflage might also be problematic.) And what's stopping the inheritance of attributes like strength and endurance from growing out of control? Again, there'd have to be consequences and limits for increased attributes.

I believe that the way it works is that every creature has a "genetic" value for each attribute, and a "current" value.  The current value can't be more than double the genetic value a creature is born with. Then, the genetic value is averaged out with the other parent and then randomized slightly to find the child's genetic value on birth.

The "randomized slightly" part could be viewed as genetic mutation. But it definitely sounds like there is room for improvement.

What I find to be the weakest part of the current genetics system, with respect to uncivilized creatures, is that it is not only limited to the Fortress Mode map, but that no matter how good the player is at Fortress Mode and no matter what the player does, those pets and other creatures never get to pass on their genes to future generations. In terms of evolution and natural selection, they are failures just for appearing on your game map. Dwarves could breed the perfect specimens of dogs, giant leopards, rocs, or what have you and it does not matter in the long term, because their Fortress will eventually either die or be forgotten on their hard drive.

The only solution that I can see is what I like to call a "Successive Embark", or the option to continue the existence of a Fortress after the player tires of it or reaches a certain FPS breakpoint. What I mean is that instead of abandoning the Fortress, the player can instead choose to select from among their current dwarves and resources to build a new embark party to strike the earth elsewhere, leaving the old Fortress more or less intact. I'd like to eventually be able to play a generated world from year 0 to year 500+ through successive fortress embarks and successive adventure embarks.

In terms of creature genetics, this could be a lot more interesting because the player could choose to bring along their prized breed of super-sized llamas, war-grizzly bears and/or hunter-giant lions to continue breeding them on their next site.
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Making more diverse genetics
« Reply #37 on: February 21, 2011, 08:53:46 pm »

I assume that Toady eventually plans on having the genetics of uncivilized creatures tracked as a population during Worldgen. But on the other hand, that seems to imply a need for Natural Selection of the fittest, which (unless greatly simplified) could be way too complex to simulate in a game. While the inheritance of stats such as higher than normal strength and endurance could contribute to inheritance by giving said creatures a better in-game chance at survival, it would be much more difficult to have a Natural Selection preference for, say, certain color genes.

Things like evolution have come up before, but there are major problems with it.

For starters, remember how Granite26 just said that 10,000 creatures having their attributes tracked would add up to around 10 megs of data?  Now, consider that the total populations of every single form of creature in the world will be in the millions if not billions when you include things like vermin, which are pretty absurdly numerous.  That's a problem.

The other problem is something that's come up in previous "evolution" ideas, so let me quote myself, here:
Well, we can't get too crazy about all of this, is the thing.  The key to making realistic Darwinian natural selection is that everything has to have a real cost, and those costs are difficult to model, currently.

For example, spiders aren't all web-spinners, and some are jumping spiders, which hunt down prey with good eyesight and powerful legs.  Webspinners catch flying insects, while jumping spiders catch crawling insects.  Here's the thing, spiders have evolved from one back to the other over and over again, depending on which insects were most prevalent, and hence, how they had to adapt to their prey.  A jumping spider that was becoming a web-spinner couldn't keep its powerful eyesight and legstrength because it needed to conserve its nutrients as much as it could while waiting for prey to land in its web.  Meanwhile, jumping spiders can't afford the massive nutrient cost of building webs out of precious protiens in amounts that take up about half its body mass if it isn't directly demanded for their survival.  The result is that when the spiders evolved from one then back to the other, they weren't "upgrading through evolution levels", they were gaining and losing abilities based upon what was most critical to their immediate survival, and throwing away anything not directly related to their survival. 

The thing about "genetics" as it is currently implimented is that there needs to be some real introduction of drawbacks to it.  Currently, cows eat nothing, but "beefy" cows can produce more meat per slaughter, and there is no drawback to this in any way.  So, why SHOULDN'T every creature eventually evolve into being perfect superman versions of their base creature type?

Technically, now cows do eat something, but they all eat the same amount regardless of size, so it's kind of the same thing.

In order to do a serious "evolution", you need drawbacks, which means that beefier cows eat more grass, and eventually you have cows so beefy they just overgraze everything the way that a draltha does.  Generally speaking, the cost of most everything, including the "soul traits" like the various forms of intelligence should be an increased calorie burn or nutrient requirement to support a better developed mind, and evolution should only occur when it actually has an impact on survival, typically the ability to acquire food - who needs to be smart if you're a successful ambush predator like spiders or alligators?  Alligators have remained essentially the same for millions of years since they have little evolutionary pressure to change.  Spiders flip back and forth based upon the very real evolutionary pressure created by the fact that spider litters are hundreds strong - it's very hard to ensure you have something to eat when you're competing against so many of your own siblings for a limited number of flies to eat.  You need every evolutionary edge you can get.

Dwarves could breed the perfect specimens of dogs, giant leopards, rocs, or what have you and it does not matter in the long term, because their Fortress will eventually either die or be forgotten on their hard drive.

That is not how evolution works - there is no "perfect" evolution, there is merely adapting to the current situation as best as you are capable.  The situation will eventually change, and thus, you will have to adapt again.

You can see this both in the spider example I gave above, but also in the "arms race" of plants and insects, especially in fiercely competitive areas like rain forests, where plants develop poisons to repel insects, and insects respond by developing immunities to that poison.  They do this so much and so thoroughly that insects wind up becoming adapted to the point where they can only eat one specific plant in the entire forest, which is poisonous to every other creature.  Then, if those insects become too numerous, they get hit by the cordyceps fungus if they become too tempting a prey, themselves.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

DrDada

  • Bay Watcher
    • View Profile
Re: Making more diverse genetics
« Reply #38 on: February 22, 2011, 09:38:27 am »

Evolution during world generation would be pretty neat.
Not even for the animals but for the dwarves,elves,kobolds etc.
Its also crucial to connect genetics to needs/food/water of the creatures.
I'll just throw in some ideas:

Dwarves with bigger muscles should need more food than weak dwarves(how strong they are/can get should at least partially be influenced by genetics).
Creatures with bigger brains learn faster but need more food too.
Some Elves could have better eyesight that makes them exeptionally good at archery but since theyr visual cortex is bigger, they learn slower than theyr fellow elves on the other end of the world.
I imagine kobolds could evolve to a point where they count as 2 species.
You could adventure to one Isle and meet "dust kobolds" a smaller breed with greyish long hair slow metabolism, who are almost pacifistic and  are know to survive on little food and can live almost 30yrs, while on the main island the most common kobold breed are the ember kobolds with short red hair, high metabolism,stronger, always hungry/aggressive only live for 10yrs. etc.
A few humans evolved to slowly learning but strong and enduring farmers who supply a dwarf civilisation of nearly blind but highly skilled craftsmen with an absurdly big liver with booze.
etc.
Logged
Pages: 1 2 [3]