News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Graph labels for "Seat-km" and "Passanger km" both show as "pass. km." on graph

Started by kylofon, April 30, 2026, 08:27:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kylofon

Where: Line management and Convoy screen, in the "Graph" subtab

What: When choosing to display the graph lines for "Seat-km", the line is labeled as "pass. km."

Expected: When choosing to display the graph lines for "Seat-km", the line is labeled as "seat. km."

Solution: I'm told this is related to the localization, which is missing the "Seat-km" string for all languages except JP.

Matthew

Thank you for the bug report, kylofon, and welcome to the International Simutrans Forum!

This bug report is transferred from this GitHub Issue.

I've had a chance to properly look into this.

Firstly, I double-checked whether "seat-km" is actually the right term in English. Seat-km isn't a concept often used in discussions of railways. But it's very common in the analysis of commercial aviation, usually as "Available seat-km" e.g. this CAA report. The relevant Wikipedia article is actually on Available seat-miles. Looking through lots of relevant tables and pages in Terry Gourvish's British Railways 1948-73, I only found one example (p.109, "Total costs per seat-mile"), but one is enough to prove it's that seat-mile/seat-km is not just an aviation term and we are right to use it.

Secondly, I looked the code more closely. The localization key "Seat-km" is actually only used for the button label. This bug report is about the tooltip label, which is set at "pkm" in gui_chart.cc:

        case PAX_KM:  new_curve.suffix = translator::translate("pkm");  break;
PAX_KM is declared within enum gui_chart_t::chart_suffix_t. Unfortunately for us, it's not only used for the label of these charts, but also for calculating the correct unit of these graphs, and the equivalent Player Ranking graph. So creating a new SEAT_KM identifier wouldn't be a 5-minute job unless you are already familiar with the graphing code, and right now I don't think we have any contributors who are.

And there's an additional complication. The text key is "pkm". What does the "p" stand for? Only two languages have localizations. The English localization interprets it as "pass[enger] km" but the Japanese localization uses "人km", which  means "person/people km". That's much closer to "passengers", but perhaps it has just enough ambiguity to cover people who could travel (= seats) as well as passengers who do travel.

In my view "pass. km" is close enough and fixing it would take more time than it's worth, which is why the code was sensibly written this way, and so it's a WONTFIX.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

kylofon

Hey Matthew, thank you for the, frankly scarily in-depth ;) extensive review of the issue!

I took a stab at it and have it tested and working. I've added a SEAT-KM case to gui_chart.cc so that seat-km curves get translated to the "skm" suffix and SEAT_KM to the chart_suffix_t enum in gui_chart.h.

Next, in convoi_info_t.cc switch first entry of cost_type_money from PAX_KM to SEAT_KM so the seat-km series in the convoy info window stops sharing the pax-km label. Repeat for schedule_list.cc in static_type so new suffix is used.

FInally, add English localization Seat-km and skm -> seat km and japanese 座席km for "seat km".



https://github.com/jamespetts/simutrans-extended/compare/master...kylofon:simutrans-extended:fix-seat-km-labels

I haven't seen any impact on the Finances and Rankings screens, because they don't have the seat-km graph and pass-km is unaffected.

There is a philosophical discussion here that I think already took place in the past. Currently, Seat-km calculates for all seats, both vacant and occupied via get_cargo_max(). This was not always the case, as there is an outdated comment on simconvoi.h at 74  - "the distance (km) travelled by vacant seats" and a left-over savegame migrator in simconvoi.cc at 4420 that adds CONVOI_PAX_DISTANCE to CONVOI_CAPACITY when loading saves between versions 14.57 and 14.63 so that from 14.64 onward it's all seats, not only empty ones.

I don't know what the original thinking was, but the potential issue is if we calculate for all seats on a vehicle, the value quickly baloons, especially for ships, and it significantly outgrows the "Distance" and "passanger km" graphs. I also think vacant seats is a better metric...