realbrit70 wrote:Just saw this and haven't had a chance to download and look at it yet but wanted to comment that I'd had the same idea of tweaking the economics and I wondered how you'd done it.
The central idea is the Economic Balance [this.econBalance].
Every system is at the center of its own cluster of stars. A cluster consists of every system within 7 LY. Clusters are either Industrial (this.econBalance < 0), Agricultural (this.econBalance > 0), or at equilibrium (this.econBalance == 0).
Every system in the cluster is assigned a value from -4 to +4, depending on its economy (RichInd is -4; PoorAg is +4) and its distance from the player's present system (the greater the distance, the lower the influence of that system on this.econBalance).
There are other factors. The distance to the nearest agricultural system is subtracted from the distance to the nearest industrial system, and that number is added to this.econBalance. Then the total number of industrial systems is subtracted from the total number of agricultural systems. This result is also added to this.econBalance.
I've done a few systems "by hand" to ensure that the code is actually doing what I intended it to do. The results for Malama and Qudira (in galaxy 0) are:
-------------------------------------------------------------
Malama [RI -4] econBalance: -12.1 Market: "IND_over_AG_4"
NearestAgSystem 1.2 LY / NearestIndSystem 3.6 LY [+2.4]
AgEconomies 4 / IndEconomies 7 [-3]
-------------------------------------------------------------
Malama is 6.4 light-years from Zaatxe [RI -1.5]
Malama is 4 light-years from Esbiza [RI -2]
Malama is 6.8 light-years from Alaza [AA +0.5]
Malama is 4.8 light-years from Soinuste [PI -2]
Malama is 5.6 light-years from Celabile [MA +0]
Malama is 1.2 light-years from Qudira [PA +3]
Malama is 3.6 light-years from Inines [RI -2]
Malama is 6.4 light-years from Bierle [RI -1.5]
Malama is 6 light-years from Edreor [MA +0]
Malama is 6.8 light-years from Anle [RI -1]
Malama is 6.8 light-years from Tianve [RI -1]
-------------------------------------------------------------
Qudira [PA +4] econBalance: -15.8 Market: "AG_under_IND_4"
NearestAgSystem n/a / NearestIndSystem 1.2 LY [-5.8]
AgEconomies 2 / IndEconomies 6 [-4]
-------------------------------------------------------------
Qudira is 3.2 light-years from Esbiza [RI -2]
Qudira is 1.2 light-years from Malama [RI -3]
Qudira is 6.8 light-years from Aate [MI -0]
Qudira is 3.2 light-years from Soinuste [PI -1]
Qudira is 6.8 light-years from Celabile [MA +0]
Qudira is 4.4 light-years from Inines [RI -2]
Qudira is 4.8 light-years from Bierle [RI -2]
Qudira is 6.8 light-years from Edreor [MA +0]
-------------------------------------------------------------
I hope this answers your question.