Skip to content
Connected RailsConnected Rails

The display (HUD)

The HUD says what a driver could read off the desk without leaning forward, plus the two things no desk shows: what the run is supposed to do, and what the line ahead is about to ask for.

Everything on it is either hardware or overlay, and the two never look alike. Hardware is the instrument panel at the bottom and the lamp housing beside it: a lighter surface with a lit top edge and a shadow under it, round instruments with needles that turn. Overlay is the run and the systems at the top: type on the world under one wash across the width of the screen, with no frame at all.

Zone What stands there
Bottom centre The desk — the speedometer with the line’s permitted speed marked on its rim and the supervised speed over it, the Doppelmanometer carrying brake pipe (pale needle) and main reservoir (red needle) as in the cab, the brake cylinder on its own gauge, and beside them the levers: power controller, brake valve, effort, reverser, AFB, distance run
Bottom left Train protection — the round lamps of a German desk, 1000 Hz, 500 Hz, Befehl, the train category and Sifa, with the LZB row under them and the MFA’s v-soll, v-target and target distance while the LZB is guiding. Glass and legend light together in the lamp’s own colour
Bottom right Look-ahead — signed the way the line signs it: the triangle of an Lf 7 board with the speed on it, or the disc of Hp 0, and how far off it is
Top left The run — clock, punctuality, service, and the timetable as a route ribbon: the stops in order down a rail, the wedge marking where the train stands with the distance to the next stop beside it, the next stop the only line set large. The score sits under a rule at the foot. Under it, the next working on offer once the player’s has ended (F10 takes it), and the tasks a scenario script has set — open ones first, finished ones ticked or crossed for a few seconds (docs/scripting.md)
Top right Systems — ten annunciators of the desk (battery, pantograph, main switch, compressor, spring brake, sanding, doors, lights, wheel slip, hot motors) and three rows the drive labels itself: wire and motor current on an electric, engine and fill on a diesel, boiler, water glass and fire on a steam locomotive
Top centre Scenario messages, and over the desk the banner that says the train protection has taken over

The timetable is a route ribbon, not a list of fields. A “next stop / platform / departure” block says where the train goes next; a ribbon says where it is. The rail carries the stops in order — the one behind dimmed, the next one large, the two after it between the two — and the wedge sits between the stop behind and the stop ahead with the remaining distance beside it. The rows have fixed roles, so their weight is built once rather than switched every frame.

Punctuality is worked out, not printed. The delay a train left the last stop with is carried, and on top of that it is late by however long the scheduled arrival at the next stop has been and gone. A train that has not reached a stop yet is never early: without that rule every run would open by announcing itself seven minutes ahead of a stop it has not moved towards.

The graphics are drawn, not fetched (crates/app/src/glyphs.rs): dial faces, needles, rim markers, the Lf 7 board, the Hp 0 disc and the ten pictograms are a few lines of geometry each, rasterised by a small signed-distance rasteriser when the run starts. There is no asset directory, no icon set, and no third-party licence to carry — and a pantograph that should read better at 20 px is a coordinate in that file rather than a new download. The speedometer’s scale comes from the vehicle’s maximum speed and is drawn once, so the figures on the face stay put while the line’s limit changes.

Nothing that does not apply is drawn: the AFB row exists on a vehicle fitted with one, the LZB lamps where an LZB is, the look-ahead when something is actually coming. F5 opens the keyboard as a sheet — with a legend of what the ten annunciators mean — and F6 the diagnostics: frame time and entity count, terrain, air detail, axles, temperatures, signals and the network, which is where everything a driver has no use for lives.

Finding what costs frame budget. The top of the F6 block is a frame profiler: average, p95 and maximum frame time over the last 300 frames with a hitch count, a per-system CPU breakdown (sim, ai, stream, hud, audio, … plus how many fixed sim steps the last frame ran), an ASCII history graph and the worst spikes with what they were made of. Whatever the named spans leave over shows as rest — render, present and vsync — so a high rest next to high triangle/entity counts points at the GPU and a high named span at the CPU side. The F8 console’s prof prints the same table, prof reset clears it, prof pause/resume freezes it, and prof csv <file> writes the history for analysis outside the simulator. Leaving a run for the menu or quitting to the desktop logs the same summary automatically, so every run ends up measurable in the log without photographing the overlay. A --frames N run logs the summary and the worst spikes on exit, which is the scriptable form of the overlay. For deeper dives (per render pass, GPU timings) run with Bevy’s Tracy feature and connect the Tracy viewer — the in-game profiler stays for the quick question of which system lags.

F7 walks three steps — full, reduced, off — and rounds back. The reduced step keeps what the train is driven by (the desk and the protection lamps) and everything that interrupts (the banner, scenario messages), and drops what it is planned by: the run, the systems and the look-ahead. It is the step for driving by the cab’s own instruments without giving up the train protection; off is the one for a photograph. The step is a setting like any other ([gameplay] hud — Full, Reduced, Off), so it survives the run, and --hud <step> sets it for a screenshot without writing the settings file.