Wrong Target Output estimation on the turn of a research

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

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
Cosmic Dragon
Posts: 5760
Joined: Mon Apr 10, 2017 4:25 pm

Wrong Target Output estimation on the turn of a research

#1 Post by Oberlus »

Playing latest version 2019-10-13.

I'm getting wrong estimations of Target Output for PPs/RPs on the turns that a PP/RP boost is researched. I spotted it a while ago on my current long game but I was lazy and failed to document it. Now I'm late game and won't run into the situation again, but I want to open this for the record.

The scenario is as follows:

Turn X: Current PPs are 100. If you hover your mouse over the lab flask in top bar it says "Used 100, Output 100, Target Output 100".
Turn X+1: Current PPs are 100. You get the sitrep for that tech that gives you +0.2*pop bonus to PPs. The lab flask now says "Used 100, Output 100, Target Output 94". That 94 is wrong.
Turn X+2: The new bonus kicks in. Current PPs are 108, the lab flask says "Used 108, Output 108, Target Output 116".

If I run into this again, I'll get screenshots and save/log files.

Ophiuchus
Programmer
Posts: 3461
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Wrong Target Output estimation on the turn of a research

#2 Post by Ophiuchus »

Oberlus wrote: Fri Oct 18, 2019 11:22 am Playing latest version 2019-10-13.

I'm getting wrong estimations of Target Output for PPs/RPs on the turns that a PP/RP boost is researched. I spotted it a while ago on my current long game but I was lazy and failed to document it. Now I'm late game and won't run into the situation again, but I want to open this for the record.

The scenario is as follows:

Turn X: Current PPs are 100. If you hover your mouse over the lab flask in top bar it says "Used 100, Output 100, Target Output 100".
Turn X+1: Current PPs are 100. You get the sitrep for that tech that gives you +0.2*pop bonus to PPs. The lab flask now says "Used 100, Output 100, Target Output 94". That 94 is wrong.
Not sure I quite understand what is happening. You have the "tech researched" message on turn X+1. So current values including target output should not be affected at all by that tech.
Maybe it is factoring estimations in and does it in a wrong way?

If you run into it please also have a look/screenshot of the explanations on an affected planet.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5760
Joined: Mon Apr 10, 2017 4:25 pm

Re: Wrong Target Output estimation on the turn of a research

#3 Post by Oberlus »

I haven't played again, but got time to reload an older save and check things out:


Example 1:

Turn is 54.
Distributed Thought Computing is about to finish.
All colonies are George with industry focus. All meters are at target value. Empire's Research Target Output is 25, as has been in previous rounds.

Turn 55:
I get the sitrep for the new tech. Hovering the mouse over the lab flask we see the incongruity: Empire's Target Output is 25 while Empire's Output is (or "will be at the end of turn, so you can count on those points applying when you press Turn"?) 28.9.
FO_WrongTargetOutputOnTurnTech.png
FO_WrongTargetOutputOnTurnTech.png (31.9 KiB) Viewed 3631 times
However, on the planets themselves you see no predicted change (the gain that DTC is supposed to provide is negated by and "unknown" effect, that IIRC comes from some incoordination/desynchonisation.
FO_WrongTargetOutputOnTurnTech_2.png
FO_WrongTargetOutputOnTurnTech_2.png (345.77 KiB) Viewed 3631 times
Turn 56:
The techs get 28.85 (the expected Empire's Output, 28.9, was right, the Target Output was wrong).
The lab flask now says Target Output 31, Output 30.5. This is coherent with the increases of each colony. For example, Kirkwood from above screenshot is at 13.0 and target 14.5.


In this example we don't see the even weirder case in which Empire's Target Output on the turn of the tech sitrep is smaller than Output (so it's not that it fail to predict the increase, but that it thinks the change is actually to lower Target Output). Loading other files to check...

User avatar
Oberlus
Cosmic Dragon
Posts: 5760
Joined: Mon Apr 10, 2017 4:25 pm

Re: Wrong Target Output estimation on the turn of a research

#4 Post by Oberlus »

PS: Ignore the last paragraph of previous post (at least for now). Got time to check another case (turn 20, about to research Fusion), and something similar to the DTC example happened, but Empire's Industry Target Output on turn 21 was not smaller than on turn 20, that was I recall having seen, just smaller than Empire's Industry Output and incorrect in any case.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Wrong Target Output estimation on the turn of a research

#5 Post by Geoff the Medio »


Ophiuchus
Programmer
Posts: 3461
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Wrong Target Output estimation on the turn of a research

#6 Post by Ophiuchus »

Oberlus wrote: Sun Oct 20, 2019 11:27 am I haven't played again, but got time to reload an older save and check things out:

Example 1:..

Turn 55:
I get the sitrep for the new tech. Hovering the mouse over the lab flask we see the incongruity: Empire's Target Output is 25 while Empire's Output is (or "will be at the end of turn, so you can count on those points applying when you press Turn"?) 28.9.
FO_WrongTargetOutputOnTurnTech.png
However, on the planets themselves you see no predicted change (the gain that DTC is supposed to provide is negated by and "unknown" effect, that IIRC comes from some incoordination/desynchonisation.
FO_WrongTargetOutputOnTurnTech_2.png
The tech effects will apply before research point production is calculated, so target output should go up, then also research output (?), so the 28.9 points should go into research projects.

The inconsistency shown should be a mismatch between client and server. If I understand correctly that means the client calculates (correctly) the higher number. Please somebody correct me if i am wrong.

So my theory is that the server sends wrong target predictions. Need to look where those are calculated.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3461
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Wrong Target Output estimation on the turn of a research

#7 Post by Ophiuchus »

Put up an untested PR #2600
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3461
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Wrong Target Output estimation on the turn of a research

#8 Post by Ophiuchus »

Could please somebody test the PR? I can provide a snapd build if necessary. Or if you want to cherry-pick: 8254802c68acb759fbfef887b6b52f05a48c048d

The PR could affect the following because processing order is changed although in theory these are unrelated to tech application
  • supply network
  • visibility
  • statistic records
  • object counters
  • population counters
So while playing have an eye on issues in the turns you get a tech researched message and if the tech influences one of the items.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply