RP Rebalanced Technology Costs


Algorithmically changes the costs of technologies and increases your usage of basic science packs when researching advanced techs. Both features are optional and have several algorithms to choose from. See the mod portal for details, examples, and graphs.

Tweaks
9 months ago
1.1 - 2.0
296
Manufacturing

g Compatibility issues with exotic industries

4 months ago

https://mods.factorio.com/mod/exotic-space-industries

Using the two mods (and a whole lot of others) together seems to make huge portion of the researches to not be touched at all by this mod (not listed in mods that touch a given research) and another huge portion to be classified as special and thus not getting their costs altered.

Trying to make this mod have soft-dependency on exotic industries simply caused stack overflow in calculating research costs.

Before I added EI to my modpack I had the cumulative amount of red science used at around 17 million according to https://mods.factorio.com/mod/research-counter-fixed/. After adding EI it dropped down to mere 68k with other science packs seeing similar several orders of magnitude drops.

4 months ago

Did a bit of debug logging and saw this:

special-looking tech: ei-steam-power effect_type_set['nothing] = {
  nothing = true,
  ["unlock-recipe"] = true
}

Logging out the effects of tech I saw the issue:

{
  {
    recipe = "ei-steam-miner",
    type = "unlock-recipe"
  },
  {
    effect_description = {
      "description.tech-counts-for-age-progression"
    },
    icon = "__exotic-space-industries-graphics-1__/graphics/other/tech_overlay.png",
    icon_size = 64,
    infer_icon = false,
    type = "nothing"
  }
}

EI is using the type "nothing" for some internal functionality. I changed the speciality-check to this line (no idea if it breaks anything) and it helped somewhat but it still leaves a whole lot of research entirely untouched by this mod

        elseif (effect_type_set['nothing'] and tablex.get_size(effect_type_set) == 1) or tablex.is_empty(effect_type_set) then

I don't know too much about the internals but wouldn't it make sense to check for if any recipes get unlocked instead of checking for existence of "nothing" effects?

4 months ago

I figured out that the tech cost issue was caused by EI itself having some runtime tech scaling thing that starts off by setting all the costs at 10 and changing them as the game progresses.

Though the "nothing" problem is still valid, I think

4 months ago

turning off the EI tech scaling was only a partial fix it seems. It will still reset the technology costs due to being loaded after this mod. I've asked around in EI discord but haven't received relevant feedback yet. From what I can see in their code they're replacing science packs with their own variants in final-fixes and alter the costs as well. I guess a fix from this mod side would be to deal with the loops in tech tree EI creates that causes this mod to fail.

4 months ago
(updated 4 months ago)

Sorry if I'm being spammy. I'm describing my findings hoping it will help you. If this is something that needs to be fixed from other mods side please tell me so I can go bug them instead :)

Doing some more debugging to get this mod load after EI I'm getting the stack overflow problem. Seems like it isn't quite caused by EI itself but in combination with muluna (with muluna and without EI there was no stack overflow). Unlocking space science with muluna initially allows crafting it only on the surface of the moon. Muluna adds adds advanced space research technology that allows crafting the pack in space as well.

When your mod goes looking for the tier of space science pack it finds the advanced variant that itself requires space science pack to research and thus ends up in an infinite loop of trying to find the tier for space science pack.

Looking at the code in muluna, the advanced variant depends on space science but in-game that dependency is seemingly removed by science-pack-dependencies mod. Trying to remove that mod is tricky as it causes a whole lot of other circular dependencies in get_tech_ancestor_depth

[edit]
Verified that indeed science pack dependencies is removing them:

  12.424 Script @__science-pack-dependencies__/make_dependencies.lua:143: << removed prerequisites space-science-pack, production-science-pack from advanced-space-science-pack

[edit]
Adding an extremely ugly hack to science-pack-dependencies to not remove prerequisities for space-science-pack made everything work fine - your mod can now have soft dependency on EI and the costs of science are not being overwritten by EI. Though this just made me see that due to how EI removes lower tier packs from more advanced technologies sort of breaks your mod tier calculations messing up the cost calculations. Without EI the late-game research cost me a few million iterations, with EI it is in the low thousands.

New response