Fixed crop growing time on other year length than 96 days. #786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've fixed the growth rate formula:
The formula was using both TFC_Time.timeRatio96 and a timeMultiplier (360/TFC_Time.yearLength), so a longer year was way too slow. For example, a year length of 192 should be taking twice as much days, but instead was taking four time as much. So I removed the timeMultiplier and replaced it with the value used in 96 year length: 3, since it was doing an integer division.
The other solution would be to fix timeMultiplier to a float division instead, remove the usage of TFC_Time.timeRatio96 and extends the growthTime of all CropIndex by 1.25 to counter the fix to timeMultiplier (3.75 instead of 3 on a 96 year length).
Also fixed nutrient draining:
Both SoilMax method and DrainNutrient was using a timeMultiplier based on a 360 year length. SoilMax was getting bigger with longer year, and DrainNutrient was getting slower with longer year. This made nutrient draining extremely slow on longer year and thus making crop growth slightly faster than it should be
Growing time on a 96 year length (default) remains unchanged with this fix and growth time properly scale with other year lenght: on a 192 year length, crops take twice as much time. For example, wheat take roughly 18 days on 96 and 36 ont 192.
Also, you can use the following gist to test crop growth: https://gist.github.com/pgelinas/7a6ac0c79d85554878a7