New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply newly added techs before final meter estimation #2600
Apply newly added techs before final meter estimation #2600
Conversation
Somebody broke the build - or we moved to c++14 without me noticing. Condition.cpp:9550:23: Fehler: Verwendung von »auto« in Lambda-Parameterdeklaration ist nur mit »-std=c++14« oder »-std=gnu++14« verfügbar |
1aabcdb
to
df4f70a
Compare
Reset to the weekly-test-build and cherry-picked the commit in order to evade the c++14 issue. Builds and test fine now |
Was me. Should be able to change the return od the lambda to |
Move ApplyNewTechs call Before Final Meter Estimate Update in PostCombatProcessTurns We move it also before the following calls UpdateEmpireSupply(true); m_universe.UpdateEmpireLatestKnownObjectsAndVisibilityTurns(); m_universe.UpdateStatRecords(); for (auto& entry : empires) entry.second->UpdateOwnedObjectCounters(); GetSpeciesManager().UpdatePopulationCounter(); This should be supply update is meter based - OK (meter backpropagation already happened) visibility is based on stealth and detection meters - OK stat records - probably OK; FOCS statistics are evaluated here those should not change game state. Number of technologies would include newly added techs (which is ok) update object counters - should be OK, tech does not directly add/remove/change objects population counters - should be OK, tech does not directly add/remove population
df4f70a
to
8254802
Compare
Is there any reason not to merge this? |
Probably more testing reports would be good |
I have the impression people only test code if it is in the test builds. |
Or is there a please-test-everybody tag on our github? |
If we can't get any test feedback by asking, then this can be merged to force this issue, though I'd prefer pre-merge testing. |
No feedback for a week. I guess we had some implicit testing because we put the code closer to the state before moving the application so far down the code (in order to be after turn increase). |
I've tested the effect on population techs. Everything seems right, unless we should be getting the first population increase in the turn right after the tech sitrep (turn 8). This probably can be merged. |
For the sake of making progress with the release, I'm going to merge this. |
Move ApplyNewTechs call Before Final Meter Estimate Update in PostCombatProcessTurns in order to do correct predictions for next turn values on server side.
Forum discussion
Test target meter estimation and it looks good for empire and planetary output.
When i play humans i have 9 RP for all, i research first Algorithmic Elegance and get the "tech researched" message on turn 4. Planetary values are: currently 9RP, target 11RP and next turn 10RP. Empire values are 10RP used/output and 11RP target. Then the values grow as expected each turn until 11RP.
By moving it up we also move it before the following calls
UpdateEmpireSupply(true);
m_universe.UpdateEmpireLatestKnownObjectsAndVisibilityTurns();
m_universe.UpdateStatRecords();
for (auto& entry : empires)
entry.second->UpdateOwnedObjectCounters();
GetSpeciesManager().UpdatePopulationCounter();
Reasoning that there are no unintended side-effects by this move:
supply update is meter based - OK (meter backpropagation already happened)
visibility is based on stealth and detection meters - OK
stat records - probably OK; FOCS statistics are evaluated here those should not change game state. Number of technologies would include newly added techs (which is ok)
update object counters - should be OK, tech does not directly add/remove/change objects
population counters - should be OK, tech does not directly add/remove population