NOTE: Initial Beta testing versión here
PRELUDE
As we all know, we have some problems with the weather configuration that affects specially to online communities:
- If we select Ramdom Weather we have rain and its variations in most of the times. Nice to show the game possibilities the first weeks, but not valid to communities. Link
- If we select Real Weather, we always get clear weather, because it has stopped working from 1 month ago. Link
So we only can use predefined slots for our races. That is a problem, because there is no surprise and everybody knows what will happen during the race, and the exact moment when the weather will change. With Project Cars 1, I was using a table with the lottery of the day of the race to choose the weather conditions, using different weights to the different scenarios. A little bizarre but it worked because all we know the weather few minutes before the race.
The prefered solution would be another type of weather called “random realistic” with more logical options of each scenario (clear 30%, cloud 30%, …light rain 10%, Rain 8%, Extreme 1%). But I don’t think at this stage of development, we could get this. So I was thinking in other possible solutions after studying how RW works in the game and why is probably failing. (See this link)
HOW IT WORKS RW
The host of the race (P2P or DS), connects to realweather API to obtain the next hours slots for the current time & location. The program (PC2), logs in the weather server, makes a query for the next hours forecast and receives the weather data, that are assigned by the game to the slots of the session. The problem ATM, is that we aren't receiving any data, so we always get clear weather. In previous link I commented the possible reason (the key id), but after undestanding how the system works, I'm now thinking in a more ambitious solution.
PROPOSED SOLUTION
We can redirect the query to another IP where we can build our own weather server . Obviously we don’t will have real weather (because we don't have the data), but we can obtain weather slots with a random & logical pattern with different weights to diferent scenarios. SMS (or a third party) could make a tiny web based APP installed in the local computer, that accepts the query and responds with random-logical weather data. We can use the method used by Zenzic with his wonderful utility [link] and we can personalize the weather weights, or exclude bizarre scenarios.
HOW REDIRECT THE QUERY
It’s very easy. We know the URL used to get real weather: api.openweathermap.org , and we can add it manually to the host file of our Windows to tell the system where is our weather server hosted (without using public DNS resolution). So we can redirect this URL to any other IP (public or private) or our own localhost IP, where the weather server app is hosted.
The windows host file (if exist, if not we can create it) is stored in the C:\Windows\System32\drivers\etc folder. If we add the line:
127.0.0.1 api.openweathermap.com
all the connections to this URL are redirected to the IP 127.0.0.1 (Localhost), where the API could be located providing random weather data.
![]()
THE HARD WORK
Someone (SMS or any Third Party) has to make a tiny web bassed APP that accepts the query, generates a random weather pattern and responds in the same format as opensimweather (Example). Obviously the weather data would be random (not real) because we don't have the data, but it would be a big step forward because we can get random-custom weather, that it's all we want (for me even better than RW). Thats allows us to simulate a full season in Christmas without driving at 5º.
ADVANTAGES
- We don’t need any API key, licences… only our own app.
- No connectivity or traffic overload issues.
- We solve in a row the "Too rainy random weather" and the "Real Weather not working" issues.
- This method is better that in-build ones (random and real) and we could have "ramdom custom".
- We can program the Weather Server API with different weights based in our preferences or logical patterns (using Zecnic or similar method)
- No need to touch the code of the game. Everything could be outside, so no redesign or hard code changes needed. That's the best part for SMS.
- It’s very easy to program (much more than doin in-game). The APP only needs to accept the query, generate the random weather pattern (Zecnic method) and responding in the same output format as openweather.org (example)
- It's transparent to the game. It gets the data from a diferent IP and applies to the weather slots ingame.
- The API port could be forwarded in our router, to have a public weather server hosted in our public IP.
- It will work online and offline and the querys probably goes much faster than with the real servers.
- It's reversible. The API could have a check that enables disables the redirection. So we can choose Real Weather (if it gets fixed) or random personalized weather using out local appp.
Hope SMS could have a think about this solution, because it’s easy, effective and solves most of the weather issues we have without touching any line of code of the game. We have to use the in-game RW option, but the result will be custom-random weather. It could be distributed as an Steam utility like the DS as "Custom Weather Generator" or as third part app.
I’ll contact by PM with Zecnic, to study the viability of this possible solution, because he has solved brilliantly the most of the hard work needed for this App.
[Sorry, I'm system engenieer, but not programmer and can't do the task]![]()