16
Suggestions / Monthly rating / statistics issues
« on: August 14, 2018, 02:27:08 pm »
UPD: this should probably be moved to "Contributions->Programming". Sorry, I was lazy to scroll the forums list down a little.
I have found several issues with how some of the values in the statistics window (displayed at the end of the campaign) are calculated, as well as with the monthly rating calculation code. I would like to provide a breakdown of all issues discovered as well as to propose and discuss solutions to them. Please correct me if some of the assumptions I make here are wrong; since I have only worked with the source code for a short time, it is difficult to maintain a consistent picture of all things in my head.
I'm sorry making for such a long post; I thought it would be better to collect everything in one place because the affected parts of the code are closely related. I've added some spoiler tags to reduce the visible length of the post. I hope the developers can look into it when they have the time. I can also provide pull requests to implement the solutions proposed here. In the end, I hope we all can make OpenXcom better together
The first group of issues is related to MonthlyReportState.cpp, in particular, to MonthlyReportState::calculateChanges.
#1. Questionable piece of code in MonthlyReportState::calculateChanges
Description:
Proposed solution:
#2. Possible oversight in MonthlyReportState::calculateChanges
Description:
Proposed solution:
The next set of issues is related to the statistics window, which shows various statistical information to the player after the game has ended.
#3. Average monthly rating is incorrectly calculated based on research scores only
Description: See issue #1409 on the bug tracker.
Proposed solution: depends on the solution to the following issue #4. See below.
#4. Consequences of the limit on the number of values stored in certain vectors in the save file
Description:
Proposed solution:
#5. Unused values in StatisticsState.cpp
Description: There are at least two values that are calculated but not used when displaying the statistics window. These are, respectively, the number of alien bases destroyed and the number of XCOM bases lost. They are calculated when iterating over the mission statistics vector (Source: StatisticsState.cpp, line 147):
Proposed solution: pull request.
I have found several issues with how some of the values in the statistics window (displayed at the end of the campaign) are calculated, as well as with the monthly rating calculation code. I would like to provide a breakdown of all issues discovered as well as to propose and discuss solutions to them. Please correct me if some of the assumptions I make here are wrong; since I have only worked with the source code for a short time, it is difficult to maintain a consistent picture of all things in my head.
I'm sorry making for such a long post; I thought it would be better to collect everything in one place because the affected parts of the code are closely related. I've added some spoiler tags to reduce the visible length of the post. I hope the developers can look into it when they have the time. I can also provide pull requests to implement the solutions proposed here. In the end, I hope we all can make OpenXcom better together
The first group of issues is related to MonthlyReportState.cpp, in particular, to MonthlyReportState::calculateChanges.
#1. Questionable piece of code in MonthlyReportState::calculateChanges
Description:
Spoiler:
Spoiler:
#2. Possible oversight in MonthlyReportState::calculateChanges
Description:
Spoiler:
Spoiler:
The next set of issues is related to the statistics window, which shows various statistical information to the player after the game has ended.
#3. Average monthly rating is incorrectly calculated based on research scores only
Description: See issue #1409 on the bug tracker.
Proposed solution: depends on the solution to the following issue #4. See below.
#4. Consequences of the limit on the number of values stored in certain vectors in the save file
Description:
Spoiler:
Spoiler:
Description: There are at least two values that are calculated but not used when displaying the statistics window. These are, respectively, the number of alien bases destroyed and the number of XCOM bases lost. They are calculated when iterating over the mission statistics vector (Source: StatisticsState.cpp, line 147):
Code: [Select]
if ((*i)->isAlienBase() && (*i)->success)
{
alienBasesDestroyed++;
}
if ((*i)->isBaseDefense() && !(*i)->success)
{
xcomBasesLost++;
}
Proposed solution: pull request.