TSW Live & Historical Weather

  • by Luex
  • 25 upvotes
  • Downloaded 1,195 times

This mod introduces live weather synchronization and historical weather to Train Sim World 5.

The mod queries the current position on the map and uses the API from open-meteo.com to retrieve the current weather data based on the position. While driving, the weather is updated every 5 minutes (15 minutes is the shortest interval for weather updates from the API, but changing coordinates while driving make a shorter interval useful).

If you select Live Weather, the weather will reflect the current real-life conditions, regardless of the date or time used in the simulator. The second mode is Historical Weather. In this mode, the mod queries the weather based on your selected date and time in the simulator. If you select the historical weather mode and choose a future date, the mod queries the weather based on the current or last year. The month, day, and time will remain the same.

The API may be used free of charge for non-commercial purposes. There is a limit of 10,000 API requests per day, but this should not be exhausted by this mod.

Please install the dependency (UE4SS) before installing this mod.

Important: This is a beta release of the mod. If you have any problems or suggestions for improvement, please use the comment function.

How to use

After installing, you will find two new options in the weather settings menu. Choose Live Weather or Historical Weather instead of Dynamic Weather or Custom Weather to activate the mod for your journey. After starting, the first synchronization will occur after ~60 seconds.

If you are in historical mode and change the date using the God Mode mod or time-related console commands, the mod will force a weather synchronization.

Known issues

  • Sometimes the game crashes after the journey
  • After starting a journey, it takes up to 60 seconds for the weather to synchronize.
  • At the beginning there is no snow on the ground and it only appears gradually. I will adjust this with historical data in the future.

Roadmap

  • Add possibility to keep irl time in sync
  • Add more realistic sunset and sunrise behaviour
Changelog
  • Version 0.1: Initial release
  • Version 0.2: Changed sync interval to 5 minutes, fixed random crash, added historical weather, renamed mod to TSW Live & Historical Weather, fixed rain level bug, date changes via god mode mod or command force sync weather
  • Version 0.3: Fix issue with floating points on different platforms (for some users it was always raining)

Requirements

Needed for loading C++ and Lua Mods

Installation Instructions

The downloaded ZIP archive must be unpacked into the folder \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods.

If you are playing on XBox Games the Mods folder location may differ.

YouTube Tutorial:

youtube

Tags: code sync ue4ss weather

Files

TSWWeatherMod0.3.zip 305 KB · Added 19 Jan 2025 · Downloaded 671×

v0.3

Previously uploaded files have been downloaded 524 times before being withdrawn.

Comments

Avatar of Joers182
Joers182 11 Jan 2025

Have been hoping to get live weather in TSW. Thanks a lot! looking forward to trying it out.

Avatar of Luex
Luex 11 Jan 2025

Thank you. If there are any problems just let me know.

Avatar of tonytrainsfree
tonytrainsfree 11 Jan 2025

Whare do i need to put this for the xbox version of TSW?

Avatar of Luex
Luex 11 Jan 2025

I tested it only on the steam edition on PC. Are you playing on console or with XBOX app on PC?

Avatar of tonytrainsfree
tonytrainsfree 11 Jan 2025

xbox app on pc it not in the xbox folder

Avatar of ngc
ngc 11 Jan 2025

Worth nothing that you need to launch & quit the game at least once when installing the mod to get everything to build, after that the mod will work on the next launch.

Avatar of Luex
Luex 12 Jan 2025

Yes, the mod does not support hot reloading.

Avatar of CapitolLimited
CapitolLimited 11 Jan 2025

Absolute game changer. Any way to include sunrise/sunset and temperature as well?

Avatar of Luex
Luex 11 Jan 2025

Thank you for your feedback. The temperature is already part of this mod and gets updated on every sync. This is already having an impact on some locomotives and their behavior (especially at high temperatures). The BR 101 Expert, for example, the fan reacts to the temperature. I will have a look at sunrise and sunset but shouldn't it depend on the timetable?

Avatar of CapitolLimited
CapitolLimited 11 Jan 2025

I think sunrise and sunset is a global variable, which is why so many problems with regards to daylight savings time and the sun rising and setting too early/late. I could be wrong though.

Avatar of Luex
Luex 11 Jan 2025

Oh I see. I'll have a look at that.

Avatar of Myron
Myron 12 Jan 2025

This is a really neat idea. Now I wonder if it's possible to adjust the in-game time to the irl time aswell, however that'll surely generate conflicts between AI services along the route if the time is suddenly being changed... Unless, maybe that could still be worked out for loading a timetable on-foot instead of selecting a service via menu 🤔

Avatar of Luex
Luex 12 Jan 2025

For the timetable mode, this would be more of a jump at a certain point in the timetable. If you build it in so that it can only be done on foot or in the menu, it should work. I can definitely take a look at it.

Avatar of Bahnkaktus
Bahnkaktus 12 Jan 2025

Unfortunately, despite correct installation as described here, no real weather is displayed. Do I need to consider anything else for the option to appear?

Avatar of Luex
Luex 12 Jan 2025

Do you have Steam, EpicGames or XBOX Games? I will record a short guide for installation soon.

Avatar of Bahnkaktus
Bahnkaktus 12 Jan 2025

I want to use the mod with Steam version.

Thanks for the documentation, looking forward for this.

Avatar of Luex
Luex 18 Jan 2025

I added a short youtube video to the mod description. Perhaps this will make the necessary organizational structure a little clearer.

Avatar of OpenMinded
OpenMinded 12 Jan 2025

Amazing! Thanks for this. Two questions, I noticed that the used API website also provides historical data. Would it be thinkable to include this in the future? So, to request data for a special day when selected in the game for a timetable run? Also, how do you deliver the current position from within the game to an outside website?! I was always under the impression that this is not possible at the moment, until DTG provides its own API for the game (just out of interest, really...)?! EDIT: to make the second question more meaningful, is the position actually checked every 15min as well or is it only using the initial starting position to request the data?!

Avatar of Luex
Luex 12 Jan 2025

Thank you for your feedback! I used the header dump tool from UE4SS to get the header files for all c++ classes of the game. I then looked for anything with location in the name and found a class called TS2DebugFunctionLibrary. It has a method called GetActorLatLong which returns the geo referenced coordinates for any unreal engine actor in game. I am using reflection to get the instance of TS2DebugFunctionLibrary at runtime. The position gets updated every time the api is called.

The mod is fully implemented with c++ as there is currently no http request blueprint node in the game.

Regarding historical data:
I will add it to my roadmap, this would be a nice addition.

Avatar of OpenMinded
OpenMinded 12 Jan 2025

Very interesting indeed! As stated, didnt know this is possible. This may be interesting for other external applications, like an EBuLa, for example... Thanks for sharing this!

And, yes, the historical data would be a really nice addition. Personally I do opt quite often to drive in a different month. However, as said above from others as well, amazing that real weather is now a thing at all:-)

Avatar of ClutchFred
ClutchFred 17 Jan 2025

Historical Dates are now implemented :)

Avatar of Ost-Trieb
Ost-Trieb 12 Jan 2025

I have the same problem like Profile picture of Bahnkaktus Bahnkaktus

Avatar of Luex
Luex 12 Jan 2025

Do you have Steam, EpicGames or XBOX Games? I will record a short guide for installation soon.

Avatar of Ost-Trieb
Ost-Trieb 12 Jan 2025

I use Steam.

Avatar of Luex
Luex 14 Jan 2025

Could you please confirm that you have the correct directory layout and all files are in the correct folder:

  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\dwmapi.dll
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS.dll
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS-settings.ini
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\TSWWeatherMod\enabled.txt
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\TSWWeatherMod\dlls\main.dll
Avatar of Ost-Trieb
Ost-Trieb 14 Jan 2025

yes i have all files.

Avatar of Luex
Luex 18 Jan 2025

I added a short youtube video to the mod description. Perhaps this will make the necessary organizational structure a little clearer.

Avatar of r2d2
r2d2 18 Jan 2025

Look at my Answer at Bahnkaktus.... It fixed it

Avatar of Logital06
Logital06 12 Jan 2025

Hey I spawned on 4 Routes in different Regions of Germany at the present time. The weather was always not similar compared to the weather online radar. Did I do something or do it use weather data of the previous day? But in all in all really cool mod idea

Avatar of Luex
Luex 12 Jan 2025

A request is sent to open-meteo.com approx. 60 seconds after starting a route and then every 15 minutes. There is also a playground on the website to get the current data for coordinates. Does the weather there match?

Link API Playground

Avatar of oliverpope03
oliverpope03 13 Jan 2025

Does the addon use the 15 minute data or hourly, currently I've got small rain but the 15 min says no rain for half an hour (Blackpool) However an amazing edition to the game, I tried making a similar thing using UE4SS a few months ago and I was completely lost so glad it was done by someone who understands more

Avatar of Luex
Luex 14 Jan 2025

Currently it is using 15 minutes data in most areas. open-meteo.com has a fallback to hourly values if no 15 minutes values are available.

Avatar of rmccon.
rmccon. 13 Jan 2025

Great addition to TSW. Unfortunately, every map and scenario I've tried so far has fine weather (as per the respective locations) but with continual light rain falling.

Avatar of Luex
Luex 14 Jan 2025

Thank you for your feedback. Could you please tell me which locations are affected?

Avatar of jeanduvoyage_
jeanduvoyage_ 14 Jan 2025

Hi, just to let you know i have the same problem. I've tried every route i have, light rain (or snow depending of the temperature) falling everywhere (even in LA with Antelope and San Bernardino routes). I've tried to switch back to dynamic and come back to your mode, but after 1 min or so on the route, it begins to rain (very lightly) again.
Every other conditions seem to work perfectly (either cloudy, sunny, windy...).
I'm sure this mode can be a game changer for me, hope for a fix regarding this bug :) Thanks!

Avatar of rj1
rj1 14 Jan 2025

hi, I also have the continual light rain problem, although the sky does change

Avatar of Luex
Luex 14 Jan 2025

Thank you for your feedback, the bug is known and i am currently working on a fix.

Avatar of rj1
rj1 14 Jan 2025

thank you looking forward to the update

Avatar of Luex
Luex 18 Jan 2025

Could you please update and try again? If the issue persists please start the game and wait until it starts raining, then exit the game. After that, send me the WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS.log file on Discord (@nilsdev1).

Avatar of Bahnkaktus
Bahnkaktus 14 Jan 2025

How do I get the real weather into TSW 5 (Steam version)?
Despite correct installation, this option does not appear for me, I can choose dynamic and custom weather only.

Avatar of Luex
Luex 14 Jan 2025

Hello. Could you please confirm that you have the correct directory layout and all files are in the correct folder:

  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\dwmapi.dll
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS.dll
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS-settings.ini
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\TSWWeatherMod\enabled.txt
  • \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\TSWWeatherMod\dlls\main.dll
Avatar of Bahnkaktus
Bahnkaktus 14 Jan 2025

I have all the files and they are in the right folder.
I also follow your instructions to install the mod correctly (first UE4SS, then real weather).

Do I need to do a little more when installing UE4SS or install more files or programs?
Now I only have your files installed in the Binaries folder and other mods in the DLC folder (pak files).

Avatar of r2d2
r2d2 18 Jan 2025

Have the Same Problem!
But i Fixt it the following:

Open Train Sim World 5\WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\mods.txt

and add under "BPModLoaderMod : 1"

TSWWeatherMod : 1

also open Train Sim World 5\WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\mods.json

replace the whole Text with mine here:

[
{
"mod_name": "BPML_GenericFunctions",
"mod_enabled": true
},
{
"mod_name": "BPModLoaderMod",
"mod_enabled": true
},
{
"mod_name": "Keybinds",
"mod_enabled": true
},
{
"mod_name": "TSWWeatherMod",
"mod_enabled": true
}
]

Now it should be fixed and work

  • Nevermind, for me it works only once... -
Avatar of Bobble
Bobble 15 Jan 2025

I had the weather change to heavy fog and it was inside the cab . Great mod tho and looking forward to the next update !

Avatar of Hyperlord1337
Hyperlord1337 16 Jan 2025

Absolutely amazing and one of the most requested features IMHO!

Avatar of Bahnkaktus
Bahnkaktus 17 Jan 2025

Despite all the UE4SS files in the folders, the option to select real weather is still not displayed (TSW 5 Steam version).
What am I doing wrong?

Avatar of ClutchFred
ClutchFred 17 Jan 2025

Please take a look at this video: https://www.youtube.com/watch?v=cYHtfsqmYic and verify if your installation aligns with the one demonstrated in the video.

Avatar of r2d2
r2d2 18 Jan 2025

It seems that UE4SS doesn't do his Job!
Have file alignd properly

Avatar of airfrance
airfrance 17 Jan 2025

Love the mod! Works great. I will say though it automatically loads in rain/snow every single time, regardless of the weather conditions (even if its clear skies and sunny) and it won't go away. GodMode will allow you to get rid of the rain but I imagine it's going to add it back every single time it refreshes with a new update every 15 min.

Avatar of Luex
Luex 18 Jan 2025

On which route is the problem? It works perfectly for me, but i tested only german routes and the la route.

Avatar of airfrance
airfrance 18 Jan 2025

Both LA Metrolink routes the weather loads in and it always starts raining. And every single time it updates the weather, the rain returns and I have to turn it off again via GodMode.

Avatar of Luex
Luex 18 Jan 2025

At the moment it seems that some people have this problem, but others do not. I don't know what the reason is at the moment.

Do you have a US IP address? Maybe the api for us american ip addresses shows inch instead of mm for rain. I'll have to check that with a vpn.

Edit: I have just used a VPN. Even with a us American IP I have no rain in LA currently.

Avatar of Luex
Luex 18 Jan 2025

Could you please try again? Wait until it starts raining, then exit the game. After that, send me the WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\UE4SS.log file on Discord (@nilsdev1).

Avatar of airfrance
airfrance 18 Jan 2025

Sure, give me some time to do this and I will send you the log on Discord later.

For what it’s worth, I am US based.

Avatar of Luex
Luex 18 Jan 2025

thank you very much, then I hope that I get this error fixed soon

Avatar of r2d2
r2d2 18 Jan 2025

For everyone who had this wierd Problem, that all Files are on Correct Place but the Mod don't appear in Menu, try this:

Have the Same Problem!
But i Fixt it the following:

Open Train Sim World 5\WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\mods.txt

and add under "BPModLoaderMod : 1"

TSWWeatherMod : 1

also open Train Sim World 5\WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods\mods.json

replace the whole Text with mine here:

[
{
"mod_name": "BPML_GenericFunctions",
"mod_enabled": true
},
{
"mod_name": "BPModLoaderMod",
"mod_enabled": true
},
{
"mod_name": "Keybinds",
"mod_enabled": true
},
{
"mod_name": "TSWWeatherMod",
"mod_enabled": true
}
]

Now it should be fixed and work

Avatar of Luex
Luex 18 Jan 2025

Thank you for your help. I wonder what the problem is, the .zip file contains an enabled.txt file for the mod activation. I'll add this to the description of the mod. Thanks a lot!

Avatar of r2d2
r2d2 18 Jan 2025
  • Nevermind, for me it works only once... -
    Shhh....
    It seems, that UE4SS does have a Problem...
Avatar of r2d2
r2d2 18 Jan 2025

Tried to start TSW5 as an Administrator.... It showed the Firewall-Promt, but doen't help...

Avatar of Luex
Luex 18 Jan 2025

yes

Avatar of Bahnkaktus
Bahnkaktus 18 Jan 2025

Thanks for the help! Now the live weather works perfectly.
But everytime I start a journey there will be a crash dump written in UE4SS folder. @Luex, I've contacted you on Discord.

Avatar of JetWash
JetWash 18 Jan 2025

This is brilliant, well done!

Avatar of Luex
Luex 18 Jan 2025

Thank you for your feedback

Avatar of oliverpope03
oliverpope03 18 Jan 2025

This is an amazing mod, I am getting a fatal error for UE4SS when leaving a service back to main menu, I have .DMP file for it if needed, Edit: Occurs every time returning to menu, otherwise works well during the run

Avatar of Luex
Luex 18 Jan 2025

Thank you for you feedback, please send me the .dmp file on discord.

Avatar of Bahnkaktus
Bahnkaktus 18 Jan 2025

I have the same problem. After every journey there is a dump message.

Avatar of oliverpope03
oliverpope03 18 Jan 2025

Will do :D

Avatar of rmccon.
rmccon. 18 Jan 2025

Yes. the v2 update has fixed the continual rain issue for me but, like most people, I get a dump message after every session (and very occasionally on loading a session).

Avatar of heinz
heinz 19 Jan 2025

ja toller mod :) aber auch dumpmeldung und irgendwie sehe ich keine wolken mehr....vor dem update war das nicht so aber ich denke, du kriegst das schon hin.heute ist sonntag und da hast du ja bestimmt zeit ;) grĂĽsse

Avatar of Liam
Liam 20 Jan 2025

Are you open to posting a git(hub) link? Would love to check it out or contribute.

Avatar of Liam
Liam 20 Jan 2025

On a sidenote, I'm running the game on Linux through Proton and this mod seems to cause a fatal error in UE4.

Crash report can be found here
https://limewire.com/d/e29a9683-bdb3-4fb7-ad40-ba04abf41c0b#bGf8heGt6buzZbSyKMUR0j4BHpVZ7ZcL45kFnxzdp6s

Avatar of Liam
Liam 20 Jan 2025

Looks like it might be a null ptr violation or something similar, can't get more info without the symbols I don't think

Avatar of Luex
Luex 21 Jan 2025

I also play on Proton, the issue exists for both windows and linux

Avatar of Liam
Liam 21 Jan 2025

Hm that's odd. My game crashes at startup though - consistently. Don't even get to the main menu. It does not look to be an issue with UE4SS itself since it loads without the TSWeatherMod (and I also tried the latest dev mode of UE4SS from the main repo)

Avatar of rj1
rj1 20 Jan 2025

Firstly thanks for a very interesting mod which I fully support. Could you look at stability issues though please? The problem with light rain on startup appears to have disappeared with the latest update. However the program nearly always crashes on exit (not that important) but occasioanally on start up (obviously more of a problem) . I couldn't get Blackpool branches to run with it engaged. However, Cathcart Circle worked great and was thoroughly engaging. I hope that these are teethinhg issues which can be resolved becauser the whole weather experience is much more convincing with the mod.

Avatar of Luex
Luex 21 Jan 2025

Thank you for your feedback, i am currently working on an update

Avatar of JetWash
JetWash 23 Jan 2025

Hey there

I was wondering if it might be possible for night driving to set a very small amount of fog (equivalent to 0.001 or 0.002 within GodMode) as default? There is almost always some degree of atmosphere visible at night in the real world and without a fractional fog setting TSW does a terrible job of simulating that
Just a thought :-)

Avatar of rj1
rj1 24 Jan 2025

I just tried a run on WCML over shap at 18.30 (January) and it was still showing as sunny and bright wheereas in reality it would be dark.

Avatar of justin17474
justin17474 24 Jan 2025

auf xbox gamepass wenn man ein szenario gespielt hat und wieder ins menü geht crasht das spiel kann man das bitte noch beheben ansonsten sehr schöne mod mach mir sehr viel spaß dankeschön

Avatar of airfrance
airfrance 24 Jan 2025

I wanted to add a note to confirm something I saw up above. The latest update does fix the rain issue however now everytime I exit to the main menu, I almost always get a crash to desktop with a dump file. Occasionally it will happen when using formation designer as well.

Avatar of JetWash
JetWash 25 Jan 2025

This UE4SS seems to be incredibly unstable and is causing regular crashes. We were all finding the same problem with the auto announcer mod which also uses UE4SS. Are the crash logs any use to you?

Avatar of airfrance
airfrance 26 Jan 2025

Yes, I can’t even exit to the main menu without TSW5 immediately crashing. Happens every single time now. I’m going to have to remove this mod until I fix is implemented.

Avatar of Ivy
Ivy 30 Jan 2025

This is great, just one thing I'd suggest, might be doable might not be... I'd suggest making it so rather than the weather changing instantly it could slowly adjust the sliders so it looks more natural, since your polling rate is /15 mins you could make it so that the sliders slowly move to their new values over 7.5 minutes so its not too long and not too short.

If this is something that could be done I think it would really improve the immersion, either way this mod is great!

Avatar of BecksTrains
BecksTrains 1 Feb 2025

Love it and with the help of Profile picture of r2d2 r2d2 it does seem to work. Thanks.
But I do get a fatal error warning, which, when ignored isn't a problem but if I click on OK, the game crashes...

Avatar of rolby67
rolby67 12 Feb 2025

Hi, thanks for this brilliant utility.
Unfortunately my TSW5 crash at each try after the 60 secs in a free scenario.
Any tips?

Avatar of Hyperlord1337
Hyperlord1337 17 Feb 2025

After the most recent game update the mod seems to be not working anymore (can't set Real/Historical from the selection) :-\

Avatar of Tony
Tony 17 Feb 2025

Live weather isn't showing in tsw 5 weather menu. Just the Dynamic and Custom. in the log txt I noticed these 2 lines:
[2025-02-17 21:22:54.6180795] [PS] Failed to find EngineVersion: expected at least one value
[2025-02-17 21:22:54.6180952] [PS] You need to override the engine version in 'UE4SS-settings.ini'.
I have no idea what this means. Could this be causing live weather and historical weather not to show or is it sayingh that because i was in the on foot mode. if so, what can I do to fix this?
I wanted to paste my log and Ini but i could not do so.

Regards

Avatar of rmccon.
rmccon. 18 Feb 2025

Yes, same here after the TSW update. No option for the real and historical weather selections. I tried reinstalling and redownloading to no avail.

Avatar of mwhp
mwhp 12 Mar 2025

Even after extra editing mods.txt and json files still not showing. One more thing it will be good if you work with author of auto announcer mod.

Avatar of Train Sim Society
Train Sim Society 15 Mar 2025

Fantastic mod! I got it working with UE4SS from the Auto Announcement mod.
One suggestion to enhance immersion—consider making weather transitions more gradual (perhaps a 1-2 minute period of slow transition between weather updates). The sudden shifts in weather can be a bit jarring. Other than that, this is absolutely perfect!

Avatar of Zappaman
Zappaman 18 Mar 2025

This great mod stopped working a couple of TSW5 updates back, then seemed to work again recently after the last but one TSW5 update, but now appears to not work yet again after the last TSW5 update, for me anyway.

Avatar of Joers182
Joers182 19 Mar 2025

I hope it gets fixed soon. I have the same problem. Was working fine until a few updates ago.

Avatar of Zappaman
Zappaman 22 Mar 2025

Seems to be working again today 22nd March

Avatar of rmccon.
rmccon. 21 days ago

Still not working anymore for me. Just curious if there's a fix being worked on or if the project is dead?

Avatar of Luex
Luex 4 days ago

I've had a little less time in the last few weeks. Now that this has improved again, I'll take a look at the problems since the last game update.

Avatar of george_the_protogen

Not working for me either sadly

Avatar of Luex
Luex 4 days ago

I've had a little less time in the last few weeks. Now that this has improved again, I'll take a look at the problems since the last game update.

Add a comment

If you wish to leave a comment, please log in .

About this mod

Created
11 Jan 2025
Updated
19 Jan 2025
Game
Train Sim World
Type of content
Other
Train Sim World compatibility
Train Sim World 5