Mods / Genelib
Author: sekelsta
Side: Both
Created: May 16th at 10:23 AM
Last modified: 2 days ago
Downloads: 76306
Follow Unfollow 536
Recommended download (for Vintage Story 1.21.0 - 1.21.6-rc.1):
genelib_2.1.6.zip
1-click install
This mod does nothing useful on its own. Install if another mod requires it.
This mod provides genetic inheritance support for mods which depend on it. Currently that includes:
Truth and Beauty: Detailed Animals - currently only chickens and goats, more animals planned!
Truth and Beauty: Seasonal Animal Breeding - no genetics, but Genelib provides the seasonal breeding code logic in a way compatible with my other mods
Equus: Wild Horses - horse genes include agouti, extension, tobiano, and more!
The GUI dialog for naming your animals also comes from here. Look at an animal and press "N" to open it. Works with just Genelib for Monoceros, Draconis, Pegasus, and Equus. Installing Detailed Animals will enable this feature for all remaining vanilla and modded animals.
Genetic inheritance
Basics of how genetics work: Each species comes with a number of genes, each of which may come in multiple variants. Every individual animal has two of the variants for each gene, or two identical copies of the same variant. These determine traits such as coat color.
To give a concrete example, let's look at horses. Horses have a gene called extension that determines which type of pigment colors their fur. One variant called E allows for both black and 'red' (a term geneticists use for a range of shades from coppery to golden), while the other one, e, only allows red and not black. Since every animal has two variants of each gene, an individual horse could have E/E (that is two identical copies of E), E/e or equivelantly e/E, or e/e. You'd probably figure a horse with E/E would be partly red and partly black, while a horse with e/e would be fully red, and you'd be right (with some simplification). But what about E/e, that has one of each variant? For that we need to know that E is dominant over e and therefore hides its effects, so the horse would be partly red and partly black just like with E/E. Conventionally the dominant gene is named with a capital letter and the recessive one with lowercase, which makes it easy to remember which one wins conflicts (but sometimes hard to remember what each one actually does).
Ok, but what does all that have to do with inheritance? Well, when two parents produce a foal, they pass on one of their two variants of each gene, chosen at random. So if the mother has E/e, she has half a chance to pass on the E and half a chance to pass on e. And suppose the father has e/e, he passes one on at random and it's going to be e because that's the only one he's got. Putting those together you have half a chance to get a foal with E/e who looks like its mom, and half a chance the foal will be e/e and look like its dad. It doesn't always have to work out this way! Other pairings might get foals with a 100% chance to look like say their mom, and others still might have a chance that the foal will not look like either parent. You can figure out which situations these happen by doing way too many Punnett squares in your local high school biology class.
This horse example of course only applies if you have Equus: Wild Horses installed.
Sex-linked genes
These are only implemented for chickens in Truth and Beauty: Detailed Animals at the moment. Remember how I said each animal has two variants of each gene? That was actually a simplification that these put the lie to. Depending on its species and gender, an animal may have one or two variants - not two different ones or two of the same one, but actually two or only one - matching the sex chromosomes it has.
You may have heard that males have an X and a Y chromosome, while females have two X chromosomes. This is the case for mammals generally (don't mind the platypus). However, birds do things differently. In birds, the male has two Z chromosomes, while the female has one Z and one W. Don't worry too much about the changed names, the important bit is that in mammals, females have two of the same sex chromosome and males have one of each, while in birds it's reversed.
To give a somewhat obscure but concrete example, in chickens there is a sex-linked gene that can allow or prevent the legs from being black. For simplicity let's only consider black chickens, not brown ones. The brown ones generally have yellow or light legs regardless of the gene we're about to discuss. Anyway, for black chickens, a sex-linked gene called 'inhibition of dermal melanin' affects whether their legs will be black like their feathers, or yellowish. One variant causes black and the other causes yellow, and yellow is dominant. This is sex-linked on the Z chromosome of chickens, that's the one males have two of, so any male chicken has two variants (two of the same or one of each), while each female chicken only has one. Just like the regular genes, a male chicken will pass on one of his two variants at random to each chick. However females have one variant - on their Z chromosome - and then a W chromosome that does not have the gene at all. They could pass on either their variant of the gene together with the rest of the Z chromosome, making a male chick, or they could pass on their W chromosome, for a female chick.
Let's look at an example where a hen with yellow/- is crossed with a rooster with black/black. That's a hen with yellow legs and a rooster with black legs. The rooster is guaranteed to pass on the gene for black legs because that's the only version he has. The hen can either pass on her yellow, also making the chick a male, or pass on her W chromosome, making the chick a female. So when you hatch a batch of chicks from this pair, all of the males will have yellow legs like their mother, while the females will have black legs like their father. I bet you thought it'd go the other way, huh? But no, this is how it works out in this one example. Other pairs of parents might get different results, like if you crossed the male (yellow/black) with the female (black/-) chicks from that pairing you'd get yellow-legged females, black-legged females, yellow-legged males, and black-legged males, each with equal probability.
Don't forget to reverse all that if you're working with mammals instead of birds. :p
Mutations
For every young animal born, there's a tiny chance that a mutation happens and it could inherit a different variant of a gene than what its parents would normally have provided. The chance is really very tiny, I'll leave the exact number vague but just say it's less than one in ten thousand per gene. Mutations are not intrinsically good nor bad, just different.
Inbreeding
Animals in mods using this library may have reduced fertility if they are inbred. If you don't want to think about the details, just try to avoid breeding close relatives like parents or siblings together.
Inbreeding is based on real-life genetics rather than popular conception, so you may find these details surprising:
- If you do inbreed animals, due to genetic purging the offspring will tend to be more resistant to inbreeding than their parents were. This will not change fast enough to avoid the negative effects.
- An animal will only be inbred if both its parents are related - so if you have two different very inbred families (say, one player's ranch and another player's ranch), crossing them will produce offspring that are not inbred at all, but are related to both families.
- Inbreeding for multiple generations in a row is much worse than doing it just once. One of the worst possible strategies is to breed siblings together, then breed their children together and repeat. The only worse strategy is this one.
- If you are only able to capture one pair of animals from the wild, there are still better and worse breeding strategies you can do with them. Worse ones are as above. Better is to get at least 2 male and 2 female offspring from the original pair (the more the merrier), then you only need to cross siblings once before you can start working with cousin pairings.
- The system is not based on family trees so you can't trick it by finding obscure relations that don't count. Distant relatives count a tiny bit and close relatives count a lot. Overall I'd recommend trying to keep things around cousins range or less.
- Small amounts of inbreeding are unlikely to cause problems. If you follow the tree of life back far enough we're all just a little bit related anyway.
Reduced fertility will show as:
- With vanilla breeding mechanics: The female's portions eaten will go down to 0 without her becoming pregnant.
- With Detailed Animals: The female will become pregnant, but then miscarry. Or for egg layers, the egg will lose its fertility during incubation.
Why was this feature added? Because I want to later add genetics for traits such as size, health, maybe stamina, and so on. And an interesting detail of realistic genetics that most people don't expect is that if you are breeding to maximize or minimize a certain trait you need to avoid too much inbreeding. Inbreeding makes animals very similar to one another, but if you're trying to change a trait, you want them to be different. So this time I added in a reason to avoid that right from the start, and this one was the gentlest possible implementation I could think of.
See https://github.com/sekelsta/genelib/wiki/Configuration for info on how you can configure this mod.
Languages
English, Spanish (Español). I am a beginner at Spanish so please let me know if there are errors, por favor dime si hay errores.
French (Français) --- Thanks to Flamby38
German (Deutsch) --- Thanks to Brady_The
Polish (Polski) --- Thanks to Niexyk
Portuguese, Brazilian (Português brasileiro) --- Thanks to Zatin
Russian (Русский) --- Thanks to ИгОорКа
Ukrainian (українська) --- Thanks to DeanBro
As of version 1.1.4, English, Spanish, German, Polish, Portuguese, Ukrainian, and Russian are complete and up-to-date.
Logo credit: Wikimedia commons
If you find a bug, please first try updating your mod version in case it was already fixed, then let me know on discord or on the github issue tracker.
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 2.1.6 | genelib | 715 | 2 days ago | genelib_2.1.6.zip | 1-click install | ||
| |||||||
| 2.1.5 | genelib | 5909 | Nov 11th at 2:11 PM | genelib_2.1.5.zip | 1-click install | ||
|
Hotfix for exception spam for entities pregnant with wrong code, needs a proper fix later | |||||||
| 2.1.4 | genelib | 6908 | Oct 26th at 9:02 PM | genelib_2.1.4.zip | 1-click install | ||
|
More tweaks to handle the detailedanimals/seasonalbreeding split | |||||||
| 2.1.3 | genelib | 624 | Oct 26th at 1:26 AM | genelib_2.1.3.zip | 1-click install | ||
|
Fixes a crash introduced in 2.1.2 | |||||||
| 2.1.2 | genelib | 573 | Oct 25th at 2:07 PM | genelib_2.1.2.zip | 1-click install | ||
| 2.1.1 | genelib | 4093 | Oct 20th at 12:48 PM | genelib_2.1.1.zip | 1-click install | ||
|
Now displays animal breeding season more precisely (to one third of a month) rather than only saying spring or fall | |||||||
| 2.1.0 | genelib | 6231 | Oct 6th at 3:13 AM | genelib_2.1.0.zip | 1-click install | ||
|
Tweaks to Spanish translation (Thanks, NeoB!) | |||||||
| 2.0.0 | genelib | 8616 | Sep 24th at 2:30 AM | genelib_2.0.0.zip | 1-click install | ||
|
Fixed hens not using the nestboxes | |||||||
| 2.0.0-rc.1 | genelib | 10789 | Aug 27th at 12:31 AM | genelib_2.0.0-rc.1.zip | 1-click install | ||
|
Genelib 2.0 for Vintage Story 1.21 | |||||||
| 1.1.9 | genelib | 7556 | Aug 4th at 10:29 PM | genelib_1.1.9.zip | 1-click install | ||
|
Fixed crash when joining multiplayer without any mods that add genetics | |||||||
| 1.1.8 | genelib | 2256 | Jul 27th at 12:50 PM | genelib_1.1.8.zip | 1-click install | ||
|
Updated Ukrainian translation thanks to DeanBro | |||||||
| 1.1.7 | genelib | 4169 | Jul 11th at 12:15 PM | genelib_1.1.7.zip | 1-click install | ||
|
From 1.1.6: | |||||||
| 1.1.5 | genelib | 6550 | Jun 30th at 1:18 PM | genelib_1.1.5.zip | 1-click install | ||
|
Possible fix for multiple foals from a single mating (more than expected from rare twin chance) | |||||||
| 1.1.4 | genelib | 1970 | Jun 21st at 3:53 PM | genelib_1.1.4.zip | 1-click install | ||
|
Add Ukrainian translation thanks to DeanBro | |||||||
| 1.1.3 | genelib | 1349 | Jun 19th at 3:53 PM | genelib_1.1.3.zip | 1-click install | ||
|
Fix bug where litter size json (specifically spawnQuantityMax) was interpreted incorrectly | |||||||
| 1.1.2 | genelib | 344 | Jun 18th at 1:46 PM | genelib_1.1.2.zip | 1-click install | ||
|
Slightly more specific error reporting | |||||||
| 1.1.1 | genelib | 3455 | Jun 4th at 5:49 PM | genelib_1.1.1.zip | 1-click install | ||
|
Fix out of bounds array access from genelib.multiply | |||||||
| 1.1.0 | genelib | 364 | Jun 4th at 10:29 AM | genelib_1.1.0.zip | 1-click install | ||
|
Move naming/info and inbreeding avoidance from Detailed Animals to here If using Truth and Beauty: Detailed Animals you MUST update that mod to version 0.5.1+ when updating this one | |||||||
| 1.0.4 | genelib | 1298 | May 30th at 8:53 PM | genelib_1.0.4.zip | 1-click install | ||
|
A probable future feature will go better if you play with this version instead of the older one | |||||||
| 1.0.3 | genelib | 843 | May 20th at 7:30 PM | genelib_1.0.3.zip | 1-click install | ||
|
Recompile for Vintage Story 1.20.11-rc.1 | |||||||
| 1.0.2 | genelib | 1127 | May 19th at 3:59 PM | genelib_1.0.2.zip | 1-click install | ||
|
Fix wildtype genes being chosen more often than intended | |||||||
| 1.0.1 | genelib | 61 | May 16th at 2:13 PM | genelib_1.0.1.zip | 1-click install | ||
|
Recompile for VS 1.20.11-rc.1 | |||||||
| 1.0.0 | genelib | 497 | May 16th at 10:24 AM | genelib_1.0.0.zip | 1-click install | ||
|
First release. Compatible with VS 1.20.10 only, not with VS 1.20.11-rc.1. | |||||||
is there a command or setting to disable stuff like miscarrages?
that was it. removed universal husbandry and now log is nice and clean even after skipping 10 years :D
Damonicus1986 Check which mod combinations it happens with. Maybe something else is patching the breeding behavior and it's conflicting. In particular, don't use Universal Husbandry and Detailed Animals together.
Exception: game:fox-red-adult-female attempted to hatch or give birth to entity with code game:, but no such entity was found.
at Genelib.GeneticMultiply.SpawnNewborn(IWorldAccessor world, EntityPos pos, Entity foster, Int32 nextGeneration, TreeAttribute childData) in /home/tiffany/dev/vintage/genelib/src/Entity/Behavior/GeneticMultiply.cs:line 396
at Genelib.GeneticMultiply.GiveBirth(Single q) in /home/tiffany/dev/vintage/genelib/src/Entity/Behavior/GeneticMultiply.cs:line 385
at Genelib.GeneticMultiply.CheckMultiply(Single dt) in /home/tiffany/dev/vintage/genelib/src/Entity/Behavior/GeneticMultiply.cs:line 145
at Vintagestory.Common.EventManager.TriggerGameTick(Int64 ellapsedMilliseconds, IWorldAccessor world) in VintagestoryLib\Common\EventManager.cs:line 132
at Vintagestory.Server.ServerMain.Process() in VintagestoryLib\Server\ServerMain.cs:line 859
especially when using command to skip time
Would be nice to have beekeeping like in Forestry, with breeding and etc
sekelsta De nada, estamos para ayudar 🙌
: )
Thanks for all your hard work sekelsta
NeoB Gracias para los sugerencias!
Hola la version en español esta muy bien, pero podria sugerirte algunos terminos mas formales en los siguiente traducciones almenos en la es-419
I know, I've been working on it all day.
this could use an update as of 1.21
Gustave_Flubber Looks like you are using the wrong version of something. Use Detailed Animals 0.5.6 with Genelib 1.1.7 on Vintage Story 1.20.12.
So, hello, i'm encountering multiple error like those :
Those would end up clugging my server and crashing it because of outstanding numbers of errors. I had Equus, jaunt, Detailed animals AND the animals mods of FOTSA (Tentharchitect)
Hoping it'll help you center the problem
Jasalina I can't do a thing without the error message. Send it through discord or github, please.
I'm having crashing my game issues with over 100k errors from this mod looking to make something pregnant? was fine for weeks aand then all the sudden I can't play for more than 10 mins before the game crashes from the mods errors.
JustaKobold I've added this info to the description, along with more reasoning for why it is the way it is.
what animal mods does this affect?