X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FGenome.hpp;h=3361fdef2037d6f913a72ba12c098fe1ddc2e5de;hb=6c1097479fd1ea41f0f76b91e67613822acf2e90;hp=a7be0e1c6f6f4e342a59ba18bb70d6a78d5ba152;hpb=5b2ab168a9b3c05082bd9cd924f548bc90fc8efa;p=blobs.git diff --git a/src/creature/Genome.hpp b/src/creature/Genome.hpp index a7be0e1..3361fde 100644 --- a/src/creature/Genome.hpp +++ b/src/creature/Genome.hpp @@ -3,6 +3,7 @@ #include "../math/Distribution.hpp" #include "../math/GaloisLFSR.hpp" +#include "../math/glm.hpp" #include @@ -19,9 +20,14 @@ struct Genome { template struct PropertySet { + /// the age at which to transition to the next phase T age; + /// maximum body mass T mass; + /// fertility factor T fertility; + /// skin highlight pronounciation + T highlight; }; template struct Properties { @@ -38,6 +44,20 @@ struct Genome { const PropertySet &Elder() const noexcept { return props[4]; } PropertySet &Death() noexcept { return props[5]; } const PropertySet &Death() const noexcept { return props[5]; } + + /// "typical" properties + /// every one of these should have at least one + /// negative impact to prevent super-beings evolving + /// power at the cost of higher solid intake + T strength; + /// more endurance at the cost of higher liquid intake + T stamina; + /// more speed at the cost of higher fatigue + T dexerty; + /// higher mental capacity at the cost of boredom + T intelligence; + /// how likely to mutate + T mutability; }; Properties properties; @@ -70,7 +90,8 @@ struct Genome { return { p.age.FakeNormal(rand.SNorm()), p.mass.FakeNormal(rand.SNorm()), - p.fertility.FakeNormal(rand.SNorm()) + p.fertility.FakeNormal(rand.SNorm()), + glm::clamp(p.highlight.FakeNormal(rand.SNorm()), 0.0, 1.0) }; } @@ -84,7 +105,12 @@ struct Genome { Instantiate(p.props[2], rand), Instantiate(p.props[3], rand), Instantiate(p.props[4], rand), - Instantiate(p.props[5], rand) + Instantiate(p.props[5], rand), + p.strength.FakeNormal(rand.SNorm()), + p.stamina.FakeNormal(rand.SNorm()), + p.dexerty.FakeNormal(rand.SNorm()), + p.intelligence.FakeNormal(rand.SNorm()), + p.mutability.FakeNormal(rand.SNorm()) }; }