Page 1 of 1

[1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Sun Jan 17, 2021 6:22 pm
by Snowfious
I've had this issue since I think 1.1.8, but that's when I started playing in the first place. Now, I'm not entirely sure if it's a mod, so if others don't have this issue, I'll go into a deep dive into which mod it could be.

What happens, is any kind of update, whether it's the games update, or a mod update. Also happens when you get a new mod for your game. Pretty much what seems to be 80% of any items in the build interface will become undiscovered. So you have to do the usual to get rid of it - hover mouse over. This only happens once when logging back into my save. After, it will not happen once I start the game again. But, once an update happens, the process occurs again. Has anyone else run into this issue?

Re: [1.1.12] Every update causes map items to be undiscovered

Posted: Sun Jan 17, 2021 6:33 pm
by invisus
Sounds similar to 94015

Re: [1.1.12] Every update causes map items to be undiscovered

Posted: Sun Jan 17, 2021 7:03 pm
by Snowfious
Ah yeah, pretty similar thing. Like I said, any kind of updates to mods or the game, or adding a new mod causes this issue. It could very be a mod, I'll investigate.

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Sun Jan 17, 2021 7:16 pm
by Loewchen
Post your log file, see 3638.

Re: [1.1.12] Every update causes map items to be undiscovered

Posted: Sun Jan 17, 2021 7:22 pm
by invisus
Snowfious wrote:
Sun Jan 17, 2021 7:03 pm
Ah yeah, pretty similar thing. Like I said, any kind of updates to mods or the game, or adding a new mod causes this issue. It could very be a mod, I'll investigate.
If it makes it easier in your investigations, the other thread I linked above has a savegame attached. Might be helpful to cross-reference mods. Should help narrow down the list of what might be causing this.

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Mon Jan 18, 2021 3:21 pm
by posila
Bio Idustries does this in on_configuration_changed:

Code: Select all

  -- enable researched recipes
  for i, force in pairs(game.forces) do
    for _, tech in pairs(force.technologies) do
      if tech.researched then
        for _, effect in pairs(tech.effects) do
          if effect.type == "unlock-recipe" then
            force.recipes[effect.recipe].enabled = false
            force.recipes[effect.recipe].enabled = true
          end
        end
      end
    end
  end

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Mon Jan 18, 2021 6:34 pm
by invisus
Great, looks like Snowfious already reported this to the mod author(s).

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Mon Jan 18, 2021 6:43 pm
by kovarex
Ok, since it is the fault of the mod, I'm moving this to not a bug.

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Wed Jan 20, 2021 12:24 pm
by Pi-C
posila wrote:
Mon Jan 18, 2021 3:21 pm
Bio Idustries does this in on_configuration_changed:

Code: Select all

  -- enable researched recipes
  for i, force in pairs(game.forces) do
    for _, tech in pairs(force.technologies) do
      if tech.researched then
        for _, effect in pairs(tech.effects) do
          if effect.type == "unlock-recipe" then
            force.recipes[effect.recipe].enabled = false
            force.recipes[effect.recipe].enabled = true
          end
        end
      end
    end
  end
Thanks, removed this for the next release. I think it didn't matter for 0.18/1.0, but with newly available recipes being marked in 1.1, I agree this code doesn't do much good. There was some reason why I put this into on_configuration_changed instead of using a migration script (can't recall what exactly), but obviously it has some unexpected side effects.

Just for clarification:
https://lua-api.factorio.com/latest/Migrations.html wrote: Lua migrations allow altering the loaded game state. Typically this is done when recipes or technologies have changed. The game resets recipes/ technologies any time mods, prototypes, or startup settings change, so this does not need to be done in migration scripts.
There's work on a major overhaul of the mod going on, which involves a complete rework of the tech tree (in many cases the unlocks for the existing recipes will be moved to a new tech). What is the preferred way to handle this? Should we just ignore that recipes unlocked with an old version of the mod could still be available although their new unlock tech hasn't been researched yet?

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Wed Jan 20, 2021 12:30 pm
by Klonan
Pi-C wrote:
Wed Jan 20, 2021 12:24 pm
What is the preferred way to handle this? Should we just ignore that recipes unlocked with an old version of the mod could still be available although their new unlock tech hasn't been researched yet?
You can use force.reset_technology_effects()

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Wed Jan 20, 2021 2:33 pm
by Pi-C
Klonan wrote:
Wed Jan 20, 2021 12:30 pm
You can use force.reset_technology_effects()
Thanks, I'll use that! :-)

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Thu Jan 21, 2021 11:42 pm
by kovarex
Pi-C wrote:
Wed Jan 20, 2021 2:33 pm
Klonan wrote:
Wed Jan 20, 2021 12:30 pm
You can use force.reset_technology_effects()
Thanks, I'll use that! :-)
Yea, the main advantage is, that it is basically doing the same, but the internal game code makes sure that the notifications are not created for everything.

Re: [1.1.12] Mod changes or game updates reset new recipe notifications

Posted: Fri Jan 22, 2021 8:53 am
by Pi-C
kovarex wrote:
Thu Jan 21, 2021 11:42 pm
Yea, the main advantage is, that it is basically doing the same, but the internal game code makes sure that the notifications are not created for everything.
Thanks for the info! This really wasn't obvious to me -- wouldn't it be a good idea to add this to the LuaAPI description?