@Torredebelem and
@Silens, in thinking about this more, do you think it would be possible to implement a simple population dynamic, where your Herd would have a passive Loss and passive Gain that are both dependent on your Herd total, and County Fertility that takes into account it's owner's Herd total? Using a large negative herd_gain_mult at least allows for some kind of Herd decay but it doesn't care about how big your Herd is, which misses a lot of nuance. Like if you had a huge herd and downsized to one province, the fertility of the province should decrease rapidly because you have so many animals and eventually you would start losing a bunch of your Herd total because there's so many animals that can't eat.
I know I'm probably taking the concept of "Herd" more literally than the devs intended, but what I described above
feels like how it should work if one were to do it faithfully and it feels way more fun that the current implementation.
I'm not an expert on the matter, but my guess is that it's not that simple I'm afraid. County fertility and equilibrium, when at 0, have a herd growth of 0. Herd is mana, it always goes up, worst case is that it doesn't grow.
Base Gain = CountyFertility * HERD_GAIN_FROM_COUNTY_MULTIPLIER (with the latter being set to 0.5)
Fertility can never reach negative values, that is the fundamental problem you try to solve here.
You'd have to allow for a scale not from 0 to 100, but from -100 to +100, and that's not as easy as adding or removing a line of code. The base for zero growth would have to be in the middle of the scale, not at the low point. That is only something the devs can do.
If you want to build around that and use the modifiers we have, you'd have to remove all herd capacity bonuses from the game, like deleting each and every one of them. Be it Yurt upgrades, traits, seasons, rank bonuses etc. Every single one of them would have to go, no mercy.
Then you tie hard limit increases of herd size to the number of counties. Let's say 10k herd size per county you hold. Only way to increase herd size limit would be more land. Losing land = less capacity. And it's here already that you'd have to change the balance of 6 max counties on highest rank, you'd have to find a completely new balance.
And then you go ahead and set the penalty for being over the herd size limit not to -0.95 (which is a 95% penalty to growth), but rather set it to -5.00 (a 500% decrease to simulate starvation from overcrowding).
So, now we have land-based herd size limits, and massive starvation when above your limit.
Next would be what I call the Mecca solution. Islam has mandatory Hajj, and you get slapped with a negative modifier to piety the moment you are born, and keep it until you do at least that one pilgrimage. If you do it, the negative modifier is not removed, but rather offset by a positive modifier of the same size, so the net result is zero. That is pretty easy on performance, as it doesn't have to check constantly if someone is or isn't eligible for a modifier. No, it just applies it through one event and is done with it otherwise.
Applied to herd I'd slap a mandatory high penalty on herd growth on everyone, so that herd growth always trends to a strong negative value. And then I'd steer herd growth by adding positive modifiers to the things you desire: county fertility bonuses, seasons, skills etc. Losing some bonuses would put you to negative growth, and that's how you simulate a trending value without actually having a trending scale.
But again, that a looooooot of work. The balancing alone would be a challenge, the sheer amount of files you'd have to comb for every little modifier, and it would still leave the question open of how the AI could handle it. Let alone constantly updating your files after every patch.
It's certainly doable, though, if that was the question. The exact solution you have in mind, which is a dynamic herd-fertility growth/decline based on actual herd size (and not just the limit, with a binary 0 or 1 yes or no exceeding limit or not value), would probably enter the can-only-changed-by-devs territory. But again, I'm not an expert, you'd have to ask a really experienced modder for ideas on such a profound change.