The International Simutrans Forum

 

Author Topic: Monthly maintenance of vehicles is not shown in graphs  (Read 1257 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2700
    • My addons, mostly roadsigns
  • Languages: EN, CS
Monthly maintenance of vehicles is not shown in graphs
« on: June 25, 2019, 08:39:57 PM »
The convoy and line graphs do not show monthly maintenence (only running costs per km), and also do not subtract maintenance from profit. Thus wrongly show some lines with obsolete vehicles as profitable, when they are not.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #1 on: August 10, 2019, 10:37:03 AM »
Thank you for your report.

There is currently no separate per convoy graph for monthly maintenance, and it would require some work to add such a graph, as some re-arrangement of the convoy GUI would be required, and likewise for the line.

However, it is an error that this is not shown in the profit figures. I wonder what would be more useful, however: deducting the monthly maintenance from the profit at the beginning of each month, so that each month starts with a negative profit and the revenue might allow this to increase, or deducting the monthly maintenance from the profit at the end of the month, such that a vehicle might appear to be making a profit in the current month but will transpire to be making a lower profit or even a loss by the end of the month?

I should note that, if the former is preferable, this will involve changing the way that this is done more generally, as it is currently recorded at the end of the month for the player's general financial statistics.

I should be grateful for the views of many people on this question if possible.

Offline Ranran jp

  • *
  • Posts: 483
  • Languages: ja
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #2 on: August 10, 2019, 12:18:00 PM »
Quote
There is currently no separate per convoy graph for monthly maintenance, and it would require some work to add such a graph, as some re-arrangement of the convoy GUI would be required, and likewise for the line.
Related to what I suggested in this thread, when convoy's recombination system is implemented, there may be many cases where Convoy has not maintained a consistent formation for a long time. When that happens, I think Convoy unit statistics may no longer make sense.

Can statistics be aggregated into a line?
What will happen to a lineless convoy in that case...?

I think that convoy only needs to own this month's data. If recombined, the current data is passed to the line data and the convoy data is cleared. I think charts are no longer needed.
At the end of the month, line statistics will pick up the convoy statistics.
Of course, there are many convoys that do not change its formation. But with recombination there are a lot of examples that are no longer meaningful, so it might be confusing.

I think that it is also good to have a vehicle maintenance chart in the line manager.
As the number of obsolete vehicles increases, maintenance costs increase and players will notice anomalies.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #3 on: August 10, 2019, 02:34:32 PM »
Thank you for your thoughts. This is something that will need to be considered in the long term as a consequence of convoy re-combination. We still do need to consider what to do in the meantime with these graphs.

In more general terms, we need to think about when to deduct fixed maintenance costs from profit: at the beginning or at the end of a month. I am provisionally in favour of doing it at the beginning of a month, so that players can check whether the convoy is earning its keep and so that there are not unexplained and apparently retrospective changes to profitability at the end of a month, but I should appreciate further feedback on this issue before implementing this scheme.

Offline Ranran jp

  • *
  • Posts: 483
  • Languages: ja
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #4 on: August 10, 2019, 04:13:16 PM »
Quote
The convoy and line graphs do not show monthly maintenence (only running costs per km), and also do not subtract maintenance from profit. Thus wrongly show some lines with obsolete vehicles as profitable, when they are not.
Quote
However, it is an error that this is not shown in the profit figures.
There seem to be some bugs here.



The monthly maintenance fee for this convoy is 170.20¢.
This convoy is in the depot, but it seems to have a running cost of 85¢ at the beginning of the month.
However, the display is wrong, according to the finance dialog, it costs a "vehicle maintenance cost" of 170¢ every month.
The total value of convoy's Profit is also wrong. (Incorrect values are summed up.)
Also different between 85.10 and 85.00.


I ran this convoy just before the month changed.

When convoy goes out of the depot, it appears that no maintenance const at the beginning of the month has been collected.
However, it seems that only the chart is broken.



According to the finance dialog, it is correctly collected at the beginning of the month as "vehicle maintenance cost".

Offline Ranran jp

  • *
  • Posts: 483
  • Languages: ja
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #5 on: August 11, 2019, 04:33:09 AM »
I think I have identified the causes.
It was overwritten with 0 because initialization was performed after adding fixed_cost at the beginning of the month.

The second issue was that the monthly cost was halved because the monthly amount was not adjusted.

I suppose I have fixed it.
https://github.com/Ranran-the-JuicyPork/simutrans-extended/commits/fix-convoy-fixed-cost-record
Please check this just in case. (´・ω・`)

I'm not sure about the issue where decimal places are not reflected in the graph.

EDIT: I have fixed the second issue.
EDIT2:
player_t::book_vehicle_maintenance () will adjust the month value in its function, but convoi_t::book () needed to pass the adjusted month value.
« Last Edit: August 11, 2019, 06:40:09 AM by Ranran »

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2700
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #6 on: August 11, 2019, 12:11:10 PM »
To cope with recombination, (and staff layover, time in depot), the maintenance costs would have to be calculated and recorded for each vehicle / convoy / line at the moment when any such change happens.

Offline Ranran jp

  • *
  • Posts: 483
  • Languages: ja
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #7 on: August 11, 2019, 03:48:19 PM »
Convoy is a collection of vehicles after all.
In other words, the convoy data is the sum of the vehicles that make up the convoy.
But is it enough to record a lot of data for each vehicle?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Monthly maintenance of vehicles is not shown in graphs
« Reply #8 on: August 12, 2019, 09:10:32 PM »
Thank you very much: now incorporated.