18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 06:35:21 +01:00
Files
maszyna/docs/behaviour-changes.md
jerrrrycho 7578f2c3a0 feat(physics): buffer stops at the free ends of the tracks
A free end of a rail track marked bufferstop1 / bufferstop2 <kind> in the
scenery is a buffer stop (physics/bufferstop.h): rigid, buffered, hydraulic
or friction. With physics.collisions new a vehicle running into it meets the
stages of the stop in series: the buffers of both, the absorber or the brake
elements of a sliding stop, then the frame, whose hit goes through
collision::hit() and whose ride-up goes through collision::override_of(),
the stop an immovable body. It is held, the frame deforms, it rides up
(Enfield 2021), demolishes the stop (Kirkby 2021) or overruns a sliding one.
The log tells each hit once, and the memory cells __simulation.bufferstop
and <track>:bufferstop and their events tell the scenery.

physics.bufferstops marked (the default) takes the marked ends only, auto
also the ends with a model of a stop within 3 m, off none. Every other free
end keeps the derailment off the end of the track, and so does every end
with physics.collisions old; monitor logs what the stop would have done.
2026-12-02 12:33:36 +01:00

191 lines
18 KiB
Markdown

# Behaviour changes
Changes accepted in review that players, scenery authors or data makers can notice, for release notes and for
triaging new bug reports ("it worked differently before"). Each entry says what changed, who notices, what
data or eu07.ini it needs, and the pull request (#NNN, MaSzyna-EU07/maszyna). Written against `staging` as of
2026-11-24; the list starts at #266 (merged 2026-11-08). Keys marked "optional" change nothing until the data uses them.
#443 (2026-11-22) reverted #408 and merged `master` into `staging`; of the changes it brought from `master` only the
physics log ones, which replace those of #408, are listed here.
The last section lists the new optional data keys, so that data makers can find them; they change nothing for
existing data.
## Logs and files
- **physicslog has a new last column `VehicleVelocity[km/h]`** (#266). The header line of every physics log
(`physicslog yes`, the black box tapes) changed: `WaterAuxTemp[Deg]` is now followed by a space and the new column,
the vehicle's speed (the second column is the speed of the wheels, which stays 0 while they are locked).
Notices: anyone parsing the logs by column count or by the exact header. The old columns keep their positions.
Needs: nothing.
- **Passing a signal at stop is logged in every session** (#266). The line `<vehicle> passed signal <name> at danger`
goes to the log for AI and player drivers alike, rail vehicles only, for a signal showing `SetVelocity 0 0`
(not an automatic block signal with `SetVelocity 0 x`). Before it was only counted in test runs. Notices: log.txt
of any scenery with trains running red signals. Needs: nothing.
- **The settings dump at the start of log.txt lists the `test.*` keys** (#266): `test.timeout`, `test.standstill`,
`test.pass_on_standstill`, `test.fail_if_stop_overran`, `test.no_movement_before_pass` (and `test.wall_timeout`,
`test.vehicle` when set), also in normal sessions, with their defaults. They are ignored outside the test mode.
- **The physics logs are written every 2 s by a thread of their own** (#385 on `master`, on `staging` with #443).
The files are opened only for the moment of writing; a crash loses the last 2 s. A log whose file can't be written
keeps its lines and is retried (up to 64 MB in all). `physicslog yes` still logs every driver, road vehicles
included. The closing writes out everything left, with no time limit; only the test mode stops waiting after 2 s.
- **Characters illegal in Windows file names are replaced by `_` in log file names, on every system** (#385, with
#443): a spawned vehicle `spawn_ezt:12` logs to `spawn_ezt_12.dat`.
- **`physicslog.trains yes`** (#385, with #443, new): `.dat` logs of the drivers of rail vehicles only (no passengers,
no road vehicles). **`blackbox yes|no`** (#385, with #443, new): the black box on its own; with no entry it goes with
`physicslog` (or `physicslog.trains`) as before.
- **A failed start ends with exit code 1 and the reason in the log** (#425); a closing from the player's side still
ends with 0. The crash dump written by the Windows crash handler is small by default (stacks and data segments,
tens of MB instead of the whole memory); `crashdump.full yes` brings back the full one.
- **The region cache `<scenery>.sbt` is written through a temporary file and checked whole when read** (#351): a
damaged file is turned down ("Bad file: ... ignored") and the scenery loads from the text and writes the cache again.
Format unchanged.
- **Test mode** (#266, `--test`; see `tests/scenarios/README.md`): takes no input from outside, does not read the
player's own eu07.ini, writes only its verdict to the standard output, and has exit codes of its own (kept clear of 1
and 3).
- **A derailment is logged in one line of its own** (derailment event PR): `derailment: <vehicle> derailed (<cause>) on
track <track> at <speed> km/h`, once each time a vehicle leaves the rails, with any `physics.derailment`, next to the
`Bad driving` lines that were there before. The black box writes it too, as a derailment record (0x38) with phase 2,
and every derailment record gets the finer cause and the track name at its end (see `blackbox_doc.md`). Notices: log
checks that count lines with "derailed"; readers of the black box that took every 0x38 record for one off the track.
The settings dump at the start of log.txt has `test.fail_on_derailment` (default `no`); with `yes` a derailment of
a tested train ends a test run with the new exit code 15. Needs: nothing.
## AI
- **AI on a diesel with a shunting gear drives in the shunting mode** (#275). For a `DieselEngine` with
`ShuntModeAllow` (the SM03's 2Ls150 gear) the AI sets the shunting mode when its order is Shunt/Loose_shunt or the
consist is over 224 t. Before, `CurrentSwitch()` took the call for the motor overload relay threshold and the mode
was never set, so the AI always ran in the running mode. Notices: trains of SM03 on a shunting order or over 224 t
get another speed/power curve, so running times in timetables can change. The same PR makes the first move of the
SM42/SP42 switch set the shunt mode at once. Needs: nothing.
- **A Connect first order releases the hand brake** (#339).
- **The AI's wagon inspector sets G/P/R by Cw-1 par. 18-19 and cuts out the brake of wagons without G in a G train**
(#282 and its review commits). A cut-out skipped on the run is done once the train stands. `ai.brakesetting.cw1 no`
in eu07.ini restores the earlier behaviour (default yes). Notices: another brake setting of formed freight and
passenger trains, brakes cut out on some wagons. Needs: nothing.
- **Braking for a stop**: making for a passenger stop leaves room for the brake's fill time only, no look-ahead floor
(#297); the passenger-stop flag no longer flips on every scan (#295); the W4 stop point is shifted by the margin the
stop is judged by (#321); the shunting AI brakes for a stop point again (#409); gradients of 2.5 per mille and more
count as up gradients for the hold and the start (#265). Notices: stops at platforms and signals look different,
running times can move a little.
- **A reduced signal speed ends at a marked end of the interlocking area** (#305): only where the scenery puts the
`SignalAreaEnd` putvalues event. Without it the old rule holds.
- **No multiple-unit control between electric and diesel traction vehicles** (#279): `Attach()` leaves the control
connection out, also for the scenery and the AI (a Vectron and an SM42 no longer run in multiple); logged.
`controlcoupling.enginecheck no` in eu07.ini brings the old behaviour back (default yes).
## Cab controls
- **A lone two-state `main_sw` with a latch needs two presses to switch on after a trip** (#277). The single toggle
lever of the line breaker (no `main_on_bt`/`main_off_bt` in the cab) stays where it was put; after the breaker was
knocked out (the converter overload relay of the EP05) the first press puts the lever off, the second closes the
breaker. Applies to every cab with a lone two-state `main_sw`: e6act, ep03, ep05, et21, et22-2000, eu05, wmb10 (list
from the review; the cab files are in the SVN and were not checked here). Notices: whoever expects one press.
- **A `main_off_bt` declared `type: toggle` is the bistable hold coil lever of the ET22 and EP09** (#268): off opens the
breaker and keeps it from closing, back on only feeds the coil. Cabs keep a push button unless their `.mmd` says
`toggle`.
- **The cruise control has a switch of its own** where the secondary controller shunts the field (6Dg, ST45, BR285)
(#391): `tempomat_sw`/`tempomatoff_sw` follow the cruise control, not `ScndCtrl`. Vehicles with only one of the two
are unchanged. No new keys.
- **The compartment lights keyboard toggle** latches also in cabs without `compartmentlights_sw:` or with the on/off
push buttons (#353); the light preset selector with `Wrap=Yes` turns past its end with animation and sound (#345).
- **The HUD shows the radio channel only with the radio fuse closed**; the radio has a fuse and a hint "Close radio
fuse" (#280).
- **Door closure lamp (SOD) of the whole consist** (#291): the three-state lamp (lit locked, blinking released, dark
open) works only on vehicles with `Doors: DoorClosureSignal=Yes` in the `.fiz`. Old EN57/ED72 consists without
`DoorNeedPermit` do not get the key (they would blink at every standstill) and keep the old lamp that shows the lock
of the vehicle's own doors. The eu07.ini switch `doorclosuresignal` was removed: the data decides. Needs: the key
in the `.fiz` of the vehicle whose cab shows the lamp.
- **Separate engine start buttons work only with new data** (#294): the cab controls `mainb_*` and `mainc_*`
(`_sw`, `_on_bt`, `_off_bt`) start the second and third vehicle of a train in multiple, and `Engine: JointEngineStart=No`
stops the cab's `main_*` from touching the other vehicles. According to the data owners no cab in the SVN has
`mainb_*`/`mainc_*` yet (not checked here); without them and without `JointEngineStart=No` nothing changes
(default `Yes`). New commands `linebreakertoggleb/c`, `linebreakeropenb/c`, `linebreakercloseb/c`, no default keys.
## Physics and scenery
- **`physics.collisions` defaults to `new`** (#379, with #377 and #378): rail vehicle collisions past the buffers
crush the ends, a vehicle may ride up or be pushed off the track; road traffic keeps the old rule. `old` or
`monitor` in eu07.ini bring back the earlier behaviour. Notices: harder collisions, derailments of struck vehicles,
crushed ends that stay until repaired (resetconsist or repair). `physics.derailment` defaults to `monitor` (the
legacy draw decides, the log tells what the criteria would do); `new` is opt-in. `physics.trackcheck` and
`couplerphysics` (slack, hysteresis and breaking of the coupler; commits c85aab4f to 226155d4, no PR number) are
off by default.
- **Collisions past the buffers calibrated against the head-on collision of Szczekociny 2012** (`physics.collisions
new`, feat/collision-calibration). Ends without a crash zone crush for up to 4 m instead of 1.2 m (locomotive) and
1.5 m (wagon, coach), the force packing down to at most twice the plateau (6 MN and 4 MN); crash zones (EN 15227)
keep their 1.2 m. Two alike vehicles meeting level no longer both leave the rails at 0.6 m of crush of both ends,
only once one end is crushed past its structure (0.8 m, 0.6 m for a locomotive); the lighter (by 1.3 times) or the
higher (by 40 mm) one still climbs past 0.35 m. A vehicle off the rails sits 0.15 m lower, unless it got off them
climbing; an anticlimber works for its own end; an end crushed back to its running gear (the outer axle) derails the
vehicle. With `physics.derailment new` a vehicle that climbed stays on the line, carried by the underframe it rides,
while the pair still closes in faster than 0.5 m/s, then goes off the track; its body off the track is shorter by
the crush of its ends. A pair whose ends crushed already is never taken for one put down inside each other by the
scenery (at 100 km/h and more the hit ran past that check in the game and stopped crushing). Notices: in a hard
collision the locomotives and the first vehicles crush for metres and fewer vehicles behind them derail in it
(Szczekociny on td.scn: 6 of 13, all 13 did); a train hitting at 50-60 km/h crushes deeper; a rear-end hit at
100 km/h on two EN57 crushes the two ends that meet and leaves the units coupled behind them.
New optional `.fiz` key `BuffCoupl: FcrushMax` (kN), the most the crushed end packs down to. Needs: nothing.
- **Buffer stops at the free ends of the tracks** (`physics.bufferstops`, feat/buffer-stops, with `physics.collisions
new`). A track end marked `bufferstop1 <kind>` or `bufferstop2 <kind>` in the scenery is a stop of that kind:
`rigid` (rails bent up or concrete with a beam, BN-79), `buffered`, `hydraulic` or `friction` (sliding on brake
elements over a run-out). A vehicle running into it is held by its buffers and the stop up to a few km/h; harder,
the frame of the stop deforms, and a rigid stop is ridden up from about 9-12 km/h (Enfield 2021) and demolished past
that (Kirkby 2021), the vehicle going on off the end; a sliding stop slides up to its run-out, then is overrun; a
hydraulic one takes 336 kJ over 0.6 m and recovers. The log tells each hit (`bufferstop: ...`); a scenery that
declares the memory cell `__simulation.bufferstop` or `<track>:bufferstop` gets the vehicle, the outcome, the track,
the speed and the code of the outcome in it, and its events of those names run. With `physics.bufferstops auto` a
free end with a model of a stop (`koziol*`, `*oporow*`, `prellbock*`, `bufferstop*`) standing within 3 m of it is a
stop too, unless the track says `bufferstopN none`. The default is `marked`: only the ends the scenery marks; `off`
turns the stops off. Any other free end keeps the derailment off the end of the track, and so does every end with
`physics.collisions old`; `monitor` keeps it too and logs what the stop would have done. Notices: none until a
scenery marks its ends or `auto` is set. Needs: the attribute in the sceneries (SVN), or `auto`.
- **Welded track buckles in the heat** (#378) when the scenery or an event sets it; no effect otherwise.
- **A vehicle off the track (`physics.derailment new`) slides less far and no longer falls through the ground**
(GH#556, #560). The friction on the ground goes from 0.3 to 0.45 on its wheels and from 0.5 to 0.7 on its side: an
EU07 overturning at 130 km/h stops some 140 m on instead of 170 m. Where the terrain of the scenery has no ground
under it (a hole, past what was gathered around it), the slope of the track bed ends 3 m under the ballast and the
vehicle keeps its height beyond it, rather than sinking under the terrain. Needs: nothing; `old` and `monitor` are
not affected.
- **The coupling of a vehicle off the track (`physics.derailment new`) pulls hook to hook** (GH#579). It drew the two
ends together along the line between the faces of their buffers, which for ends side by side, almost touching along
the track and 0.4 m apart across it, ran at 80-90 degrees to the vehicles: a coach derailing next to its neighbours
pulled them off across the rails. Now it pulls along the line between the headstocks behind the buffers, some 1.2 m
apart along, at about 18 degrees in that case. Notices: fewer neighbours pulled off by a coupling, more of the force
of the coupling along the vehicles, a derailed train folding a little less (19 of 32 scattered trains of the unit
test fold where 23 did). Needs: nothing; `old` and `monitor` are not affected.
- **The cab shake is taken at the frame's moment** (#403, #414) and no longer moves in steps.
- **Station names keep their Polish letters** in the interface and timetables, a W4 finds its station by one key
(#418). A station of departure written in capitals is still a stop (#343).
- **Timetable service flags** (#398): the header row `[ Flagi AI | ... ]` and station entries such as
`kierownik=nie` change how the AI serves the train; a timetable without them drives as before. Old builds skip the
header row.
- **New putvalues commands** for sceneries: `Crew:<vehicle> <cab> <flags>` puts an AI driver in a vehicle or takes
it off (#422); `SignalAreaEnd` (#305, above); the parameter `H` after the coupling of a vehicle prepares it for
hauling dead in a train, the "pullee mode" (#419).
- **A scenery can react to a derailment** (derailment event PR, optional): when it declares the memory cell
`__simulation.derailment`, the simulator writes the vehicle, the cause, the track, the speed and the code of the
cause into it on each derailment, then runs the event `__simulation.derailment` and the event `<vehicle>:derailed`
when the scenery has them. Nothing is made or run for a scenery without them. See `tests/scenarios/README.md`.
## Data keys that need new data
All optional; without the key everything is as before. The data files are in the SVN, not here.
| Key / file | What it does | Data to change | PR |
|---|---|---|---|
| `.fiz` Cntrl `SBDReleaseDelay` (s, default 0) | The holding brake of a unit with the MED (SBD) lets go only after power was demanded for that long. | Elf files with SBD would get `1.0` (its `IniCDelay`). | #424 |
| `.fiz` Engine `PressureSwitchBrakeCylinder=No`, Cntrl `EmergencyBrakeMainOff=<bar>` | Pressure switch of the EP05 with the brake pipe alone; an emergency application on a power position opens the line breaker (pantographs drop with `PantRequiresMain`). | `ep05_v2/ep05.fiz`, `ep05v1.fiz`: `No` and `2.5`. | #421 |
| `.fiz` Cntrl `PantRequiresMain=Yes` | Line breaker closes before the pantographs, on the low voltage; pantograph valve stays open only with the breaker closed; the AI closes the breaker first. | `ep05_v2`, `ep05v1`, `181_cz1.fiz`. | #272 |
| `.fiz` Cntrl `ScndCtrlResistiveLock=Yes` | The field shunt can't be stepped up or down at zero or on a resistive position; it drops to 0 there. | ET21, ET22, EP09 files. | #278 |
| `.fiz` AI `ShuntPantstate=1/2/3` | Pantographs the AI keeps up while shunting. | ET41 files (`203e-a.fiz`, `203e-b.fiz`, `_dsa150`). | #281 |
| `.fiz` Engine `EDBrake`, `EDBrakeFmax/Pmax/V0/V1/Rate/Blending` | Dynamic brake of diesel-electric vehicles. | BR285 and the like. | #394 |
| `.fiz` Doors `DoorClosureSignal=Yes` | SOD lamp of the whole consist, see above. | Vehicles with `DoorNeedPermit`. | #291 |
| `.fiz` Engine `JointEngineStart=No`, `.mmd` `mainb_*`, `mainc_*` | Separate engine start per vehicle (ST43, SP32, SN61), see above. | Cabs and `.fiz` of those vehicles. | #294 |
| `.fiz` security system `AwareOffInShuntMode=Yes` | The SM42's vigilance device (CA) is off in the shunt mode. | SM42/SP42 files. | #275 |
| `.mmd` `animdoor` per door wing | Door wings of different kinds on one side. | Vehicles with mixed doors. | #397 |
| `.mmd` `i-compartmentlights`, `radioon_sw:` etc. | New lamps and radio fuse switches. | Cabs that have them. | #352, #280 |
| scenery `track`: `bufferstop1` / `bufferstop2 <kind>[;<a>[;<b>[;<setback>]]]` | A buffer stop at the free end 1 or 2 of the track, see Physics and scenery; `none` keeps the models of `physics.bufferstops auto` off the end. | The tracks of the stubs ending in a stop. | feat/buffer-stops |
| eu07.ini `physics.bufferstops auto\|marked\|off` | Whether the models of the stops at the free ends make them stops too (`auto`), only the marked ends are (`marked`, the default), or none (`off`). | Optional. | feat/buffer-stops |
| eu07.ini `sound.*` | The OpenAL Soft options, each defaulting to what the simulator did before. | Optional. | #404 |