18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 11:15:23 +01:00
Commit Graph

5 Commits

Author SHA1 Message Date
maj00r 7889022c8e feat(steam): the other steam of a steam locomotive: air pump, injectors, whistle, generator, glands
Five more parts a smoke source can show with the steam: key of its template, each driven by the steam engine:
- air_pump: the exhaust of the air pump while the compressor runs on steam;
- injectors: the overflow of the injectors, the more the wider they are open;
- whistle: the whistle blowing (WarningSignal), while the boiler has steam;
- generator: the steady exhaust of the turbo-generator with the boiler up;
- leaks: steam past the glands of the cylinders, with steam in the chests, more with the engine working.
Unit tests check each blows only while its part works. Templates without steam:, and vehicles without a steam
engine, work as before.

Assets: five new templates in the SVN's data/: smokesource_steam_pump.txt, smokesource_steam_injector.txt,
smokesource_steam_whistle.txt, smokesource_steam_generator.txt and smokesource_steam_leaks.txt, made in the SVN
working copy and not committed yet; the placeholder pkp/ty2_v1, ty23_v1 and pt31_v1 have sources of them. No model in
the SVN uses them yet.
2026-11-25 13:20:11 +01:00
maj00r 34a257f531 feat(steam): steam and smoke of a steam locomotive
A smoke source of a vehicle's model now shows a part of its steam engine when its template says which, with the new
optional key steam: in data/smokesource_<template>.txt:
- exhaust: the blast up the chimney, in four puffs a turn of the driving wheels from two double-acting cylinders,
  merging into a steady blast at speed;
- smoke: the smoke of the fire, denser the harder it burns;
- safety_valves: the safety valves blowing off;
- cocks: the open cylinder cocks, with each stroke.
The engine gives each the share of the template's spawn rate and of the opacity and launch velocity of the particles
(smoke::steam_emission, with unit tests). A template without steam:, or a vehicle without a steam engine, works as
before: the smoke of the diesels and of the sceneries doesn't change.

The AI opens the cylinder cocks of a steam locomotive while starting, under 10 km/h with the regulator open.

Assets: four new templates in the SVN's data/: smokesource_steam_exhaust.txt, smokesource_steam_smoke.txt,
smokesource_steam_valves.txt and smokesource_steam_cocks.txt, made in the SVN working copy and not committed yet. A
model uses them with submodels of those names (the placeholder pkp/ty2_v1, ty23_v1 and pt31_v1 have them: the exhaust
and the smoke at the chimney, the valves on the dome, the cocks at the cylinders). Without the templates such a source
logs the missing file, as for any other template; no model in the SVN uses them yet.
2026-11-25 12:25:14 +01:00
jerrrrycho a6c7d53983 fix: SmokeDelay defaults to 0, the delay comes only from the vehicle's .fiz (eu07/maszyna#523)
Without SmokeDelay in its Engine section a diesel smokes as soon as the
starter turns, as before; the delay is set per locomotive in its own .fiz.
The value stays a member of the vehicle's mover, read from its .fiz with
an explicit default of 0.

Tests: the real SM42 and ST44 with SmokeDelay=2 and 5 in the .fiz, and
without it (smoke at once), next to a locomotive with a delay loaded
just before, which keeps its own value.
2026-11-08 12:33:53 +01:00
jerrrrycho d8f3875929 fix(gfx): diesel smoke only once the engine fires, not while the starter turns (eu07/maszyna#523)
The smoke of a diesel came out at full strength the moment its ignition
set Mains and started the spin up, together with the ignition sound, whose
first part is the starter cranking the engine.

The ignition now starts a countdown of the new optional .fiz parameter
SmokeDelay (Engine section of DieselEngine and DieselElectric vehicles,
seconds, default 2.0, 0 restores the old behaviour); the smoke source of
the vehicle spawns nothing until it runs out. Engines already running, or
switched on another way, smoke as before. No SVN data change is needed;
vehicle authors may tune SmokeDelay to the cranking part of their
ignition: sample.
2026-11-07 18:22:42 +01:00
jerrrrycho 4489dd7469 test(gfx): unit tests of the smoke of a vehicle taken off the tracks (#90)
The spawn count of the smoke source of a vehicle moves out of
smoke_source::update() into smoke::vehicle_spawn_count() (vehicle/smoke.h),
a free function on the mover state, which joins the core library so the
unit tests can call it the way the source does. The rates are the same as
before, the steady rate of the source still counted in before the share of
the engine.

Tests: tests/unit/test_smoke.cpp. A vehicle taken off the tracks spawns no
smoke and drops the pending particles, with the engine starting, idling or
under load; a road vehicle back from the pool puffs again; the engine adds
to the steady rate; the pending count stays within the room of the source.
Two of the four fail without the fix.

Checked again on td.scn with the SM42 driven into a portal: the smoke
source keeps puffing on the run and drops to 0 particles once the vehicle
is taken off the tracks.
2026-11-07 11:38:49 +01:00