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

Bugs that are actually features.
Snowfious
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jan 17, 2021 6:15 pm
Contact:

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

Post 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?
Last edited by Snowfious on Sun Jan 17, 2021 7:57 pm, edited 2 times in total.
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

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

Post by invisus »

Sounds similar to 94015
Snowfious
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jan 17, 2021 6:15 pm
Contact:

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

Post 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.
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

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

Post 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.
posila
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post 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
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

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

Post by invisus »

Great, looks like Snowfious already reported this to the mod author(s).
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

Ok, since it is the fault of the mod, I'm moving this to not a bug.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1739
Joined: Sun Oct 14, 2018 8:13 am
Contact:

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

Post 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?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post by Klonan »

Pi-C wrote: Wed Jan 20, 2021 12:24 pmWhat 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()
Pi-C
Smart Inserter
Smart Inserter
Posts: 1739
Joined: Sun Oct 14, 2018 8:13 am
Contact:

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

Post by Pi-C »

Klonan wrote: Wed Jan 20, 2021 12:30 pm You can use force.reset_technology_effects()
Thanks, I'll use that! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1739
Joined: Sun Oct 14, 2018 8:13 am
Contact:

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

Post 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?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Not a bug”