AnimalGenomeDef (фикс. поля) убран; AnimalDef.Genome теперь словарь geneId->base. AnimalSet.BuildTemplate строит шаблон generically по реестру генов (разброс из самого GeneDef, дискретные поддержаны). Модер добавляет ген особи одной строкой JSON в animals.json — без правки кода. Устраняет блокер расширяемости #1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
129 lines
9.7 KiB
JSON
129 lines
9.7 KiB
JSON
{
|
|
"type": "Gene",
|
|
// Организм-агностичные гены: каждый ген задаёт, как генерируются/мутируют аллели и как ген
|
|
// вкладывается в признаки (effects: имя признака → формула; value — выраженное значение гена).
|
|
// Этот набор покрывает измерения генома растения (его используют системы роста/жизненного цикла).
|
|
"defs": [
|
|
{ "defName": "BaseNumericGene", "abstract": true, "kind": "Numeric",
|
|
"spread": 0.08, "mutationChance": 0.05, "mutationMagnitude": 0.12 },
|
|
|
|
{ "defName": "GeneOptimalLight", "parent": "BaseNumericGene", "label": "gene.optimalLight",
|
|
"default": 0.6, "min": 0.0, "max": 1.0, "tags": ["environment", "light"],
|
|
"effects": { "optimalLight": "value" } },
|
|
{ "defName": "GeneLightTolerance", "parent": "BaseNumericGene", "label": "gene.lightTolerance",
|
|
"default": 0.5, "min": 0.05, "max": 1.0, "tags": ["environment", "light"],
|
|
"effects": { "lightTolerance": "value" } },
|
|
{ "defName": "GeneOptimalTemperature", "parent": "BaseNumericGene", "label": "gene.optimalTemperature",
|
|
"default": 14, "min": -20, "max": 45, "tags": ["environment", "temperature"],
|
|
"effects": { "optimalTemperature": "value" } },
|
|
{ "defName": "GeneTemperatureTolerance", "parent": "BaseNumericGene", "label": "gene.temperatureTolerance",
|
|
"default": 16, "min": 2, "max": 40, "tags": ["environment", "temperature"],
|
|
"effects": { "temperatureTolerance": "value" } },
|
|
// Жёсткие края диапазона роста (модель RimWorld): на сколько °C ниже/выше плато оптимума рост
|
|
// спадает до нуля. Ниже (optimal-tolerance-coldHardiness) или выше (optimal+tolerance+heatHardiness)
|
|
// растение дормантно и копит температурный стресс. Асимметрично: вид может терпеть жару лучше холода.
|
|
{ "defName": "GeneColdHardiness", "parent": "BaseNumericGene", "label": "gene.coldHardiness",
|
|
"default": 8, "min": 0, "max": 40, "tags": ["environment", "temperature"],
|
|
"effects": { "coldHardiness": "value" } },
|
|
{ "defName": "GeneHeatHardiness", "parent": "BaseNumericGene", "label": "gene.heatHardiness",
|
|
"default": 10, "min": 0, "max": 40, "tags": ["environment", "temperature"],
|
|
"effects": { "heatHardiness": "value" } },
|
|
{ "defName": "GeneOptimalFertility", "parent": "BaseNumericGene", "label": "gene.optimalFertility",
|
|
"default": 1.4, "min": 0.1, "max": 3.0, "tags": ["environment", "soil"],
|
|
"effects": { "optimalFertility": "value" } },
|
|
{ "defName": "GeneFertilityTolerance", "parent": "BaseNumericGene", "label": "gene.fertilityTolerance",
|
|
"default": 0.9, "min": 0.1, "max": 3.0, "tags": ["environment", "soil"],
|
|
"effects": { "fertilityTolerance": "value" } },
|
|
|
|
{ "defName": "GeneVigor", "parent": "BaseNumericGene", "label": "gene.vigor",
|
|
"default": 1.0, "min": 0.1, "max": 3.0, "tags": ["growth"],
|
|
"effects": { "vigor": "value" } },
|
|
{ "defName": "GeneLifespan", "parent": "BaseNumericGene", "label": "gene.lifespan",
|
|
"default": 160, "min": 5, "max": 500, "tags": ["lifecycle"],
|
|
"effects": { "lifespan": "value" } },
|
|
{ "defName": "GeneDispersalRange", "parent": "BaseNumericGene", "label": "gene.dispersalRange",
|
|
"default": 2, "min": 1, "max": 8, "tags": ["lifecycle", "reproduction"],
|
|
"effects": { "dispersalRange": "value" } },
|
|
{ "defName": "GeneReproduceInterval", "parent": "BaseNumericGene", "label": "gene.reproduceInterval",
|
|
"default": 14, "min": 1, "max": 60, "tags": ["lifecycle", "reproduction"],
|
|
"effects": { "reproduceInterval": "value" } },
|
|
{ "defName": "GeneSelfPollination", "parent": "BaseNumericGene", "label": "gene.selfPollination",
|
|
"default": 0.2, "min": 0.0, "max": 1.0, "tags": ["reproduction"],
|
|
"effects": { "selfPollination": "value" } },
|
|
{ "defName": "GeneMutationRate", "parent": "BaseNumericGene", "label": "gene.mutationRate",
|
|
"default": 0.05, "min": 0.0, "max": 1.0, "tags": ["reproduction"],
|
|
"effects": { "mutationRate": "value" } },
|
|
|
|
// --- Контент (фаза G4): плодоношение, добыча, цвет ---
|
|
{ "defName": "GeneFruitYield", "parent": "BaseNumericGene", "label": "gene.fruitYield",
|
|
"default": 0, "min": 0, "max": 12, "tags": ["fruiting"],
|
|
"effects": { "fruitYield": "value" } },
|
|
{ "defName": "GeneFruitSeason", "parent": "BaseNumericGene", "label": "gene.fruitSeason",
|
|
"default": 1, "min": 0, "max": 3, "spread": 0, "mutationChance": 0, "tags": ["fruiting"],
|
|
"effects": { "fruitSeason": "value" } },
|
|
{ "defName": "GeneHarvestAmount", "parent": "BaseNumericGene", "label": "gene.harvestAmount",
|
|
"default": 1, "min": 0, "max": 50, "tags": ["harvest"],
|
|
"effects": { "harvestAmount": "value" } },
|
|
{ "defName": "GeneLeafHue", "parent": "BaseNumericGene", "label": "gene.leafHue",
|
|
"default": 0.33, "min": 0, "max": 1, "spread": 0.04, "tags": ["morphology", "color"],
|
|
"effects": { "leafHue": "value" } },
|
|
|
|
// Производный ген: признак собирается группировкой по регэкспу — сумма всех генов-толерантностей
|
|
// (демонстрация gsom-функций фазы G5). Собственное значение гена не используется.
|
|
{ "defName": "GeneHardiness", "parent": "BaseNumericGene", "label": "gene.hardiness",
|
|
"default": 0, "min": 0, "max": 1, "spread": 0, "mutationChance": 0, "tags": ["derived"],
|
|
"effects": { "hardiness": "gsum('Gene.*Tolerance')" } },
|
|
|
|
// --- Животные (фаза A1): организм-агностичные гены зверя (их несёт геном животного) ---
|
|
{ "defName": "GeneMaxBodySize", "parent": "BaseNumericGene", "label": "gene.bodySize",
|
|
"default": 1.0, "min": 0.1, "max": 4.0, "tags": ["animal", "body"],
|
|
"effects": { "bodySize": "value" } },
|
|
{ "defName": "GeneMetabolism", "parent": "BaseNumericGene", "label": "gene.metabolism",
|
|
"default": 1.0, "min": 0.2, "max": 3.0, "tags": ["animal", "metabolism"],
|
|
"effects": { "metabolism": "value" } },
|
|
{ "defName": "GeneMoveSpeed", "parent": "BaseNumericGene", "label": "gene.moveSpeed",
|
|
"default": 1.0, "min": 0.2, "max": 3.0, "tags": ["animal", "movement"],
|
|
"effects": { "moveSpeed": "value" } },
|
|
{ "defName": "GeneBloodVolume", "parent": "BaseNumericGene", "label": "gene.bloodVolume",
|
|
"default": 1.0, "min": 0.2, "max": 3.0, "tags": ["animal", "health"],
|
|
"effects": { "bloodVolume": "value" } },
|
|
{ "defName": "GeneVision", "parent": "BaseNumericGene", "label": "gene.vision",
|
|
"default": 1.0, "min": 0.2, "max": 3.0, "tags": ["animal", "senses"],
|
|
"effects": { "vision": "value" } },
|
|
{ "defName": "GeneBrainSize", "parent": "BaseNumericGene", "label": "gene.brainSize",
|
|
"default": 0.45, "min": 0.0, "max": 1.0, "spread": 0.03, "tags": ["animal", "brain"],
|
|
"effects": { "brainSize": "value" } },
|
|
{ "defName": "GeneInsulation", "parent": "BaseNumericGene", "label": "gene.insulation",
|
|
"default": 0.5, "min": 0.0, "max": 1.0, "tags": ["animal", "temperature"],
|
|
"effects": { "insulation": "value" } },
|
|
{ "defName": "GeneFurColor", "parent": "BaseNumericGene", "label": "gene.furColor",
|
|
"default": 0.5, "min": 0.0, "max": 1.0, "spread": 0.06, "tags": ["animal", "morphology", "color"],
|
|
"effects": { "furHue": "value" } },
|
|
{ "defName": "GeneMaturityAge", "parent": "BaseNumericGene", "label": "gene.maturityAge",
|
|
"default": 90, "min": 1, "max": 400, "tags": ["animal", "lifecycle"],
|
|
"effects": { "maturityAge": "value" } },
|
|
|
|
// Пол как локус (фаза A3): аллели {X=0, Y=1}; самка XX, самец XY. Эффекта нет — пол читается из
|
|
// самих аллелей (наличие Y), не из выраженного значения. mutationChance 0 (X не мутирует в Y).
|
|
// Генерация особи-основателя задаёт пол явно (XX или XY), чтобы не возник невозможный YY.
|
|
{ "defName": "GeneSex", "kind": "Discrete", "label": "gene.sex",
|
|
"variants": 2, "variantWeights": [0.5, 0.5], "mutationChance": 0, "tags": ["animal", "sex"] },
|
|
|
|
// Размножение (фаза A4): сезон гона фиксирован по виду (0 весна … 3 зима), срок вынашивания и помёт.
|
|
{ "defName": "GeneBreedingSeason", "parent": "BaseNumericGene", "label": "gene.breedingSeason",
|
|
"default": 2, "min": 0, "max": 3, "spread": 0, "mutationChance": 0, "tags": ["animal", "reproduction"],
|
|
"effects": { "breedingSeason": "value" } },
|
|
{ "defName": "GeneGestationDays", "parent": "BaseNumericGene", "label": "gene.gestationDays",
|
|
"default": 30, "min": 1, "max": 200, "tags": ["animal", "reproduction"],
|
|
"effects": { "gestationDays": "value" } },
|
|
{ "defName": "GeneLitterSize", "parent": "BaseNumericGene", "label": "gene.litterSize",
|
|
"default": 1, "min": 1, "max": 12, "tags": ["animal", "reproduction"],
|
|
"effects": { "litterSize": "value" } },
|
|
|
|
// Дискретный ген морфы: вариант 0 доминирует, 1 (рецессивный) виден только в гомозиготе.
|
|
{ "defName": "GeneMorph", "kind": "Discrete", "label": "gene.morph",
|
|
"variants": 2, "variantWeights": [0.82, 0.18], "mutationChance": 0.05, "tags": ["morphology"],
|
|
"effects": { "variant": "value" } }
|
|
]
|
|
}
|