[Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

This subforum contains all the issues which we already resolved.
Loup&Snoop
Inserter
Inserter
Posts: 30
Joined: Wed Dec 04, 2024 4:33 am
Contact:

[Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

Post by Loup&Snoop »

TL;DR
steel-processing is researched = true, enabled=false, visible_when_disabled = false. However, 1) steel-processing is still visible, and 2) military-2 still can't be researched, demanding the already researched steel-processing
steel-processing is researched = true, enabled=false, visible_when_disabled = false. However, 1) steel-processing is still visible, and 2) military-2 still can't be researched, demanding the already researched steel-processing
05-17-2025, 13-51-33.png (131.27 KiB) Viewed 972 times
(see attachment comment)

Full Bug Report
Background: API docs for LuaTechnology say:
  • LuaTechnology.enabled: Can this technology be researched?
  • LuaTechnology.visible_when_disabled: = If this technology will be visible in the research GUI even though it is disabled.
What did you do?/What happened? I made a hidden placeholder technology prototype, set its LuaTechnology to visible_when_disabled = false, enabled = false. If it is not researched, it is hidden, but blocks any children from being researched. If researched, it is forced visible (even if disabled). Just follow along:

Make a totally fresh freeplay save, and focus on military-2. Use this console command:
/c game.forces["player"].technologies["logistic-science-pack"].research_recursive();
game.forces["player"].technologies["military"].researched = true;
steel-processing is the last prerequisite needed for military-2. Normal gamestate
steel-processing is the last prerequisite needed for military-2. Normal gamestate
05-17-2025, 13-14-40.png (122.81 KiB) Viewed 988 times
This gets us to a normal tech tree game-state where military-2 would be researchable except for steel-processing not being researched. Use this console command:
/c game.forces["player"].technologies["steel-processing"].visible_when_disabled = false;
game.forces["player"].technologies["steel-processing"].enabled = false;
steel-processing is disabled, and visible_when_disabled false. Still needed for military-2
steel-processing is disabled, and visible_when_disabled false. Still needed for military-2
05-17-2025, 12-53-55.png (113.17 KiB) Viewed 1000 times
Now steel-processing a hidden, unresearched, disabled prerequisite of military-2, which properly hides steel-processing. However, military-2 cannot be researched, as steel-processing is still a prereq. Put in this console command:
/c game.forces["player"].technologies["steel-processing"].researched = true;
steel-processing is researched, and was forced enabled
steel-processing is researched, and was forced enabled
05-17-2025, 12-57-51.png (157.74 KiB) Viewed 1000 times
Now steel-processing is researched, so military-2 can be researched. However, steel-processing has been forced to be enabled.
/c game.forces["player"].technologies["steel-processing"].enabled = false
steel-processing is researched = true, enabled=false, visible_when_disabled = false. However, 1) steel-processing is still visible, and 2) military-2 still can't be researched, demanding the already researched steel-processing
steel-processing is researched = true, enabled=false, visible_when_disabled = false. However, 1) steel-processing is still visible, and 2) military-2 still can't be researched, demanding the already researched steel-processing
05-17-2025, 13-51-33.png (131.27 KiB) Viewed 972 times
Now steel-processing is researched, disabled, visible_when_disabled false, but still visible in the tech tree. Furthermore, steel-processing is researched, but still blocking military-2 as a prerequisite.

What did you expect to happen instead?
  1. I expect the last picture to have steel-processing hidden from the tech tree, because it is a disabled technology that is visible_when_disabled = false. Specifically, I expect visible_when_disabled to always take priority over any other logic that affects visibility.
  2. I expect a researched and disabled technology to satisfy prerequisite requirements (ie military-2 to be researchable when steel-processing is disabled and researched). Specifically, I expect LuaTechnology.enabled to have no bearing on a tech satisfying prerequisite requirements (which should only depend on LuaTechnology.researched.
Does it happen always, once, or sometimes? Always.

Why fix? I am trying to make a system to hide technologies in the middle of a tech tree that have dependents. Fixing this will allow me to implement a system of hiding techs (by hiding/revealing placeholder tech prototypes) that still show the shape of the tech tree.

Let me know if this should be a modding interface request, but it seems like a bug because the properties don’t seem to do what they are supposed to.



EDIT: I saw .researched = true automatically set enabled=true, which revealed more problems than it fixed.
EDIT2: Added tl;dr
Genhis
Factorio Staff
Factorio Staff
Posts: 844
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: [Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

Post by Genhis »

Thanks for the report, your expectations seem reasonable. Let's expand the scope a bit while we are looking at visible_when_disabled property and consider the following base game scenarios:

1. Automation technology is selected, Automation 2 is disabled and not visible.
2. Automation technology is selected, Automation science pack is disabled and not visible.

Researched status doesn't matter. Are you satisfied with the current behavior? If not, what connections should the technology tree show and why?
Loup&Snoop
Inserter
Inserter
Posts: 30
Joined: Wed Dec 04, 2024 4:33 am
Contact:

Re: [Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

Post by Loup&Snoop »

Thank you so much for both addressing and building on my bug report!
Genhis wrote: Tue May 20, 2025 8:02 am 1. Automation technology is selected, Automation 2 is disabled and not visible.
2. Automation technology is selected, Automation science pack is disabled and not visible.

Researched status doesn't matter. Are you satisfied with the current behavior?
To answer your question, I need to clarify side effects. I assume visible_when_disabled is false in both scenarios.

Scenario 2: automation must be researchable in a state where automation-science-pack is hidden. Also, automation-science-pack is craftable if and only if automation-science-pack is researched (even if hidden). As many techs have automation-science-pack as the only prerequisite, the tech tree is now severed as steam-power looks like a dead end if it is selected, and automation/fast-inserter each look like the start of a tech tree when either one is selected. It is now the modder’s responsibility to put something to reconnect the tech tree—not the game’s responsibility to divine my intent.

Scenario 1: I expect the tech tree to behave as though the TechnologyPrototype of automation-2 was never defined (nor added as a prereq). Result: The tech tree still shows 1) concrete depending on advanced-materials-processing, 2) no connection between automation and concrete, 3) concrete is researchable as long as advanced-materials-processing is complete, and 4) assembling-machine-2 is still craftable if and only if automation-2 is researched. If this is what you mean, then all is good.

If you meant to deprecate visible_when_disabled, then my only concern is the theoretical fear of messing with other people's mods. It is safe to say that anyone actively setting visible_when_disabled = false definitely intends to hide the tech.

Sorry for block of text. It was hard for me to tell what you meant from your post.
-------
It may help if I showed you what I’m working on, as it might give you a better idea with pictures. If you feel you already understand, then just go right ahead.
What I want my tech tree to look like at the start.
What I want my tech tree to look like at the start.
05-20-2025, 07-44-17.png (796.85 KiB) Viewed 758 times
What I want my tech tree to look like when partway researched
What I want my tech tree to look like when partway researched
05-20-2025, 07-47-32.png (643.82 KiB) Viewed 758 times
What I want my tech tree to look like when fully revealed
What I want my tech tree to look like when fully revealed
05-20-2025, 07-48-25.png (795.38 KiB) Viewed 758 times
-----
How it works:
How it works when no techs hidden
How it works when no techs hidden
05-20-2025, 07-56-37.png (110.91 KiB) Viewed 758 times
Each hidden tech has an equivalent "unknown technology" placeholder slotted into the tree like this, and I toggle visibility/enabled for each technology to create the illusion.

------
That is the dream. It looks good now, but it is not actually functional (hence the bug report). Let me know if there is still any confusion.
Genhis
Factorio Staff
Factorio Staff
Posts: 844
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: [Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

Post by Genhis »

Sorry for the confusion, I was only concerned with how the graph should look like when a technology with disabled parents/children is selected. That is, if parts of the tech tree should be hidden or connections rerouted to skip disabled technologies. If I understood your response correctly, it doesn't require any further changes.

In any case, your issue is fixed for 2.0.52.
Loup&Snoop
Inserter
Inserter
Posts: 30
Joined: Wed Dec 04, 2024 4:33 am
Contact:

Re: [Genhis][2.0.47] Researched technology visible even when visible_when_disabled = false

Post by Loup&Snoop »

Thanks, Genhis! I appreciate the work you do.

FYI I have reached out to a few mod creators who have hidden techs in their mods. They should be prepared/preparing for this change.
Post Reply

Return to “Resolved Problems and Bugs”