Variable Research Costs??? |
I am looking for a way to make a research start at like 500 to research for the first level but get much higher as it goes.
I tried inputing a formula in the tech cost area and it causes the game to crash.
the 2 formulas I tried are
500 + (([%Level%] - 1) * 1000)
500 + (([%Level%]) * 1000)
the goal is to have the tech get exponentially higher to research as it gains levels but make it easy to research the first level.
Re: Variable Research Costs???
Neither of those yields negative research costs. The first one can give a 0 research cost, the second can only do so if [%Base_Cost%] is zero. If the formula is using current tech level for [%Level%] (I couldn't recall if it did or not) then change the formulas to:
[%Base_Cost%] + [%Level%] * [%Level%] * [%Base_Cost%]
or:
[%Base_Cost%] + [%Level%] * [%Level%] * [%Base_Cost%] / 10
As for why it is crashing, what other mods have you made? Have you tried taking stock files and simply adding a "+ 1" onto the end of the tech formulas and see if that works and shows up properly in game?
Re: Variable Research Costs???
As far as I can tell...
The research cost for a tech (the number you have to reach in order to advance a level) is equal to (current_tech_level + 1) * Level_Cost.
If your formula comes up with zero, then the cost to research will be zero.
The game seems to calculate the research time remaining as ammount_spent_so_far / research_cost_for_this_tech.
If the cost for the next level is zero, then you get a number divided by zero. This causes whatever software you are using to self-destruct and crash to desktop, as any number divided by zero is infinite. Don't ask why, its a freaky math thing...
"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
GidMod




Re: Variable Research Costs???
Those formula aren't exponential. You might also want to include base cost in there. Try something like:
[%Level%] * [%Level%] * [%Base_Cost%]
If you are using the stock TechAreas.txt file be aware that level 20 techs will cost 400 times the cost to research level 1.
You can also play with adding in a constant starting value, or just a starting value based on the base cost. For example, the below would give you 100% the base cost for level 1, 110% for level 2, 140% for level 3, 190% for level 4, 260% for level 5, and so on:
[%Base_Cost%] + ([%Level% - 1) * ([%Level%] - 1) * [%Base_Cost%] / 10
Of course, level 20 would be 3710% (37.1 times as much) of level 1's cost, so be aware of your max tech levels.