Dunakanyar Szimulátor (vonat-sim-budapest) — v0.1 alpha
A browser train simulator of Budapest's suburban lines, built from
OpenStreetMap and elevation data: hand-rolled WebGL2, no dependencies, and a
Python bake pipeline. It is an alpha: expect rough edges and odd-looking
places.
Working on it? Start with docs/START_HERE.md. What is planned is in docs/OWNER_BACKLOG.md.
Play: https://marktremmel.github.io/vonat-sim-budapest/
(?line=line2 Esztergom, ?line=s21 Lajosmizse).
- Lines:
- 70: Nyugati – Vác – Szob.
- 2: Nyugati – Pilis – Esztergom, on the real weekday timetable.
- S21: Nyugati – Kőbánya-Kispest – Ócsa – Lajosmizse.
- Budapest: the whole of the central city is loaded in 1 km tiles around the camera, about 250k buildings, with the Parliament and the Bazilika from OSM's 3D building parts.
- Ways to play:
- Indulás: one click onto the next train from Budapest, on automatic; M takes over.
- Szolgálat: ten missions on real stretches (a FLIRT through Újpest, the KISS in the rain, the fog on the Pilis, a 1,280-tonne freight), scored for punctuality, stopping at the mark, safety, comfort and energy, with stars and four licence grades.
- Napi kihívás: a mission, time and weather chosen by the date, the same for everyone.
- Fotóalbum: photograph landmarks, peaks and towns (Z) from the train, a plane or the car.
- Photo mode (⇧Z or Fotó): everything stops (trains, cars, planes). You get:
- a free camera, or orbit round a clicked point;
- lights you place yourself;
- exposure, hue, saturation, contrast, warmth, vignette, grain, field of view;
- depth of field (click to focus) and a tilt-shift "miniature" mode;
- stickers (drag, wheel to scale, ⇧wheel to turn, double-click to flip) and a caption;
- a light leak, a flare, a print or film border and a date stamp. These are drawn into the saved PNG.
- Budapest's trams: lines 1, 2, 3, 4, 6, 56 and 61 run on their OSM routes, stopping at their stops. ⇧T (or "Villamos") puts you on the nearest one: a ride, from the driver's place or outside (C).
- Streets: traffic lights at OSM's signalled junctions (cars stop at red), and people walking along the kerbs.
- S21 runs the MÁV 416 "Uzsgyi" diesel railcar, with a diesel engine note; the overhead line ends at Kőbánya-Kispest.
Through Zugló and Kőbánya alsó it runs on its real embankment with the streets passing under, and it drops into a cutting under the airport road (
tools/raise_profile.py).
- Stations use their real platforms from OSM (islands, low or high), with the footbridges over the line (
tools/bake_platforms.py). Stations OSM has no platform for keep a generic one.
- Particles: a crashed aircraft burns and smokes, the Gripen's afterburner, wingtip vapour; and, at dusk in autumn and winter, a starling murmuration over Kispest.
- Announcements: "Következő állomás: …" after departure and "… következik" before arrival.
?mode=dark: the "dark timeline" sandbox. K (or the panel's button) strikes the middle of the view and J picks the weapon (shell, heavy bomb, very heavy bomb); each leaves a crater, scorched ground, and buildings and trees in the blast turned to rubble.
- The Királyréti kisvasút (line 70's world): the 760 mm forest railway from Kismaros up to Királyrét. It is taken from OSM (9.7 km, 8 stops). An Mk48 with three coaches runs it by itself all day. You cannot drive it.
- Ride as a passenger, watch in sightseeing mode (Kilátás), give orders on the dispatcher board;
fly (Cessna, Gripen, helicopter), fly a drone, or drive a car. Buildings are solid, trains brake for a car on the line, and the car stops at a closed boom.
- On a phone: touch buttons for the lever, the car and the plane.
- Share: "Megosztás" on the mode bar makes a link to this line, place, time and weather (and the free camera's view).
- On a phone: touch buttons for driving, and a ⋯ sheet for time speed, sound, wipers, zoom and an fps counter.
- Hungarian or English: the HU/EN button on the menu (the first visit follows the browser's language).
- Station announcements: a local Hungarian voice (macOS Tünde,
tools/make_announcements.py), with the sound on (G).
- Graphics switches (Beállítás): quality, depth of field in the outside views, motion blur, corner shading (AO).
- Help: press
? in the game for every key.
Run locally
python3 tools/build_sim.py # web/src + web/data -> dist/
python3 tools/serve.py 8177 dist # then http://localhost:8177
dist/ has to be served over HTTP; opening the file directly will not work.
node tools/test_sim.mjs # headless checks, also run by CI
GitHub Pages ("Deploy from a branch", main, root) serves the index.html at
the repository root: build_sim.py writes it along with dist/, pointing it
at web/data/ (window.DATA_BASE). After changing anything, run the build
and commit the new index.html with the change.
Data
Map data © OpenStreetMap contributors, under the ODbL
(https://www.openstreetmap.org/copyright). Terrain: Lechner Knowledge Center
DDM25 (CC BY 4.0) on lines 70, 2 and S21, Mapzen/AWS Terrain Tiles outside Hungary.
The baked runtime data is in web/data/. The raw downloads (data/raw/,
~660 MB) are not in the repository; tools/ fetches and bakes them again
(build_line2.sh, build_s21.sh, fetch_city.sh + bake_city.py).
The cover, logo and menu art are the owner's own. The panel-block façades
(web/data/facades.webp) are cut from two texture packs:
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗