Infinite Inserter Capacity Bonus Research

by Nick1Z2

This Mod adds a infinity research for inserter capacity bonus. Everything from research scaling and research costs to the capacity bonus of the respective inserters can be adjusted.

Tweaks
3 months ago
1.1 - 2.0
2.92K
Logistics

g Linear works counter-intuitively

a month ago

The formula used for the linear scaling is currently Base * Level + Mult, which is rather the opposite of what the names would suggest. The Base in this case is actually the multiplier on the level, and the Mult is a static addition. Also, the Level starts at 8 (the level of the research) rather than 1 like the exponential version.

Recommend changing the linear equation to Base + Base * Mult * (Level - 7). This means the Base is actually the base, the cost of the research at a theoretical 0th level of infinite research. Mult then represents the multiplier (or percentage) of the base cost to add on each subsequent level, rather like the Mult represents the multiplier of the cost of each subsequent level in the exponential version.

Here's the updates to the code I did locally. I actually shifted the level section to subtract 8 instead of 7, so the cost of the first level of infinite research equals the base cost specified in the mod config, and the mult applies starting at the second level

if wachstumstyp == "Linear" then
  formula = tostring(grundwert) .. " * (1 + " .. tostring(multi) .. "*(L-8))"
elseif wachstumstyp == "Exponentiell" then
  if multi == 0 then multi = 1 end
  formula = tostring(grundwert) .. "*" .. tostring(multi) .. "^(L-8)"
else
  formula = "100*L+1000"
end

With base cost 1000, mult 0.5, this results in 1000, 1500, 2000, 2500, 3000, [...] for linear. With base cost 1000, mult 2, this results in 1000, 2000, 4000, 8000, 16000, [...] for exponential.

Also a suggested modification to the English locale file to better note how this works. I won't insult the German language by trying to handle that locale file.

[technology-name]
infinite-inserter-capacity-bonus=Inserter capacity bonus
[technology-description]
infinite-inserter-capacity-bonus=Every level increases stack/bulk inserter and non-stack/bulk inserter capacity by the amount defined in the mod settings.  Partial stack gains from decimals are rounded down.  Default settings are +2 stack/bulk capacity per level, and +1 non-stack/bulk capacity every 2 levels (0.5 per level).

[mod-setting-name]
iicbr_use-space-science=[item=space-science-pack] use space science
iicbr_grundwert=Research Cost Base
iicbr_multiplikator=Research Cost Multiplier
iicbr_wachstumstyp=Research Scaling
iicbr_greifarm-capacity-bonus=Inserter Capacity Bonus
iicbr_massengreifarm-capacity-bonus=Stack Inserter Capacity Bonus


[mod-setting-description]
use-space-science=When enabled, space science packs are also required for the infinite research.  If disabled, only the 5 basic pre-space science packs are required.
iicbr_grundwert=The base cost of the research at the first infinite research level.  For reference, the last non-infinite technology costs 600 research packs.
iicbr_multiplikator=For exponential, this is the multiplier for how much more expensive each research level is compared to the last (ex. 2 means it doubles in cost each level).  For linear, this is the percentage of the Research Cost Base that is added to the cost at each level (ex. 0.5 means it adds another half of the base cost each subsequent level).

[string-mod-setting]
iicbr_wachstumstyp-Linear=Linear: Base + Base*Mult*(Level-1)
iicbr_wachstumstyp-Exponentiell=Exponential: Base * Mult^(Level-1)

New response