Simutrans Tools

## [Bug] Calculation of "max. comfortable journey time" when comfort is 240 or more

Started by [C] Ranran, June 24, 2022, 12:28:51 PM

0 Members and 1 Guest are viewing this topic.

#### [C] Ranran

I am currently working on updating the depot dialog for ver 15.
At that time, as the title suggests, I noticed that the calculation of "max. comfortable journey time" when comfort is 240 or more is broken.

I created a chart that plots the correlation between "max. comfortable journey time" and comfort in the goods list to organize the information for the depot dialog.
It just displays the value of max_tolerable_journey(comfort), and the numbers in this chart match what is displayed in the current depot dialog.

As this chart shows, "max. Comfortable journey time" shows outliers in more than 240 comfort.

` // There is no tolerable journey below tolerable_comfort_short... max_tolerable_journey.insert(tolerable_comfort_short - 1, 0); max_tolerable_journey.insert(tolerable_comfort_short, tolerable_comfort_short_minutes * 60); max_tolerable_journey.insert(tolerable_comfort_median_short, tolerable_comfort_median_short_minutes * 60); max_tolerable_journey.insert(tolerable_comfort_median_median, tolerable_comfort_median_median_minutes * 60); max_tolerable_journey.insert(tolerable_comfort_median_long, tolerable_comfort_median_long_minutes * 60); max_tolerable_journey.insert(tolerable_comfort_long - 1, tolerable_comfort_long_minutes * 60);`
The "max. comfortable journey time" uses a different formula for the comfort range.
It would be appreciated if you could confirm that the last formula is correct.

The chart in the image above can be tested with pull request #555. This pull request will be explained in another thread.

#### Octavius

It makes sense that there's a discontinuity in the max. comfortable journey time when the comfort level allows sleeping on board.

#### [C] Ranran

Quote from: Octavius on June 26, 2022, 11:39:15 AMIt makes sense that there's a discontinuity in the max. comfortable journey time when the comfort level allows sleeping on board.
I don't think your point explains why comfort *240-255 are all the same value.
(If you edited the simuconf.tab, you can see that this starts at 240 with the same value.)
It also doesn't seem to be at least specific to pak.britain.

Is 109:13:24 the upper limit? In any case, it is very strange that if it increases by 1, it will increase sharply.

#### jamespetts

Thank you for the report. It looks as though there may be a problem with this - it is correct that they should not all be the same value above 240.

I am currently contemplating making a number of modifications to comfort in 15.x, including allowing specifying the maximum comfortable journey time directly in .dat files (albeit retaining the old conversions for legacy compatibility), so it may be better to defer looking into this in detail until I come to that work.