Index: binaries/data/mods/public/simulation/components/ResourceSupply.js
===================================================================
 binaries/data/mods/public/simulation/components/ResourceSupply.js (rĂ©vision 18978)
+++ binaries/data/mods/public/simulation/components/ResourceSupply.js (copie de travail)
@@ 19,7 +19,7 @@
"" +
"" +
"" +
 "" +
+ "" +
"[" +
"]" +
"";
@@ 81,22 +81,7 @@
return this.gatherers.reduce((a, b) => a + b.length, 0);
};
/** Note to people looking to change in a template: This is a bit complicated. Basically, the lower that number is
 * the steeper diminishing returns will be. I suggest playing around with Wolfram Alpha or a graphing calculator a bit.
 * In each of the following links, replace 0.65 with the gather rate of your worker for the resource with diminishing returns and
 * 14 with the constant you wish to use to control the diminishing returns.
 * (In this case 0.65 is the women farming rate, in resources/second, and 14 is a good constant for farming.)
 * This is the gather rate in resources/second of each individual worker as the total number of workers goes up:
 * http://www.wolframalpha.com/input/?i=plot+%281%2F2+cos%28%28x1%29*pi%2F14%29+%2B+1%2F2%29+*+0.65+from+1+to+5
 * This is the total output of the resource in resources/second:
 * http://www.wolframalpha.com/input/?i=plot+x%281%2F2+cos%28%28x1%29*pi%2F14%29+%2B+1%2F2%29+*+0.65+from+1+to+5
 * This is the fraction of a worker each new worker is worth (the 5th worker in this example is only producing about half as much as the first one):
 * http://www.wolframalpha.com/input/?i=plot+x%281%2F2+cos%28%28x1%29*pi%2F14%29+%2B+1%2F2%29+++%28x1%29%281%2F2+cos%28%28x2%29*pi%2F14%29+%2B+1%2F2%29+from+x%3D1+to+5+and+y%3D0+to+1
 * Here's how this technically works:
 * The cosine function is an oscillating curve, normally between 1 and 1. Multiplying by 0.5 squishes that down to
 * between 0.5 and 0.5. Adding 0.5 to that changes the range to 0 to 1. The diminishingReturns constant
 * adjusts the period of the curve.
 */
+/* The rate of each additionnal gatherer rate follow a geometric sequence, with diminishingReturns as common ratio. */
ResourceSupply.prototype.GetDiminishingReturns = function()
{
if ("DiminishingReturns" in this.template)
@@ 103,7 +88,11 @@
{
let diminishingReturns = ApplyValueModificationsToEntity("ResourceSupply/DiminishingReturns", +this.template.DiminishingReturns, this.entity);
if (diminishingReturns)
 return (0.5 * Math.cos((this.GetNumGatherers()  1) * Math.PI / diminishingReturns) + 0.5);
+ {
+ let numGatherers = this.GetNumGatherers();
+ if (numGatherers > 1)
+ return (1.  Math.pow(diminishingReturns, numGatherers)) / (1.  diminishingReturns) / numGatherers;
+ }
}
return null;
};
Index: binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml
===================================================================
 binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml (rĂ©vision 18978)
+++ binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml (copie de travail)
@@ 49,11 +49,7 @@
Infinity
food.grain
5

 14
+ 0.90