Soil fertility scales calendar-driven plant growth

Bump the engine submodule to f39ee9e (half-texel UV inset that removes the
black tile seams seen while zooming). Add a Fertility multiplier to
TerrainDef (forest soil rich, sand/mountain poor); plants record their
cell's fertility as PlantGrowth.GrowthRate at spawn, and the growth system
multiplies the per-frame calendar day-delta by it — so growth stays tied to
the in-game calendar and runs faster on fertile soil.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-12 13:45:00 +03:00
co-authored by Claude Opus 4.8
parent 9f67c478a2
commit 147ab203f1
6 changed files with 16 additions and 6 deletions
+6
View File
@@ -33,6 +33,12 @@ public sealed class TerrainDef : Def
/// <summary>Растительность, рассыпаемая по клеткам этого террейна.</summary>
public List<ScatterEntry> Scatter { get; init; } = [];
/// <summary>
/// Плодородность почвы — множитель скорости роста растений на этом террейне (1 — норма,
/// больше — быстрее). Богатая лесная почва растит быстрее песка/камня.
/// </summary>
public float Fertility { get; init; } = 1f;
/// <summary>Цвет тонировки из <see cref="Rgb"/>.</summary>
public Color Tint => Rgb is [var r, var g, var b, ..] ? new(r, g, b) : Color.Magenta;
}
+1
View File
@@ -56,6 +56,7 @@ internal static class ScatterSpawner
Species = index,
Stage = stage,
AgeDays = age,
GrowthRate = terrain.Fertility,
}
);
}
+3
View File
@@ -17,4 +17,7 @@ public struct PlantGrowth : IComponent
/// <summary>Накопленный возраст в игровых днях.</summary>
public float AgeDays;
/// <summary>Множитель скорости роста (плодородность клетки): 1 — норма, больше — быстрее.</summary>
public float GrowthRate;
}
+1 -1
View File
@@ -37,7 +37,7 @@ public sealed class PlantGrowthSystem(PlantSet plants, Calendar calendar, int ce
continue; // уже зрелое — рост окончен
}
grow.AgeDays += deltaDays;
grow.AgeDays += deltaDays * grow.GrowthRate; // плодородность ускоряет/замедляет рост
var changed = false;
while (
grow.Stage < stages.Length - 1