NoResearch species get no RPs from fixed bonus

Describe your experience with the latest version of FreeOrion to help us improve it.
Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
Oberlus
Small Juggernaut
Posts: 703
Joined: Mon Apr 10, 2017 4:25 pm

NoResearch species get no RPs from fixed bonus

#1 Post by Oberlus » Tue Jun 26, 2018 10:47 pm

Phinnert has "no research" trait, so no research focus and thus no pop-based RPs. But I didn't know that they can't get neither the fixed bonuses from the eccentric orbit special or the Nascent AI tech. Is this intended? I don't like it.
In the image you can see the research meters of a Phinnert colony with eccentric orbit and nascent AI after several turns (current meter won't go past 0).
Playing v0.4.8 [build 2018-06-24.4983374], that is branch release-0.4.8 pulled around 20:00 GMT.
Attachments
NoResearch.png
NoResearch.png (18.01 KiB) Viewed 154 times

User avatar
Dilvish
AI Lead, Programmer
Posts: 4711
Joined: Sat Sep 22, 2012 6:25 pm

Re: NoResearch species get no RPs from fixed bonus

#2 Post by Dilvish » Wed Jun 27, 2018 6:34 am

Oberlus wrote:Is this intended?
I don't think so; I am pretty sure it is an accidental glitch from the move of meter regen into Effects. The basic Research and Industry meter regen is currently part of BASIC_RESEARCH and BASIC_INDUSTRY, and so gets left out of NO_RESEARCH and NO_INDUSTRY.
I don't like it.
I agree. I find myself rather surprised I had not noticed this before. Certainly a tech like Nascent AI tech is pretty explicitly supposed to be independent of the racial research abilities: "Each planet can contain such structures regardless of the population's occupations, giving a bonus to research on all worlds." And regardless of whether other possible fixed sources would necessarily be to explicitly applicable, if the effect sets the target meter as shown in the screenshot, then the target meter should be allowed to grow. (The lone currently expected exception to that is for planets with a 0 target population, and even the current implementation of that seems a bit buggy to me since if it is going to hold the primary meter to zero it should also hold the target meter to zero, plus the comment description is "// removes residual production from a dead planet" whereas the implementation applies to any dying planet. But that would be a different Issue than the one of your post.)

I think the most expeditious fix is simply to extract the respective meter regen clauses out of the BASIC_X macros, into a separate X_REGEN macro which could then be referenced by both the BASIC_X macro and the NO_X macro. Or probably better yet, just move all the regen clauses into a single METER_REGEN macro which could then be incorporated into BASIC_POPULATION.

Could you please open an Issue on this, and quote the above paragraph re suggested approach for fix?

(And feel free to open one about the dead vs dying planet issue, and about the related problem of zeroing the primary meter without zeroing the target meter too, if those make sense to you.)
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Post Reply