Plants now live full lives. The genome gains lifespan, dispersal, fecundity, self-pollination, mutation-rate and a discrete dominant/recessive Morph gene; PlantGenome.Breed models meiosis (one allele per parent) plus mutation. A gated PlantLifecycleSystem builds a per-cell grid (density + a species/genome representative), reaps plants past their lifespan, and lets mature plants seed offspring — cross-pollinating with a mature same-species neighbour in dispersal range (falling back to self-pollination by gene) into a nearby land cell under the density cap. A shared PlantFactory creates every plant (initial scatter, births, save restore) and tints recessive-morph plants. Growth keeps aging mature plants so they can die of old age. The whole population (genomes, positions, age, stage) is saved to WorldSave and restored on load instead of re-scattering from the seed. plants.json carries the new genes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 lines
2.9 KiB
JSON
43 lines
2.9 KiB
JSON
{
|
|
"type": "Plant",
|
|
"defs": [
|
|
{ "defName": "BaseTree", "abstract": true, "sizeCells": 2.0, "trunkRadiusCells": 0.28,
|
|
"genome": { "optimalLight": 0.6, "lightTolerance": 0.5, "optimalTemperature": 14, "temperatureTolerance": 16,
|
|
"optimalFertility": 1.4, "fertilityTolerance": 0.9, "vigor": 1.0,
|
|
"lifespan": 160, "dispersalRange": 2, "reproduceInterval": 14, "selfPollination": 0.2,
|
|
"mutationRate": 0.05, "variantChance": 0.15, "spread": 0.08 },
|
|
"stages": [
|
|
{ "texture": "things/plant/seed_default", "sizeCells": 0.6, "growDays": 4, "label": "plant.stage.seedling" },
|
|
{ "sizeCells": 1.2, "growDays": 9, "label": "plant.stage.sapling" },
|
|
{ "sizeCells": 2.0, "label": "plant.stage.mature" }
|
|
] },
|
|
{ "defName": "TreeOakA", "parent": "BaseTree", "label": "plant.oak", "texture": "things/plant/treeoak/TreeOakA" },
|
|
{ "defName": "TreeOakB", "parent": "BaseTree", "label": "plant.oak", "texture": "things/plant/treeoak/TreeOakB" },
|
|
{ "defName": "TreeBirchA", "parent": "BaseTree", "label": "plant.birch", "texture": "things/plant/treebirch/TreeBirchA" },
|
|
{ "defName": "TreeGrayPineA", "parent": "BaseTree", "label": "plant.pine", "texture": "things/plant/treegraypine/TreeGrayPineA" },
|
|
|
|
{ "defName": "GrassA", "label": "plant.grass", "texture": "things/plant/grass/grassa", "sizeCells": 1.2,
|
|
"genome": { "optimalLight": 0.85, "lightTolerance": 0.35, "optimalTemperature": 20, "temperatureTolerance": 12,
|
|
"optimalFertility": 1.0, "fertilityTolerance": 1.0, "vigor": 1.3,
|
|
"lifespan": 22, "dispersalRange": 3, "reproduceInterval": 3, "selfPollination": 0.8,
|
|
"mutationRate": 0.06, "variantChance": 0.2, "spread": 0.1 },
|
|
"stages": [
|
|
{ "texture": "things/plant/seed_default", "sizeCells": 0.5, "growDays": 2, "label": "plant.stage.sprout" },
|
|
{ "sizeCells": 1.2, "label": "plant.stage.mature" }
|
|
] },
|
|
|
|
{ "defName": "BaseBush", "abstract": true, "label": "plant.bush", "sizeCells": 1.4,
|
|
"genome": { "optimalLight": 0.6, "lightTolerance": 0.5, "optimalTemperature": 17, "temperatureTolerance": 13,
|
|
"optimalFertility": 1.1, "fertilityTolerance": 1.0, "vigor": 1.0,
|
|
"lifespan": 60, "dispersalRange": 2, "reproduceInterval": 7, "selfPollination": 0.5,
|
|
"mutationRate": 0.05, "variantChance": 0.18, "spread": 0.1 },
|
|
"stages": [
|
|
{ "texture": "things/plant/seed_default", "sizeCells": 0.6, "growDays": 3, "label": "plant.stage.sprout" },
|
|
{ "sizeCells": 1.4, "label": "plant.stage.mature" }
|
|
] },
|
|
{ "defName": "BushA", "parent": "BaseBush", "texture": "things/plant/bush/BushA" },
|
|
{ "defName": "BushB", "parent": "BaseBush", "texture": "things/plant/bush/BushB" },
|
|
{ "defName": "BushC", "parent": "BaseBush", "texture": "things/plant/bush/BushC" }
|
|
]
|
|
}
|