The premise of my suggestion is that I have gained more additional quality levels through mods, which usually need to be unlocked in very late stages. For a long-term save, the evolution value of navies often approaches the upper limit of 1 in the early and middle stages of the game. Without adding many mods with super powerful weapons, it is often difficult to resist.
Biters below the legendary level, although their defense difficulty is greatly increased under normal circumstances, can still be defended overall. The biggest problem with higher quality Biters is that their attack range will greatly increase with their quality level. In the blue quality stage, there are no weapons that can attack high-quality long-range Biters
My current solution is to modify your mod based on your code and add biters that exceed the legendary level to the 0.9-0.99 stage.
Then, through another mod, after the evolution value reaches 0.9, the three evolution factors are modified to 1/10 of the initial value, thereby delaying the appearance of the bitcers after the legend.
As for the issue of growth rate in the later stage, it seems a bit troublesome ..
I don't know if this can be achieved. Divide "r" into 100 parts and assign a fixed probability (0.01, 0.02, 0.04, 0.08, 0.16, 0.69) to the quality in descending order of probability. The probability will be updated every time a new quality appears. When the seventh quality appears, set the probability of the seventh quality to 0.01 and upgrade the probabilities of other qualities to the next level. At the same time, reduce the probability of normal quality so that the total probability still adds up to 100% (for example: 0.01, 0.02, 0.04, 0.08, 0.16, 0.16, 0.53), and add more qualities down in descending order. 0.01, 0.02, 0.04, 0.08, 0.16, 0.16, 0.16, 0.37), when normal After reducing the quality to 0.01, start reducing the probability of green quality, and then reduce the probability of blue quality after reducing the probability of green quality to 0.01 (I'm not sure if the insect nest's complete failure to produce normal quality biters will interfere with the game process) ..
This sounds a bit complicated and I don't know if it can be implemented. I don't understand the code, and I used to want to ask AI how to modify the code according to this design. However, the solutions given by AI are difficult to implement, and AI often fabricates some parameters in the code that are not available in factorio games. So, after trying for a while, I gave up ..
As for how much absolute evolution value does a certain quality of biters need to reach before unlocking, can it read all the qualities in the game and add them to the settings? By default, a less rigorous value is set, allowing players to modify the value themselves?