This function allows scaling by map area instead of its size. The area grows as square of its size, so it is quite different. This is particularly useful in order to place resources or other elements in the same density among all map sizes, something which I believe is not achievable with the scaleByMapSize function. It is quite surprising to me that such a function didn't exist already.
For example, resources such as berries, animals and mines generally should have the same density among all map sizes, and I believe should use that function. It's a different thing for forests however, as their size also depend on map size which makes sense.
Explanation of arguments:
- base: the quantity you expect for the smallest map, which allows for a good initial guess
- reduction: The area you would like to substract to the total map area. Useful because the fraction of the area in which you can't place the desired resource can vary indepedently from map area. For example, if you can't place a resource close to a player, then you can make it count by summing area close to player and using this argument. Another example could be if water can take more or less place in the map randomly.
If counting players is a common occurence then there could be another very similar function which takes care of that.
This patch can be useful to discuss D3995, because this can simplify deciding resource quantities as the "max" argument is no longer necessary for many cases since it doesn't make sense