Scale down recruitment cost
It scales down a range of recruitment costs to fit min max values.
– Before (45x difference)
145 (peasant archers) – 6600 (heavy xiliang cavalry, White horse fellows, etc)
– After (22.25x difference)
145 (peasant archers) – 3300 (heavy xiliang cavalry, White horse fellows, etc)
– AI will use top tier units a little better and will also be able to redeploy them well.
It solves some of the problems of AI using only low-cost strategist and not using a high redeployment cost generals.
Array.prototype.scaleBetween = function(scaledMin, scaledMax) {
var max = Math.max.apply(Math, this);
var min = Math.min.apply(Math, this);
return this.map(num => (scaledMax-scaledMin)*(num-min)/(max-min)+scaledMin);
}