Logo Platform
logo amplifiers simplified

Dynamic Growth Costs

Reply
Copied to clipboard!
7 years ago
Aug 10, 2018, 6:41:10 PM

I am currently trying to mod Growth costs to increase based on the current system population much like Riftborn do for their Industry costs. However, I have a very odd bug.


This is my current code change for line 66 of the Registry where growth formulae are kept


<GrowthFormula>((300 + (150 * Property(Empire, @ClassEmpire/ClassStarSystem, Population))) * Property(Empire, @ClassEmpire, GameSpeedMultiplier) * $(Population))</GrowthFormula> 


But unfortunately this is the result it produces


As you can see, the actual Growth Stock requirement is working exactly as I intended, having been set to 750 (300 + (150 * Current Population)), but there is an inexplicable -300 Growth stock on turn one. If I end the turn it turns into a positive growth stock, then the turn after that goes negative again, resulting in an infinite loop of the third pop on the system starving and coming back.


I cannot for the life of me figure out what's going on here, and I am absolutely going to continue with this particular form of my idea, so I would appreciate some help from a game designer who can tell me why the game is inflicting that -300 malus and how I can stop it, keeping in mind I actually don't understand a lot of the code base of this game. (I am still figuring out what exactly Properties even are or where they are found)

Updated 7 years ago.
0Send private message
7 years ago
Aug 13, 2018, 7:42:13 AM

Hey IceGremlin,


The Growth formula represents the total growth stock needed to own a population unit.

It means that if it becomes greater because of an external factor, your growth will be "worth" less populations, and you'll lose population units.


Here's what happens with your formula:

- When there are 2 populations on the empire and 2 in the system, the total required growth to keep the 2nd population is (300 + (150 x 2)) x 2 = 1200.

- The required growth to gain an additional population unit is (300 + (150 x 2) x (2 + 1) = 1800.

- But when the population is gained, the required growth to keep the 3rd population is (300 + (150 x 3)) x 3 = 2250.

- Because your growth stock on the system is only 1800, it's not enough to keep the 3rd population and it is lost.


Note that the 750 shown in GUI is the difference between the required amount of growth for a 5th population and the required growth to keep the 4th (3000 - 2250 = 750).


Unfortunately the formula does not have direct access to the system (eg. using Property(System, ...)) so I don't think it is possible to do what you want to do the way you want to do it.

Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message