Topic on User talk:Cheldra

Jump to navigation Jump to search
Line 3: Line 3:
 
Meat and leather yield all go through a post processing curve with points (0,0), (5,14), (40,40), (100000,100000) defined in Data/Core/Defs/Stats/Stats_Pawns_General.xml, which effectively increases values below 40. For example, baby ducks would have a meat yield of 0.03*140 = 4, but the post-process curve increases it to 12.
 
Meat and leather yield all go through a post processing curve with points (0,0), (5,14), (40,40), (100000,100000) defined in Data/Core/Defs/Stats/Stats_Pawns_General.xml, which effectively increases values below 40. For example, baby ducks would have a meat yield of 0.03*140 = 4, but the post-process curve increases it to 12.
  
I don't know how possible it would be to implement the curve within the wiki, if it is straightforward, here's my python function in case it's helpful:
+
I don't know how possible it would be to implement the curve within the wiki, but if it is straightforward, here's my python function in case it's helpful:
  
    def post_process_curve(pre, x=[0, 5, 40, 10000], y=[0, 14, 40, 10000]):
+
def post_process_curve(pre, x=[0, 5, 40, 10000], y=[0, 14, 40, 10000]):
    for i in range(len(x)):
+
for i in range(len(x)):
    if pre < x[i]:
+
if pre < x[i]:
    gradient =  (y[i] - y[i - 1])/(x[i] - x[i - 1])
+
gradient =  (y[i] - y[i - 1])/(x[i] - x[i - 1])
    progress = pre - x[i - 1]
+
progress = pre - x[i - 1]
    return y[i - 1] + gradient*progress
+
return y[i - 1] + gradient*progress