mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-28 13:46:22 +01:00
Merge staging into feat/gl46-migration
origin/staging7ac2472c3into feat/gl46-migrationdb26a33ed, so that #468 merges into staging. Merge base037158104. Staging carries master up to571487612(squashed in #514); this branch had merged master up to7c12b83ba. Conflicts, file by file: - README.md: WITH_BETTER_RENDERER row dropped (gl46), USE_SYSTEM_JSON row kept (staging) - CMakeLists.txt: gl46 lists, plus staging's new core sources (hardwareinfo, sn_utils, regionfile, inionlysettings, fieldshunting, gaugewrap, drivingaid, signalpassing, brakereleaser, crew, brakecharge); none listed twice - tests/unit/CMakeLists.txt: both (texturealpha, freecameramotion; editorSwitchDrives, Camera) - vehicle/brakingcurve.{h,cpp}, tests/unit/test_braking_curve.cpp (add/add): staging (#479 brake_acting on the same #409 code) - editor/editorHttp.cpp: staging (it has gl46's #432 and certificate fixes, plus #439 libcurl loaded at run time) - tests/unit/test_editor_http.cpp (add/add): staging (adds the available() case of #439) - utilities/Globals.h: gl46 crashdump_full (staging's CrashDumpFull is #425, replaced here by utilities/crashdump.cpp); fmradio and staging's OpenAL options both; gfx_headlights_beamwidth (#481) not taken - utilities/Globals.cpp: both (odometer.expiry, OpenAL keys, fmradio, gl46 gfx keys); gfx.headlights.beamwidth (#481) not taken - utilities/Logs.cpp: staging's log_file_name() for both files, with gl46's crashdump_set_log_file() for both - utilities/utilities.h: gl46 set_thread_random_engine(); Random(int, int) gone on both sides - tests/unit/test_utilities.cpp: staging's includes - simulation/simulationtest.cpp: gl46 (no NvRenderer, LegacyRenderer, BasicRenderer here) - ci_shadervalidator/* (incl. add/add utilities/Logs.h): gl46's validator of shaders/ogl46 and shaders/vk14; staging's #437 fixed the GL 3.3 one - gl/shader.cpp, gl/glsl_common.cpp: gl46 (shaders come from rendering/common/shadersource.cpp); HEADLIGHT_BEAM_WIDTH (#481) not taken - shaders/mat_wire.frag: gl46. Rename detection paired staging's mat_colored.frag (#481) with it - lang/editor_pl.po: union; the 12 camera speed / orthophoto entries staging adds are here already (master #312) - audio/audiorenderer.{h,cpp}: both (fmradio; startsample and the low-pass filter); the destructor releases the radio, then the filter - application/editormode.h, application/editormodeswitchdrive.cpp: staging (#509 on #330, which is all this side had) - application/application.cpp: gl46's start sequence (no init_ogl, ANGLE or NvRenderer; crash window after init_ui) with staging's hardware::log_system() (#389) - EU07.cpp: gl46 (crash reports of utilities/crashdump.cpp); staging's side was #425's handler, replaced here - model/Texture.{h,cpp}: gl46 (texture_source); staging's side is master #399/#411/#362/#386, merged here before - world/Track.h, world/TrackSleepers.h: both (TrackBlend, lay(Fastened)/fasten; TrackBuckle, pack_models) - world/Segment.cpp: staging's track buckling on the split stray factors both sides have - vehicle/Driver.h: staging's additions (#444, #494, #473, #346, timetable flags) - vehicle/Driver.cpp: staging's file, with this branch'sf4f8c75e4(road orders measured along the lane) and8fbf05674(a holding road order blocks the ones past it) applied again; #409's SeenAheadTolerance gives way to #473 - vehicle/DynObj.h: friend opengl46_renderer and friend class vehicle_table - vehicle/DynObj.cpp: gl46's vehicle_table::update() with staging's update_off_track_contacts() and update_brake_pipes() - McZapkie/Mover.cpp: staging's function splits (#239) and hose exchange (#388); every line this branch added to Mover.cpp/MOVER.h is kept - .github/workflows/build_bin.yml: staging's apt-install step (#497) and pinned download-artifact (#331) Modify/delete, kept deleted: - rendering/opengl33renderer.{cpp,h}, rendering/openglparticles.cpp, rendering/openglrenderer.{cpp,h}: staging's versions are master's, and every master change to them is in this branch's history already - shaders/light_common.glsl, shaders/mat_sunlessnormalmap_specgloss.frag: see below Carried into this branch's code: - the hose exchange after each sub-step (#387/#388) also in update_steps_parallel(), per group of vehicles, as update() does it single-threaded - physics.pipewake (pipe_wakes(), wake_cause::scndpipe) in staging's GetScndDVc(), where the main reservoir hose exchange went - hardware::log_gl_context() (#389) in after_window() of the GL 4.6 backend, init_ogl() being gone Taken back out of the auto-merge (renderers this branch removed): - shaders/vk14/tonemapping.glsl: #481's switch to ACES, applied there by rename detection - environment/skydome.cpp, simulation/simulationenvironment.cpp: #415, the sky of the legacy renderer - application/application.cpp: #384's fallback of an unknown gfxrenderer, which this branch had dropped Not carried from staging (renderer files removed here): - master #481 (571487612): old assets drawn as in 26.05 (metal diffuse, sun highlight tint, ACES, SUN_DIFFUSE_SCALE 2.5, untinted Diffuse, mat_colored base) and gfx.headlights.beamwidth. Made for the GL 3.3 shaders; the PBR shaders of shaders/ogl46 and vk14 (and their SPIR-V binaries) are the author's call - #437: the unique temporary file of the shader validator (Sonar S5443); gl46's validator still writes /tmp/shader* Unit tests: 1133 of 1137 cases pass. Four staging tests fail (derailment: a repaired vehicle is back on the rails; three pullee cases): the vehicle stands, and with physics.sleepheld (on by default here) its physics sleeps with the Fb / FStand of before. With physics.sleepheld off they pass. Left to the author.
This commit is contained in:
135
docs/behaviour-changes.md
Normal file
135
docs/behaviour-changes.md
Normal file
@@ -0,0 +1,135 @@
|
||||
# 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).
|
||||
|
||||
## 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.
|
||||
- **Welded track buckles in the heat** (#378) when the scenery or an event sets it; no effect otherwise.
|
||||
- **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).
|
||||
|
||||
## 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 |
|
||||
| eu07.ini `sound.*` | The OpenAL Soft options, each defaulting to what the simulator did before. | Optional. | #404 |
|
||||
52
docs/imgui_patches.md
Normal file
52
docs/imgui_patches.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Local changes of the bundled ImGui
|
||||
|
||||
`imgui/` holds Dear ImGui **v1.91.9b-docking** (`IMGUI_VERSION "1.91.9b"`, the docking branch: upstream tag
|
||||
[`v1.91.9b-docking`](https://github.com/ocornut/imgui/tree/v1.91.9b-docking)), the GLFW, OpenGL 2 and OpenGL 3 backends
|
||||
of the same tag, and ImGuizmo. The changes below are ours: an update of ImGui has to carry them over, or drop them on
|
||||
purpose. Most of them are marked in the code with a `MaSzyna` comment (`grep -n MaSzyna imgui/*`), but not every
|
||||
changed line is.
|
||||
|
||||
Compared with the upstream tag, these files are unchanged: `imgui_demo.cpp`, `imgui_draw.cpp`, `imgui_internal.h`,
|
||||
`imgui_tables.cpp`, `imstb_rectpack.h`, `imstb_textedit.h`, `imstb_truetype.h`, `LICENSE.txt` and the backend headers
|
||||
(`imgui_impl_glfw.h`, `imgui_impl_opengl2.h`, `imgui_impl_opengl3.h`). The backends are in `backends/` upstream, here
|
||||
next to the rest.
|
||||
|
||||
## ImGui itself
|
||||
|
||||
| Change | Files | Since | Used by |
|
||||
|--------|-------|-------|---------|
|
||||
| `io.ConfigViewportsNoAutoDetach` (default `false`): a floating window stays inside its host viewport. A resize stops at the viewport's edge, a window left past the edge or too big for it is moved back and shrunk, and it gets a viewport (an OS window) of its own only when dragged with the cursor outside the host viewport. Tooltips and popups over the main viewport, or begun outside any window, stay in the main viewport. Upstream has no such option ([#236](https://github.com/MaSzyna-EU07/maszyna/pull/236); the closest upstream report is [ocornut/imgui#9594](https://github.com/ocornut/imgui/issues/9594)) | `imgui.h` (`ImGuiIO` field), `imgui.cpp`: its default in `ImGuiIO::ImGuiIO()`; `WindowStaysInHostViewport()`, `IsWindowBeingMoved()`, `KeepWindowInsideRect()`; the resize limit in `UpdateWindowManualResize()`; two places in `Begin()` (no late viewport, window kept inside the work rect); the fallback and `ViewportAllowPlatformMonitorExtend` in `UpdateSelectWindowViewport()` | 5fa03304e (#236), be4000880, d0ca44cd6 | `application/uilayer.cpp`, with the viewports on |
|
||||
| `io.ConfigTooltipsWrapWidth` (default `0`, no wrapping): the text of `SetTooltip()` / `SetItemTooltip()` wraps at that width. `BeginTooltip()` is not affected | `imgui.h` (`ImGuiIO` field), `imgui.cpp` (default, `SetTooltipV()`) | be4000880 | `application/uilayer.cpp` (40 font sizes) |
|
||||
| `ImGui::BufferingBar()` and `ImGui::Spinner()`, by zfedoran from [ocornut/imgui#1901](https://github.com/ocornut/imgui/issues/1901) | `imgui.h`, end of `imgui_widgets.cpp` | ae3cecfa4 (2019, for the progress bar of the loading screen of the time), carried over in 344034ec7 | nothing at present: can be dropped |
|
||||
| `#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM`: the OpenGL 3 backend uses glad, loaded by the simulator, instead of its own loader | `imconfig.h` | 344034ec7 | the OpenGL 3 backend |
|
||||
|
||||
## Backends
|
||||
|
||||
| Change | File | Since |
|
||||
|--------|------|-------|
|
||||
| With multi-viewports, ImGui positions are relative to the simulator's main window instead of the desktop, so the main viewport stays at (0,0) and the overlays, picking and editor gizmo work in window coordinates as without viewports. `MainWindowOrigin` in the backend data, `ImGui_ImplGlfw_UpdateMainWindowOrigin()` called from `NewFrame()`; the origin is subtracted from the mouse position (callback and `UpdateMouseData()`), the monitors' `MainPos` / `WorkPos` and `GetWindowPos()`, and added back in `CreateWindow()` and `SetWindowPos()` | `imgui_impl_glfw.cpp` | 476f3bf1b |
|
||||
| GL functions from glad (`<glad/glad.h>`) instead of the system's `GL/gl.h` | `imgui_impl_opengl2.cpp` | 344034ec7 |
|
||||
| GL functions from glad, with `stdafx.h` and `utilities/Globals.h` included for the renderer's settings | `imgui_impl_opengl3.cpp` | 344034ec7 |
|
||||
| `GlslVersionString` is 128 bytes instead of 32, for the longer GLES version string the simulator passes | `imgui_impl_opengl3.cpp` | 344034ec7 |
|
||||
| Gamma of the UI follows the renderer: the vertex shaders linearise the vertex colour (`pow(Color.rgb, 2.2)`); each fragment shader's output goes through `FBOUT()`, which applies `1/2.2` when `Global.gfx_shadergamma` is set and passes it through otherwise; with desktop GL and no shader gamma `GL_FRAMEBUFFER_SRGB` is enabled while the UI is drawn and restored after | `imgui_impl_opengl3.cpp` (`RenderDrawData()`, the shader sources, `CreateDeviceObjects()`) | 344034ec7 |
|
||||
|
||||
## ImGuizmo
|
||||
|
||||
From [CedricGuillemet/ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo), added in 5a39ed519; the upstream commit
|
||||
it was taken from isn't recorded. Changed in 344034ec7 for the ImGui API of 1.91:
|
||||
|
||||
- `IMGUI_DEFINE_MATH_OPERATORS` is defined before the first `#include "imgui.h"` (ImGui 1.86 and later want it so).
|
||||
- `ImGui::CaptureMouseFromApp()` is replaced by `ImGui::SetNextFrameWantCaptureMouse(true)` (six places).
|
||||
|
||||
And since 5a39ed519, for the ImGui of the time:
|
||||
|
||||
- A compatibility shim, `#define ImAbs(X)` when `ImAbs` isn't a macro (`ImGuizmo.cpp:42-44`). ImGui 1.91 has `ImAbs`
|
||||
as an inline function in `imgui_internal.h`, so the macro is always defined now and hides that function in
|
||||
`ImGuizmo.cpp`. It can be dropped.
|
||||
|
||||
## Checking an update
|
||||
|
||||
Download the files of the new tag (`imgui*.cpp`, `imgui*.h`, `imstb_*.h`, `imconfig.h`, and from `backends/`
|
||||
`imgui_impl_glfw.*`, `imgui_impl_opengl2.*`, `imgui_impl_opengl3.*`), diff the files here against the tag listed at the
|
||||
top, and apply that diff to the new files. The diff of the files here against `v1.91.9b-docking` is exactly the list
|
||||
above.
|
||||
121
docs/track_uneven_doc.md
Normal file
121
docs/track_uneven_doc.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# Track unevenness
|
||||
|
||||
An optional attribute of a track entry, before `endtrack`:
|
||||
|
||||
```
|
||||
node -1 0 tor1 track normal 100.0 1.435 0.15 25.0 20 0 flat vis
|
||||
rail_screw_used1 6 1435mm/tpbps-new2 0.2 0.5 1.1
|
||||
0.0 0.2 0.0 0.0
|
||||
0.0 0.0 0.0
|
||||
0.0 0.0 0.0
|
||||
0.0 0.2 100.0 0.0
|
||||
0.0
|
||||
uneven 18;;;25;6
|
||||
endtrack
|
||||
```
|
||||
|
||||
The numbers are in mm, 0-100, separated by semicolons with no spaces:
|
||||
|
||||
| position | `normal` track | `switch` |
|
||||
|----------|-----------------------------------------------|--------------------------|
|
||||
| 1 | peak deviation of a rail on a 10 m chord | the same, path p1-p2 |
|
||||
| 2 | vertical | path p3-p4 |
|
||||
| 3 | sideways | path p1-p2, vertical |
|
||||
| 4 | cross level | path p1-p2, sideways |
|
||||
| 5 | dip at rail joints, by default 0.4 of vertical | path p3-p4, vertical |
|
||||
| 6 | | path p3-p4, sideways |
|
||||
|
||||
A position left out takes the first number, and the dip follows the vertical value. Positions at the end can be dropped. Sideways alone is `uneven 0;;30`, and dips at the joints alone are `uneven 0;;;;6`. A switch with no components of its own on path p3-p4 takes the values of path p1-p2. A switch for 100 km/h on the straight path and 40 km/h on the diverging one is, for example, `uneven 14;35`.
|
||||
|
||||
All of them are also in the editor, in the track panel, section "Ride and sound". On roads, rivers and turntables they are ignored.
|
||||
|
||||
## Choosing a value
|
||||
|
||||
`uneven` corresponds to the "vertical irregularities" column of the PLK Id-14 instruction, appendix 1 (class C):
|
||||
|
||||
| speed [km/h] | 20 | 40 | 60 | 80 | 100 | 120 | 160 |
|
||||
|---------------|----|----|----|----|-----|-----|-----|
|
||||
| `uneven` [mm] | 50 | 35 | 25 | 18 | 14 | 10 | 6 |
|
||||
|
||||
According to the instruction, a track in good condition is half of this value (class A), and one in fair condition 3/4 (class B).
|
||||
|
||||
At these limits a pantograph may not keep up at speed, which trips the main breaker: see the end of "How it works". `tools/track_uneven_grade.py` keeps the values below that.
|
||||
|
||||
A track with `uneven 18` measures as follows (`tests/unit/test_track_uneven.cpp`), against the Id-14 limit for 80 km/h:
|
||||
|
||||
| parameter | result | Id-14 |
|
||||
|--------------------------|--------|-----------|
|
||||
| vertical irregularities | 18 mm | 18 mm |
|
||||
| horizontal irregularities | 17 mm | 17 mm |
|
||||
| twist on a 5 m base | 15 mm | 16 mm |
|
||||
| gauge | ±10 mm | +10/-8 mm |
|
||||
| cross level | 21 mm | 20 mm |
|
||||
| J index | 5.7 | 5.3 |
|
||||
|
||||
Id-14 only gives the scale of the value: how a track at that value measures. What the waves look like follows the track spectra of the literature, see "How it works".
|
||||
|
||||
## How it works
|
||||
|
||||
Unevenness is a displacement field that depends on the position on the map, made of waves 7-90 m long sideways and 8-110 m long vertically, about the bands D1-D3 of EN 13848. Their heights follow the shape of the track spectra of the US FRA and of ORE B176 (the German spectrum): a power spectral density of `Wc² / (W² (W² + Wc²))`, `Wc = 0.8245 rad/m`, so the longer a wave, the higher it is. Most of the height is in the long waves: they hardly count on the 10 m chord, the body rises and falls on them slowly, and the cab hardly feels them. At `uneven 18` a track goes up to about 5 cm up or down and about 4.5 cm sideways off its design over the long waves, and the short ones of 7-10 m, the ones the cab shakes on, are a few millimetres. Nothing in it is random: one place bends the same way on every run. A track that is moved gets the waves of its new place.
|
||||
|
||||
Each component joins separately:
|
||||
|
||||
- **Track to track:** the lower of the two values applies at the joint, and each track comes to it smoothly over 20 m. A free end of a track stays as designed.
|
||||
- **Switch:** each path has its own value, and the lower of the two applies at their common end. Directly joined switches take the lowest value of the same path, and where two paths meet, the lower of the two. A joined track comes to the value of the switch at the end it meets, even if that is higher than its own. A track with none of a component keeps the whole switch as designed in it.
|
||||
- **Joints:** the dips come every `fSoundDistance`, over 6 m, and run on through following tracks with the same spacing. The wheel clatter falls where the dip is. With a spacing of 6 m or less, and on switches, there are no dips.
|
||||
- **Cross level:** adds to the designed cant. It is a tilt of the map plan, so tracks laid towards each other meet at the same cant. On switches there is only the part coming from the waves, with no separate settling of the rails.
|
||||
|
||||
The ends of joined paths meet in the middle between them, with one vector across, if they are less than 20 cm apart. This closes the cracks from coordinates that don't match in the data, on tracks with no unevenness as well. At such a joint a switch takes the cant of the plain track, and two tracks or two switches meet halfway. This applies to the physics too.
|
||||
|
||||
The rails, the top of the ballast, `sleepermodel`, the axles, the roll of the body and the cab shake follow the unevenness. The slope of the ballast takes up the difference, and its foot stays as designed, on the ground.
|
||||
|
||||
Models from includes (e.g. switch drives and timbers), platform edges, level crossing panels, the terrain and the catenary don't follow it, so at large values a rail shifts away from such a model by a few centimetres, sideways up to about 4.5 cm at `uneven 18`.
|
||||
|
||||
On a track with unevenness the track itself shakes the cab, in place of two of the sources of shake that were there before, as far as it has something to put in their place. It goes by the track under the vehicle, and on a switch by the path set and what its joined tracks allow. Dips at the joints and cross level replace nothing, as they don't shake the cab all the way along or sideways. On tracks with no unevenness everything works as before.
|
||||
|
||||
| source of the cab shake | on a track with unevenness |
|
||||
|--------------------------------------------------------------------|----------------------------|
|
||||
| side sway from the lateral acceleration: curve radius and cant, jolts sideways on a damaged switch | off with a sideways value |
|
||||
| random jolts over 25 km/h | off with a vertical or a sideways value |
|
||||
| the track itself, from the bend under the axles | added |
|
||||
| vertical jolts at the joints of a damaged track | stays |
|
||||
| fore and aft, when accelerating and braking | stays |
|
||||
| diesel engine vibration | stays |
|
||||
| hunting (`huntingspring`), set by the vehicle | stays |
|
||||
|
||||
This is about the cab only. The physics, derailment included, and the noise of the wheels still use the lateral acceleration.
|
||||
|
||||
A pantograph rises at the rate set by the pressure, about 0.14 m/s, and a gap to the wire over 1 cm cuts the voltage and trips the main breaker. Unevenness adds to this at high speed. On the tracks of Bałtyk a simulation gives a gap of 0.6 cm when the vertical value times the speed in km/h is 1150, for example 9.6 mm at 120 km/h, 16 mm at 70 km/h and 29 mm at 40 km/h. The values in the Id-14 table are higher than that. The wire alone can do it too: at `tor0290` on Bałtyk it rises by about 1%, so a pantograph keeps up to about 46 km/h there, and above that the breaker trips on a straight track as well.
|
||||
|
||||
The physics takes the curve radius and the grade from the design, so unevenness doesn't change them. It adds only the cross level towards derailment, about 0.06 m/s² at `uneven 18` against a threshold of about 3.2 m/s².
|
||||
|
||||
## Grading the tracks of any scenery
|
||||
|
||||
`tools/track_uneven_grade.py` works out the values from what the scenery shows: ballast and rail textures, grass on the track, curves, speed and road crossings. It reads a `.scn`, `.scm` or `.inc` file with its includes and leaves the originals as they are, writing copies of the files with tracks to `--out`. With no `--out` it only prints a report.
|
||||
|
||||
```
|
||||
python tools/track_uneven_grade.py scenery/lk357.scn --out graded
|
||||
python tools/track_uneven_grade.py scenery/baltyk_skm1.scn --out graded --route -107,2300 -4120,2491
|
||||
```
|
||||
|
||||
- `--route X,Z X,Z`: tracks get worse from the first point to the second, measured along the tracks.
|
||||
- `--gain`: multiplier of the state of the tracks, 1 by default.
|
||||
- `--near`: the share of tracks on wooden sleepers and at changes of curve that go nearer the Id-14 limit, 0.6 by default. The choice is fixed.
|
||||
- `--straight`: names of tracks with no unevenness, separated by commas.
|
||||
- `--root`: the `scenery` folder, when the given file lies deeper.
|
||||
|
||||
The values stay under what a pantograph can follow, by a simulation over those tracks, but the rise of the wire itself isn't counted. Texture wear is read from the names, by the tables at the top of the script, and an unknown name gets 0.5. Tracks in `.inc` files taking parameters are skipped and `rotate` blocks aren't applied; the report says so in both cases. A track that already has unevenness stays as it is.
|
||||
|
||||
## Performance
|
||||
|
||||
A track with unevenness has geometry every 2 m instead of every 10 m on straights. Switches keep their division.
|
||||
|
||||
Measured (camera moving or in the cab, 1920×1080):
|
||||
|
||||
| scene | no flags | flags 18/35 |
|
||||
|-------------------------------------|-----------------------|------------------------|
|
||||
| Bałtyk, 56 km of tracks: vertices | 0.56 M (about 27 MB) | 2.17 M (about 104 MB) |
|
||||
| Bałtyk: longest frame in a fly-through | 31.5 ms | 64 ms |
|
||||
| `td.scn`, driving at 120 km/h: frame | 2.73 ms | 2.93 ms |
|
||||
|
||||
The cost grows with the number of flagged tracks, and the longest frames occur when the geometry of further sections is built. Driving on such a track costs practically nothing: about 0.3 µs per axle in a physics step.
|
||||
Reference in New Issue
Block a user