Fair Allocation of Independent Resources (F.A.I.R)

FAIR is a fix to "unfair" map generators, providing a statistical analysis of the ratio of resources discovered, and "flipping" newly generated resources to less fairly distributed resources. This should prevent maps with hard to find resources, like stone or coal.

EvoGUI

If you're an EvoGUI fan, there is a FAIR addon to provide sensors that show how fairly each resource has been generated so far!

How It Works

FAIR counts each resource that is spawning after map generation. It waits until map generation is finished for each chunk generated, so any map generator (whether it is vanilla or RSO or something else) should be compatible. FAIR counts up resources, and tries to maintain the balance of resources based on a pre-set config, which is below:

So in a game with all resources set to "normal", the total resource number is 4 + 6 + 8 + 4. FAIR will try to ensure that 4/22 resources spawned is coal ore, 6/22 resources is iron-ore, and so on.

Note: FAIR does not begin altering resource map generation until over 500,000 tiles have been explored, or approximately a 500 x 1000 area. (Really not that big. Explore a tiny bit!)

FAIR provides a remote API so that mods that create more resources can easily register them. For example:

remote.call("FAIR", "set_resource_fair_ratio", "my-custom-ore", {["very-low"] = 1, low = 2, normal = 4, high = 6, ["very-high"] = 8})

Changelog