Dear Meridian,
it was not my intention to offend you in any way. I just wanted to know why this behaviour can occur and why.
So thanks for the test case.
So, assuming your code is identical to what's in Hardmode v0.99.2d, I did a test with latest nightly (commit c05326a).
It is the same, this part of the research rules has not been changed since v0.84 or so.
Steps:
1. New game
2. Save game
3. Edit saved game:
- removed alienMissions
- increased funds 10x
- added discoveries: mind shield, alien containment
- added 2 labs, 3 mind shields, 3 living quarters, 2 alien containments
- added 140 scientists
- added 6 floater engineers and 6 floater navigators
- added discoveries: almost all topics from floater engineer/navigator GetOneFree lists... except 2 from each... to save some testing time
- added discoveries: all 3 pre-requisites for UFO construction
Save is attached in this post... feel free to test yourself.
Note:
Let's assume your STR_NEW_FIGHTER_TRANSPORTER_UNLOCK_1 and STR_NEW_FIGHTER_TRANSPORTER_UNLOCK_2 topics only work with floaters engineers/navigators and not other races... for sake of simplicity. It doesn't change anything.
Indeed for showing the and testing it doesn't make a difference.
I would even assume that the code would behave the same way, if you would use all aliens Engineers/Navigators (in this case).
When you research all the Engineers and navigators before you met the requires you would also be stuck.
4. Load edited save
5. Research:
UFO construction -> Floater engineer -> Floater navigator -> New Fighter Transporter unlocked!
6. Reload again
7. Research:
- 2x Floater engineer -> cannot research more even though there are still 4 in prison
- 2x Floater navigator -> cannot research more even though there are still 4 in prison
- research UFO construction -> New Fighter Transporter in not unlocked (which is OK)...
...BUT you cannot research floater engineers or navigators anymore... thus you will never be able to unlock it... you're stuck!
Q.E.D.
Indeed you are stuck. I have had reports about this a while back but was not really identify the cause of the issue.
My assumption judging from the behaviour:
- Game only checks if the topic has getonefree, to make it available for make it appear again on the researchlist
- Game ignores unsatiesfied "unlocks", which only can happen if "require" is set
Or
-Game checks both and the check gets screwed up (logic error).
How could the research work:
1.)Get list with all available research topics from ruleset.(Mod->research)
2.)Get list of all discovered research topics from ruleset. (SaveGame->discovered)
3.)Check if "requires" list of available research topic has been satiesfied (compare with discovered), if true check for "depends" (no "requires"->check for "depends")
4.)Check if "depends" list of available research topic has been satiesfied (compare with discovered), if true display on Research List. (or no "depends"->display")
5.)Check if "getOneFree list of available research topic has been satiesfied (compare with discovered), if false display.
6.)Check if "unlocks" list of available research topic has been satiesfied (compare with discovered), if false display.
Question is were does our code screw up?
Thats just the logic.