From 3c3c773ff46080b697c7b788c7a7b62503c5d8df Mon Sep 17 00:00:00 2001 From: jerrrrycho Date: Wed, 25 Nov 2026 05:11:07 +0100 Subject: [PATCH] test(scenarios): the buckle cases run with physics.derailment new (#423) * test(scenarios): the buckle cases run with physics.derailment new eu07_td_buckle_derails waits for the "derailed on buckled track" line, which only the criteria of physics.derailment new write. It was written with new as the default; since monitor is the default (0645096e) the criteria only log "derailment monitor: ... overturned at 46 km/h on track tdo_n222" and the train runs on to Przystanek, so the case failed. The case sets the mode itself now. eu07_td_buckle_event sets it too: under monitor its "no Bad driving" check said nothing about the criteria. * docs(scenarios): the buckle cases and the derailment mode they set --- tests/scenarios/README.md | 9 +++++++++ tests/scenarios/cases/eu07_td_buckle_derails.json | 4 ++-- tests/scenarios/cases/eu07_td_buckle_event.json | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/scenarios/README.md b/tests/scenarios/README.md index 7e9ceef7c..f65d96fb2 100644 --- a/tests/scenarios/README.md +++ b/tests/scenarios/README.md @@ -278,6 +278,15 @@ pushed, runs onto `tor1k` (`eventall2`), with the train still moving, and the bl locomotive coupled to the coaches (it couples about 70 s after the start). A driver that leaves its hand brake on under Connect pulls against it for good and the case ends as a standstill after 300 s. +The `eu07_td_buckle_*` cases (fragment `td_buckle_event.scn`) run the timetable train of +`td_timetable.scn` and buckle the curve `tdo_n222`, about 950 m ahead of it, with a `trackbuckle` +event of `vars.amplitude` at 10:35. Both have `physics.derailment new` in `ini`: the default, +`monitor`, leaves the decision to the legacy draw and only logs what the criteria would do +(`derailment monitor: ... overturned at 46 km/h on track tdo_n222`), so the train runs on to +Przystanek whatever the buckle. With 600 mm over a main lobe of 8 m the locomotive overturns on +the buckle at 46 km/h, 1036 m from the start (`Bad driving: ... derailed on buckled track`); with +30 mm it keeps on the rails and stops at Przystanek after 1400 m. + The `*_td_crew_*` cases (eu07/maszyna#510, fragment `td_crew.scn`) are about the crew command of a `putvalues` event, `Crew: `: cab 1 or -1 puts an AI driver in cab A or B of the vehicle named, 0 takes its AI driver off. The vehicle is named in the text, so the events are diff --git a/tests/scenarios/cases/eu07_td_buckle_derails.json b/tests/scenarios/cases/eu07_td_buckle_derails.json index 5caaa60b6..8506736a5 100644 --- a/tests/scenarios/cases/eu07_td_buckle_derails.json +++ b/tests/scenarios/cases/eu07_td_buckle_derails.json @@ -1,5 +1,5 @@ { - "description": "EU07 on td.scn on the td/rozklad timetable; at 10:35, as it leaves, the curve tdo_n222 about 950 m ahead buckles hard with a trackbuckle event: 600 mm out of the curve over a main lobe of 8 m (an equivalent radius of 9 m, about 30 m for the body on axles 11 m apart). The AI doesn't see it and runs into it at the 46 km/h it has there: the locomotive leaves the rails on the buckle and stops short of Przystanek.", + "description": "EU07 on td.scn on the td/rozklad timetable; at 10:35, as it leaves, the curve tdo_n222 about 950 m ahead buckles hard with a trackbuckle event: 600 mm out of the curve over a main lobe of 8 m (an equivalent radius of 9 m, about 30 m for the body on axles 11 m apart). The AI doesn't see it and runs into it at the 46 km/h it has there: with physics.derailment new (the default, monitor, only logs what the criteria would do and the train runs on) the locomotive leaves the rails on the buckle and stops short of Przystanek.", "base_scenery": "td.scn", "time": "10:34", "fragment": "td_buckle_event.scn", @@ -7,7 +7,7 @@ "consist": "node -1 0 {{vehicle}} dynamic pkp\\4e_v1 4e-004 4e 0 headdriver 0 0 enddynamic", "amplitude": "600 8" }, - "ini": ["gfxrenderer null"], + "ini": ["gfxrenderer null", "physics.derailment new"], "duration": 240, "timeout": 600, "checks": [ diff --git a/tests/scenarios/cases/eu07_td_buckle_event.json b/tests/scenarios/cases/eu07_td_buckle_event.json index 192fa9b5a..13e0da7bc 100644 --- a/tests/scenarios/cases/eu07_td_buckle_event.json +++ b/tests/scenarios/cases/eu07_td_buckle_event.json @@ -1,5 +1,5 @@ { - "description": "EU07 on td.scn on the td/rozklad timetable; at 10:35, as it leaves, the curve tdo_n222 about 950 m ahead buckles with a trackbuckle event (30 mm out of the curve, as the heat does: an equivalent radius of 330 m, too little to derail it). The track is laid again during the game and the train keeps on it to Przystanek.", + "description": "EU07 on td.scn on the td/rozklad timetable; at 10:35, as it leaves, the curve tdo_n222 about 950 m ahead buckles with a trackbuckle event (30 mm out of the curve, as the heat does: an equivalent radius of 330 m, too little to derail it). The track is laid again during the game and the train keeps on it to Przystanek, with physics.derailment new: the criteria decide, as in eu07_td_buckle_derails.", "base_scenery": "td.scn", "time": "10:34", "fragment": "td_buckle_event.scn", @@ -7,7 +7,7 @@ "consist": "node -1 0 {{vehicle}} dynamic pkp\\4e_v1 4e-004 4e 0 headdriver 0 0 enddynamic", "amplitude": "30" }, - "ini": ["gfxrenderer null"], + "ini": ["gfxrenderer null", "physics.derailment new"], "duration": 240, "timeout": 600, "checks": [