How would catering facilities at stops interact with comfort in your model?
In simconvoi.cc, starting around line 4270, the fare is calculated when a convoy arrives --
comfort = line->get_finance_history(1, LINE_COMFORT);
Below there is where the comfort modifier, speed bonus, and catering levels are computed.
As an extension -- Some of those calculations could include an additional variable which is derived from halt.catering.
Here's how I read the code now:
The variable "comfort" comes from the line's history, or if not bound to a line, the convoy's history. Then a comfort modifier of either 20% or 100% is used based on the journey distance. If the comfort is higher than "tolerable" the modified comfort boosts the revenue; if less than tolerable, it cuts the revenue. Curiously, this means passengers always give either a luxury bonus or subtract a discomfort penalty -- there is no "grey area" in which neither is applied.
As an extension -- We could, for example, define a station extension that would add a fixed value to the "comfort" variable before the modifier is used.
For mail, looking at line approximately 4390: If the journey length in minutes is above the "TPO Threshold" then a bonus is added. The bonus looks to be 10%.
As an extension -- If halt.catering > 0, we could add an additional 10% on top of that.
p.s., This suggests a secret of the comfort calculation: It may be highly advantageous to put rakes (
consists for our American viewers) which are out-of-the-ordinary into their own lines, or leave them without lines. If you have a suburban line of ten relatively uncomfortable trains, and you upgrade one of them with high comfort equipment, you spread the comfort bonus across all ten trains; but if that train is in its own line, or has no line, then that train alone gets the entirety of the comfort bonus. Likewise if you have a line with ten relatively comfortable trains, and one rather uncomfortable one, that one train drags down the comfort bonus for all the trains. If everything were equal, the simple averaging wouldn't matter... but through judicious use of wait-until-full and departure schedules, we can get a real boost from this.