With physics.collisions new and the legacy derailment (the default
physics.derailment monitor), a vehicle derailed the old way manufactured
collisions with the vehicles coupled to it:
- Derail() cuts its speed by 35 % in one step; the coupled vehicles kept
theirs and ran into it at a third of the speed of the train
(moczniki_eu06_eu07, tomaszewo_raj49843). The vehicles coupled to it
now get the same change of velocity.
- crush_hit() took it as an immovable wall and its motion ignored every
force (decelerating at g, then stuck by resistances x1e20), so the
train behind it stopped against it at once and crushed by the energy
of the whole train (l053-sluzba-2-night: 0.3 m on both ends at 8 km/h).
It is now a wall only to vehicles not coupled to it; it keeps the
legacy deceleration of g as a friction of its weight, and the forces
of its train act on it, so the train pushes it on and it holds the
train back. Alone it stops as before.
- Vehicles of the pile-up found inside each other kept what their
springs took in pressed past the stop as buffer energy, which let a
later small closing velocity crush them; a pair parting at the start of
the step and knocked back in during it was crushed with the springs
added to its closing velocity (l053_calkowo-sluzba-tlk-1,
linia61_osobowy3: crush at -7.1 km/h). The contact found inside each
other takes in nothing until the buffers part, and a pair parting at
the start of the step is left to the legacy collision.
The monitor test of a locomotive into a wagon at 60 km/h now counts one
hit: the second one was the locomotive resting on the legacy wall,
parting at the start of the step, at 0.3 km/h.
read_spec() took every token up to the end of the file into the block when the closing brace was
missing, so endmodels, sounds:, the lights and the rest were lost. The block now ends at the first
token that is neither a key nor the value right after one (or at endmodels), and that token is
put back for the caller.
With EDBrakeV0 = EDBrakeV1 = 0 the whole force acted down to the stop and turned round each time
the speed crossed zero; in FTrain it never let the stop of ComputeMovement() catch it, so the
speed swung round zero. Near the stop the force is now no more than what stops the vehicle within
the step.
144 tracks in 12 of the bundled scenarios have a speed limit above the overturning speed of the
reference vehicles, so the criteria as the default would change how they play. Until those limits
are corrected in the pctga data, the default (and a name not known) is monitor: the legacy draw
decides, and the log tells where new would derail a vehicle. new stays opt-in.
pick() kept m_lastposition of the vehicle before, so the next motion_of() took the step between
the two vehicles for a move: the direction could point back along the train, the ends swapped and
the railfan went to a spot 80+ m behind the tail. Now a change of the vehicle sets m_moved to
false, and the way is set again from the way the user drives.
read_timetable() went on from the StationCount it was given and checked only the upper bound, so
TimeTable[StationCount] and TimeTable[StationCount - 1] could index out of the table (Sonar cpp:S3519).
It now resets the count and the table first, and checks both bounds before the next station.
[Shift]+[F4] goes on after the four views it had (front of the train, its rear,
a bogie, drive-by) to four views that go with one vehicle of the train:
- orbit: around the middle of the vehicle. Left/right arrows (and the mouse)
turn the camera around it, up/down arrows bring it closer and further
(from outside the body to 250 m), PgUp/PgDn (and the mouse) raise and
lower it; it never goes below 0.5 m above the rails. It turns with the
vehicle.
- shunting: straight down from above the vehicle, the way the user drives up
the screen, going with it. Arrows move it along and across the train,
PgUp/PgDn up and down (from above the roof to 300 m).
- coupling: low beside a coupler, looking at it. At an end of the train with
another vehicle (not coupled) closer than 150 m, it starts at that end and
steps back from the track as the gap grows, looking between the two
couplers. Left/right arrows pick the side of the track, up/down the
distance, PgUp/PgDn the height.
- trackside: a railfan beside the line ahead of the train, looking at the
vehicle picked as the train comes and goes by. Once its tail is 40 m past
(or the train is 1 km away) the railfan walks to a new spot ahead, 15 s of
the train's run away (80-500 m, along the curve of the line), on the other
side of the track.
[ and ] pick the vehicle the view goes with (the coupling, in the coupling
view), towards the front and the rear of the train; the view starts with the
vehicle the user drives. [ and ] are bound to nothing by default nor in the
shipped eu07_input-keyboard.ini; [Ctrl]+[ / ] stay the debug train moves.
The camera follows from pure functions in vehicle/cameraviews.cpp (eu07_core),
tested in tests/unit/test_camera_views.cpp; application/consistviews.cpp hands
them the vehicles of the train and keeps what the user set. The four older
views and their order don't change. "consistviews no" in eu07.ini keeps the
cycle of [Shift]+[F4] to the four older views. The black box writes the new
views as 4-7 (blackbox_doc.md).
A universal control (window, door, sun blind) whose definition in the .mmd
has the new optional key drag: can be dragged with the left mouse button to
any position between its ends, and stays where it is let go:
universal1: { okno_p mov -0.71 0 0.3 drag: left soundinc: ... }
The value is the direction the mouse moves to open the control: up, down,
left or right (yes = up, no = off). The drag works like the sliders of the
controllers: the cursor is hidden, its move over 0.6 of the window height
takes the control from one end to the other. A click without dragging
toggles the control as before, and so do the keys: to the end farther from
where it is. Push controls aren't dragged. Without the key every universal
works as it did; none of the cab definitions has it yet.
New commands genericset0..29 set universal N to the position in param1
(0-1); the mouse sends them, and they can be bound to a gamepad axis.
The rules (the key's values, the move of the cursor along the direction,
the ends, click or drag, the keys) are in vehicle/universaldrag.h, with
unit tests.
A timetable can now tell the AI how the train is served, for trams,
underground trains and the like. The whole train gets them from a new
row of the first box of the header:
[ Flagi AI | drzwi_centralne=tak,stopien=nie,kierownik=nie,proba_hamulca=nie ]
and a station changes them from there on with entries of its station
ware (the second line of the station, next to R2, ph, @):
[ | | po,kierownik=nie 1 12.54 | ]
- drzwi_centralne=tak: the driver opens all the doors from the cab,
those of mixed control too (otherwise left to the passengers)
- stopien=tak/nie: the doorsteps switched on/off before the doors open
(the AI didn't touch them before; new driver hints for it)
- kierownik=nie: no conductor, so no departure signal (direct or by
radio) and no first door kept open for him before the departure
- proba_hamulca=nie: no running brake test
A flag left out keeps today's behaviour, so a timetable without flags
drives as before. Old builds skip the header row and keep the station
entries as station ware text (none starts with R or holds @, po, pt).
The reader moves out of TTrainParameters::LoadTTfile into
world/timetablereader.cpp (eu07_core) unchanged, so the tests can run it;
the flags come out of the station ware there. It now ends at the end of
the file with an error where the old one spun forever (a truncated file,
a missing number), and stops at 100 stations instead of writing past
the table.
Every .txt of the game's sceneries and of the SVN data reads the same
as with the old reader (compared field by field against a verbatim copy
of it); EU07_UNIT_TESTS_TIMETABLES=<scenery folder> reads them in the
unit tests and EU07_UNIT_TESTS_TIMETABLES_DUMP writes what was read.
A vehicle can now have door wings of different kinds on one side, e.g.
111Ainw (Bdhinu) with folding doors at one end and wider ones at the other.
A new optional entry in the models section of the .mmd:
animdoor: <wing number> { type: <Shift|Rotate|Fold|Plug> range: <m or deg> rangeout: <m> }
gives one wing (door1, door2... of animdoorprefix) its own kind of
animation and range; the keys left out keep the values of the .fiz. The
wing still follows the door of its side: it is as far along its own range
as the door is along DoorMaxShift. The entry may come before or after
animdoorprefix; a faulty one is logged and the wing keeps the .fiz kind.
Wings without an entry get the same update functions as before, so the
existing vehicles, .mmd and .fiz files are unchanged. The door state, the
physics, AI, cab controls, sounds and exports are not touched.
The parsing and the wing position live in vehicle/doorwings.h, tested in
test_door_wings.cpp.
The drive of a diesel-electric vehicle is computed from the power of its
generator, not from a circuit, so neither the EP09's resistor brake
(Current()) nor the inverter model of the induction motors has anything to
work on, and a negative setting of the integrated controller did nothing:
the BR285's TRAXX controller has its braking range (EB+, EB, EB-) and brakes
nothing.
A vehicle opts in with keys of its Engine section, read only for the
diesel-electric ones; without EDBrake nothing changes:
- EDBrake=Controller: the negative range of the integrated controller
(EIMCtrlType > 0) sets the effort, which goes to the vehicles in multiple
with the EIMIC command; EDBrake=Lever: a lever of its own, the one of
SplitEDPneumaticBrake (DBPN steps, the dynamicbrakecontroller commands),
working with the master controller at zero.
- EDBrakeFmax [kN], EDBrakePmax [kW]: the force at the wheels, limited by
the power of the resistors at speed; EDBrakeV0, EDBrakeV1 [km/h]: no force
below V0, the whole above V1. An inverter's brake fades only at the stop,
a resistor brake of direct current motors grows with the speed from 0.
- EDBrakeRate [1/s]: how fast the effort follows (0.5).
- EDBrakeBlending=Yes: the locomotive's train brake lets off by the share of
the force (Hamulec->SetED, LSt and EStED valves).
The brake works while the engine runs, with the direction set, the
overload relay closed, the wheels rolling and no power asked for. Its force
takes the place of the drive's in TractionForce(), the ammeter shows the
motors' current, DynamicBrakeFlag lights the dynamic brake lamp.
The traces of all 615 test cases recorded before the change compare bit for
bit after it (EU07_UNIT_TESTS_GOLDEN_EXACT=1).
The secondary controller (ScndCtrl) is the switch of the cruise control
(SpeedCtrl) on the vehicles which have one: its first position switches
it on (IncScndCtrl), zero off (DecScndCtrl), and the speed buttons and
steps work only off its zero position. On the 6Dg, the ST45 and the
BR285, diesel-electrics with SpeedCtrl=Yes, the same controller shunts
the field of the traction motors by itself (AutoRelay), refuses the
driver's moves, and nothing could switch the cruise control on.
Now the cruise control has a switch of its own wherever the secondary
controller shunts the field (ElectricSeriesMotor, DieselElectric) or
there's none:
- IsSpeedCtrlSeparate(): which vehicles; IsSpeedCtrlEngaged(): on or
off, SpeedCtrlUnit.IsActive for those, ScndCtrlPos > 0 for the rest;
- SpeedCtrlSwitch(): the driver's switch, on at the speed of the moment
or off; on the others IncScndCtrl(1) / DecScndCtrl(2), as before;
- the buttons, the steps and the power limit go by IsSpeedCtrlEngaged(),
the automatic turning off (SpeedCtrlATOF) by SpeedCtrlSwitch(false);
- the cab's tempomat_sw / tempomatoff_sw toggle it, and follow its state
rather than the secondary controller's; the AI's SpeedCntrl() uses it.
The .fiz and .mmd formats are unchanged, with no new keys: the
SpeedControl section and the cab's scndctrl and tempomat_sw entries
stay as they are and now work side by side. Nothing changes for the
vehicles with only one of the two: the whole unit test suite matches
golden traces recorded before the change bit for bit.
Tests (test_speed_control.cpp): the field shunting of the EU07, SM42 and
SU45 and the cruise control of the Impuls and EU47 as before, the 6Dg's
and ST45's shunting as before, the 6Dg's and ST45's cruise control on
its own switch holding and changing the speed with the shunting going
on by itself, the 214M railbus switched by the secondary controller
through SpeedCtrlSwitch(). The 6Dg's definition joins
tests/unit/data/fiz as on test/6dg-power-steps-real-data.
The main reservoir hoses (ctrain_scndpneumatic) exchanged the air explicitly inside each vehicle's step at the
physics step of 0.01 s, as the brake hoses did before eu07/maszyna#387. One step through the hose (0.38 of
area, whatever the vehicles) moves about 1.5 times the air which evens out the pipes on its ends (EN57 cars
8.3 l per bar against 5.5 l, SM40 8.6 against 5.7, passenger cars 9.3 against 6.3), and the vehicles with a
main reservoir of their own feed the pipe from it in the same step. Where a vehicle has both, and hoses on both
ends, the pipe can't settle: with all the main reservoirs held at 7.0 bar, the middle cars of a three unit EN57
kept jumping 0.8 bar to and fro between the steps for good (6.6/7.4), three SM40s in multiple traction the
same, a two unit Impuls 1.7 bar. Freely evening out, the reservoirs of a three unit EN57 took 13.9 s at 0.01 s
against 7.6 s at 0.001 s. A locomotive with passenger cars, whose pipe only it feeds, was stable already.
The main reservoir pipe now goes through the brake pipe's mechanism: UpdateScndPipePressure() leaves the hose
exchange to UpdatePipeCouplers() (GetScndDVc(), ScndPipeCouplersSubsteps(), 2 sub-steps for these vehicles),
which vehicle_table::update_brake_pipes() calls after every vehicle stepped. The two pipes share the code and
take their sub-steps apart, so the brake pipe's exchange is as it was. With it the EN57 pipes stand at 7.000,
and its reservoirs even out in 7.0 s against 7.5 s at 0.001 s.
The air the brake hoses carry between the vehicles was taken explicitly inside each vehicle's step, at the
physics step of 0.01 s. Through the hose between two 14 m freight wagons (Spg 0.792, 11.5 l of pipe) one
step moved 11.8 l per bar, 2.06 times the 5.7 l that evens out the two pipes: the pipes overshot each other
in turns and settled into a pattern in which every distributor saw the pipe up to 0.28 bar off the pressure
left in it after the step. ESt3 valves charged at 5.0 bar saw 4.79 and lapped at the first stage, and the AI
of a standing freight train never got its brakes released (the report of eu07/maszyna#368).
The exchange now comes after every vehicle has stepped (vehicle_table::update_brake_pipes(), once per
physics iteration), for the vehicles which stepped their pipe, in as many sub-steps as keep the air a hose
carries in one below what evens out the pipes on its ends (3 for 14 m freight wagons, 2 for passenger
cars), each going through the vehicles in the order they step. The distributors see the pressure the pipe
holds, and an application reaches the end of the train as with a step of 0.001 s.
Neither resetconsist nor the repair of a coupler cleared what a collision left: the crush of the ends (which keeps
shifting the stop of the buffers in CouplerForce() and in the pair input of the coupler physics, so the next hit of
the repaired consist started past it and sooner over the override threshold), the energy of the contact, the hit of
the step and the reports of the log; nor the reason of a derailment in a collision and the state of the push off.
repair_damage() rebuilds both ends of the vehicle, rerail() clears CollisionDerail and the push off monitor along with
the state of the criteria of derailment (so SetDamage taking dtrain_out off does as well), and the repair of a coupler
rebuilds its end, the crush past the draw gear having torn it off.
check_pushed_off() counted the time Y/Q of the leading wheel stayed over the climbing limit, at any speed: a locomotive
at its starting effort pressing a braked rake pushed the empty wagon in front of it off the rails in five steps of
0.01 s without it moving, and an 80 t locomotive running onto a free empty 3WL at 9 km/h pushed it off with the
half-sine of its buffer springs (565 kN for some 0.06 s, over the climbing limit past about 400 kN in a curve of
150 m).
Nadal's limit is that of a wheel rolling under its angle of attack: the creep of the flange contact turns the friction
upwards, helping the flange up. A wheel that doesn't roll has the friction against the lift, and with a flange of 70
degrees and a friction over 1 / tan 70 = 0.36 no lateral force gets it up. So the flange now climbs over the distance
the wheels roll with Y/Q over the limit without a break, the 2 m window of the criteria of derailment (the window of
EN 14363; the climb distance criteria replaced the 50 ms of AAR Chapter XI for the same reason). A hit counts the
distance rolled over the time its peak lasted. A push which takes the whole load off the leading wheels lifts them off
the rail, rolling or not: that, held for 0.05 s, still derails the vehicle by the time.
collision::pushed_forces() gives Y and Q of the wheel (pushed_ratio() their ratio), pushed_monitor counts the climb
over the distance and the lift over the time. Tests: both cases of the review stay on the rails (the ST44 pressing at
386 kN, Y/Q 1.29 in a yard curve of 120 m, the 3WL moving 0.11 m; the EU07 at 9 km/h, 565 kN, Y/Q 1.68 for 8 steps), a
heavy train propelling an empty 3WL into a braked rake in a curve of 150 m still pushes it off as it slides on.
A track without a speed limit of its own was checked at a default 125 km/h and counted as overturning or a tight curve
too fast at the default speed: in Tomaszewo 154 such lines, all of them curves with no limit, the tram tracks of the
town (29 to 31 m) among them. A curve without a speed limit is no defect: the drivers go by the signals and the
timetable there. It now gets a note of its own, "no speed limit set (not a defect): the curve takes at most X km/h,
the overturning speed of EU07", only where that is under the top speed of the EU07, and the summary counts these
curves apart from the suspicious tracks, with the slowest speed among them. The tight curve too fast needs a speed
limit too. Tram tracks have no category of their own (a tram is a vehicle of the trains' category, on their tracks),
so they are checked alike.
resetconsist (Stop and repair consist of the debug panel and of the vehicle window) cleared the damage flags, but kept
Derailed, the stretches of the criteria, the distance gathered for them and the report of the monitor. A vehicle once
derailed by the criteria and repaired then slid on with their friction after a derailment of the legacy kind, instead
of stopping dead, and the friction of the ballast kept holding it whenever it stood.
TMoverParameters::rerail() puts a vehicle back on the rails: dtrain_out off, Derailed none, the criteria from scratch,
the monitor free to report the track again, a rail vehicle back on the axis of the track. repair_damage() does what
resetconsist did to the damage (the flags, the engine damage, the wheel flats, the alarm chain) and rerails it;
resetconsist and the road vehicles coming back from the pool of a road point use it. SetDamage taking dtrain_out off
rerails the vehicle as well. A vehicle put on a track anew (consistteleport) starts the stretches of the criteria
over, they were gathered on the track it left.
The rerun of calkowo_v2_kontenera with the energy budget still crushed and overrode its two
locomotives, at 9-13 km/h: the scenery puts the SM42 onto the SU45 with their middles 2.7 m
apart. The springs at the stops of both ends and the neighbours found at either end shake
such a pair up past the energy of the buffers. Pressed past the stop of their buffers and the
crush of their ends by more than 0.5 m (more than a hit takes them in a step), the pair is
inside each other: no crush, the legacy collision pushes them apart, and the log tells it once
(Bad scenery: A and B are inside each other ...).
An automatic coupler, or its adapter, has no buffers at the side: its draft gear takes in what
its springs of the .fiz do, so the budget leaves no EN 15551 capacity to such a pair. The
EN57-2000 hitting a standing one at 20 km/h (en57_2000_crush_new) crushes again.
The PoC cases of the energy budget, for the record: 15 km/h straight crushes 3 ends (0.18 m)
where it crushed 2 (0.16 m), the same empty pushed off; at 25-40 km/h fewer ends deep in the
trains crush on the straight, a few more in the curve, the locomotive overrides in all of them.