18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 16:14:58 +01:00

feat(blackbox): the black box on its own, writing the tapes of the user's vehicles at the end

"blackbox yes" in eu07.ini records the black box with the physics logs on or off, "blackbox no" never;
with no entry it goes with "physicslog yes" as before. With the physics logs off, the recorder keeps the
line of the physics log of the driver the user is with, every 0.05 s, and writes it to
physicslog/<vehicle>.dat when the recording closes: the speed recorder's tape of the vehicles the user
was in, without every vehicle keeping a log open and written twenty times a second.

The line and the header of the log are made by one function of the driver, which its own log writes
too, and the file is opened the same way, so the two are the same to the byte: the readers of these
logs (the old Hasler tape viewer, the starter) read them as before.
This commit is contained in:
maj00r
2026-11-14 00:04:55 +01:00
parent 0488519f39
commit 5ca2f7e38f
7 changed files with 126 additions and 54 deletions

View File

@@ -7,10 +7,17 @@ done at the same moment, every command the user gave, when the autopilot took ov
the timetable and how the train kept to it at each station, and where it was told to sound the horn. From it another program (the
starter, a viewer) can replay the session on the map, or set the user's driving against the AI's.
It is written along with the physics logs: `physicslog yes` in `eu07.ini`, not in an editor session.
`blackbox no` turns it off while the physics logs are kept (it is on by default). The file goes next to
them, `physicslog/<scenery>_<YYYY-MM-DD_HH-MM-SS>.blackbox` (the local time the recording started at).
The `.dat` logs stay as they are.
`blackbox yes` in `eu07.ini` writes it, with the physics logs on or off; `blackbox no` never does. With no
`blackbox` entry it is written along with the physics logs, `physicslog yes`. It is never written in an
editor session. The file goes to `physicslog/<scenery>_<YYYY-MM-DD_HH-MM-SS>.blackbox` (the local time the
recording started at), next to the `.dat` logs of the vehicles when those are on; they stay as they are.
With the physics logs off it still gives the `.dat` log of each vehicle the user was in, written when the
recording ends: `physicslog/<vehicle>.dat`, the same file name, the same columns and the same line every
0.05 s as `physicslog yes` would write, but only of the times the user was there. A vehicle with no driver
of its own takes the log of the driver of its train. So the speed recorder's tape can be read from them as
before, without the simulator keeping a log of every vehicle open all the time. A simulator that crashes
leaves the recording, but not these logs.
The recording starts once the scenery is loaded and ends when the simulator closes. Going into the
editor (F11) ends it too, since the editor may take away the tracks and the vehicles it refers to; no