- Home /
How would you go about making an animal breeding System
So I would like to try to make a breeding system for animal that would work similarly to the one that the Minecraft Forestry mod uses for its bee breeding mechanic.
If you are unfamiliar with the system you can take 2 bees with different traits combine them together and they will combine and produce a new bee with the combined traits of the parents.
I am unsure how i would go about beginning to implement a system like this and therefore would like some pointers and/or suggestions of how I should go about it.
Answer by tanoshimi · Jul 18, 2016 at 06:24 PM
I suggest you research "genetic algorithms". There are plenty of free explanations and code examples. Here's one good place to start: http://natureofcode.com/book/chapter-9-the-evolution-of-code/
Answer by Dwiss · Dec 27, 2016 at 10:05 AM
I would actually suggest to keep it simple to begin with. Genetic algorithms are a completely different method meant to be used for learning systems for an AI etc - what you want is basically some simple functionality like adding and subtracting traits and features to and from each other.
One way to obtain such functionality would be a simple array filled with both the mother and the fathers traits and features which are then added into a new entity = child. If you want to restrict the number of traits to be received by the child you could use a randomizer to pick a specific number from each of the parents and then add them to the child. If random isnt good enough work with priorities - from front to end so to say. Traits located in the front will have a high chance of being transferred to the child and so on.
Implementation wise you would create a prefab 'person' and create a new instance from that based of 2 parent's traits.
Your answer
Follow this Question
Related Questions
Accessing local system ( File Browser ) 2 Answers
C# help in walking and jumping 1 Answer
Creating a Quest system 2 Answers
inventory system issues 0 Answers
why do i get 0 2 Answers