Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42

Thread: OpenWeather [Testing]: A proposal to fix weather issues

  1. #21
    GT5 Pilot mr_belowski's Avatar
    Join Date
    May 2015
    Posts
    1,470
    Platform
    PC
    i don't think there's a way to make it work on consoles
    Crew Chief details here http://forum.projectcarsgame.com/sho...r-for-PC-users
    Website, download link and forum: http://thecrewchief.org
    Or make a donation, if you think the chief needs to drink more beer:
    https://www.paypal.com/cgi-bin/websc...=LW33XFXP4DPZE

  2. #22
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    This sort of thing is right up my alley! I wish I had a PC version of this game because I believe that I could help out.
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)

  3. #23
    Superkart Pilot
    Join Date
    May 2015
    Posts
    188
    Platform
    PS4
    What a fantastic idea mate!!! Cheers and hope it can be implemented, also in consoles.
    T300 Alcantara + F1 Addon

  4. #24
    Superkart Pilot
    Join Date
    Jun 2015
    Posts
    339
    Platform
    PC
    It's amazing that you guys are working on this. It'll be so cool if you get it to work. But I have a few concerns.

    1 - what is the effective difference between this program, and the Custom Random Weather Automator tool? http://forum.projectcarsgame.com/sho...Automator-quot

    Is it that the weather generated would be based in real life? With this current app, just knowing the % chance of rain would be enough to give you a pretty accurate presentation of the current weather since the game automatically takes the date and makes temperatures that match that time of year based on the season.

    2 - A big problem with Real Weather was the 1-hour interval per weather slot. You'd have to race for 2 hours to see a change in weather. How is this being handled? Will there be a random number of slots? Random length for the weather slots (weather progression acceleration)? Different lengths for each weather slot?

    3 - A current problem with the Custom Random Weather Automator is that he lobby owner would know what the weather would be, and no one else would. He/she would have to look away to make sure to not cheat, or in single-player, not spoil the surprise. Is this also being taken into account?

    Wondering if you guys are taking these questions into consideration.
    Last edited by Javaniceday; 09-10-2018 at 19:29.

  5. #25
    GT5 Pilot mr_belowski's Avatar
    Join Date
    May 2015
    Posts
    1,470
    Platform
    PC
    Still at the stage of 'getting something working'.

    I now have a service that successfully proxies to the real weather API, which allows you to use your own API key in place of the (expired / blocked) pCars2 API key. So it should work as a fix for real-weather always being clear / sunny.

    It also generates its own weather, based on some inputs and randomisation which aren't finished yet. The weather it generates looks kind of OK but it doesn't (yet) work and I'm still trying to track down what's wrong with it and whether it's the game (which is doing some internal caching of its own) or my responses. I need a rainy day to test it really

    [edit]

    the git repo is here:
    https://github.com/mrbelowski/PCars2OpenweatherServer


    it's a Spring Boot app. Most of the code is just me trying to get the generated responses to look as close to the real responses as possible

    [edit 2]

    how it actually works is that there's an entry in the hosts file - C:\Windows\System32\drivers\etc\hosts:

    127.0.0.1 api.openweathermap.org

    this sends all traffic for api.openweathermap.org to the loop-back address (the spring boot app).

    The spring boot app either creates its own weather responses or forwards the request on to the real server. Of course, it can't forward to api.openweathermap.org (that ends up back to the service) so the app has to use an IP address got from an nslookup of the dns name.
    Last edited by mr_belowski; 09-10-2018 at 20:19.
    Crew Chief details here http://forum.projectcarsgame.com/sho...r-for-PC-users
    Website, download link and forum: http://thecrewchief.org
    Or make a donation, if you think the chief needs to drink more beer:
    https://www.paypal.com/cgi-bin/websc...=LW33XFXP4DPZE
    The following 3 users likes this Post: Asturbo, JasonSandwich, ProDriver


  6. #26
    WMD Member Asturbo's Avatar
    Join Date
    Jun 2012
    Location
    Asturias / Spain
    Posts
    755
    Platform
    PC
    Quote Originally Posted by mr_belowski View Post
    I now have a service that successfully proxies to the real weather API, which allows you to use your own API key in place of the (expired / blocked) pCars2 API key. So it should work as a fix for real-weather always being clear / sunny.
    Awesome !!

    Quote Originally Posted by mr_belowski View Post
    It also generates its own weather, based on some inputs and randomisation which aren't finished yet. The weather it generates looks kind of OK but it doesn't (yet) work and I'm still trying to track down what's wrong with it and whether it's the game (which is doing some internal caching of its own) or my responses. I need a rainy day to test it really
    Be patient and take your time. We are used to wait.

    Quote Originally Posted by mr_belowski View Post
    I'll have a look this weekend (no time till then)

    Quote Originally Posted by mr_belowski View Post
    The spring boot app either creates its own weather responses or forwards the request on to the real server. Of course, it can't forward to api.openweathermap.org (that ends up back to the service) so the app has to use an IP address got from an nslookup of the dns name.
    For testing the relay you can use one of the public IPs from DNS of openweathermaps. I've seen that always are running, even when the DNS points to another one. Probably all are mirrors.
    These are some I've seen last weeks:

    162.243.53.59
    192.241.169.168
    Last edited by Asturbo; 09-10-2018 at 21:24.
    CPU: Intel i7-8700K | GPU: nVidia GTX 1080 | RAM: Gskill 2x8GB DDR4 3200 | MB: Asus ROG Strix Z370 | SSD: Samsung 951 PCI 250GB | Monitor: Asus VG248 144Hz | Wheel: Fanatec CSL | SO: Windows 10 Pro 64bits
    WMD1 & WMD2 Gold Member /// Steam Profile /// Unofficial Issue List /// Button Box Label Template /// DS Flags Calculator
    The following user likes this Post: JasonSandwich


  7. #27
    WMD Member Asturbo's Avatar
    Join Date
    Jun 2012
    Location
    Asturias / Spain
    Posts
    755
    Platform
    PC
    Quote Originally Posted by mr_belowski View Post
    I need a rainy day to test it really
    Check the output with this place in Iceland. Rain for the next days:

    http://api.openweathermap.org/data/2...c4c417ab3b9920

    Coord: [63.4427, -20.2734]
    Last edited by Asturbo; 09-10-2018 at 21:20.
    CPU: Intel i7-8700K | GPU: nVidia GTX 1080 | RAM: Gskill 2x8GB DDR4 3200 | MB: Asus ROG Strix Z370 | SSD: Samsung 951 PCI 250GB | Monitor: Asus VG248 144Hz | Wheel: Fanatec CSL | SO: Windows 10 Pro 64bits
    WMD1 & WMD2 Gold Member /// Steam Profile /// Unofficial Issue List /// Button Box Label Template /// DS Flags Calculator

  8. #28
    GT5 Pilot mr_belowski's Avatar
    Join Date
    May 2015
    Posts
    1,470
    Platform
    PC
    Thanks, that'll help verify the rain responses. It's hard to know which bits of the payload are actually needed, and whether it's parsed as an XML document or is just scraped - assuming it's the latter, I still need to sort out verbose end tags and element / attribute ordering. Simple stuff but fiddly
    Crew Chief details here http://forum.projectcarsgame.com/sho...r-for-PC-users
    Website, download link and forum: http://thecrewchief.org
    Or make a donation, if you think the chief needs to drink more beer:
    https://www.paypal.com/cgi-bin/websc...=LW33XFXP4DPZE

  9. #29
    GT5 Pilot mr_belowski's Avatar
    Join Date
    May 2015
    Posts
    1,470
    Platform
    PC
    OK, I've massaged the XML so it's a close as I can get it to the 'real' data without having to capture a bunch of location-specific information like city names, but the generated weather is not working and I'm not sure what the likely culprit is. Proxying to the real service with a working AppID does (I think) work, so it's some progress.

    This works:
    Code:
    current conditions:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <current>
        <city id="2653591" name="Castle Donington">
            <coord lon="-1.38" lat="52.83"></coord>
            <country>GB</country>
            <sun rise="2018-10-10T06:23:02" set="2018-10-10T17:20:51"></sun>
        </city>
        <temperature value="286.53" min="286.15" max="287.15" unit="kelvin"></temperature>
        <humidity value="87" unit="%"></humidity>
        <pressure unit="hPa" value="1014.0"></pressure>
        <wind>
            <speed value="3.1" name="Light breeze"></speed>
            <gusts></gusts>
            <direction value="110.0" code="ESE" name="East-southeast"></direction>
        </wind>
        <clouds value="12" name="few clouds"></clouds>
        <visibility value="8000"></visibility>
        <precipitation mode="no" unit="3h" value="0.0"></precipitation>
        <weather number="721" value="haze" icon="50d"></weather>
        <lastupdate value="2018-10-10T09:20:00"></lastupdate>
    </current>
    
    forecast:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <weatherdata>
        <location>
            <name>Castle Donington</name>
            <type></type>
            <country>GB</country>
            <timezone></timezone>
            <location altitude="0.0" latitude="52.8429" longitude="-1.3419" geobase="geonames" geobaseid="2653591"></location>
        </location>
        <credit></credit>
        <meta>
            <lastupdate></lastupdate>
            <calctime>0.223</calctime>
            <nextupdate></nextupdate>
        </meta>
        <sun rise="2018-10-10T06:22:54" set="2018-10-10T17:20:41"></sun>
        <forecast>
            <time from="2018-10-10T09:00:00" to="2018-10-10T12:00:00">
                <symbol name="clear sky" number="800" var="01d"></symbol>
                <precipitation unit="3h" value="0.0"></precipitation>
                <windDirection deg="129.505" code="SE" name="SouthEast"></windDirection>
                <windSpeed mps="5.76" name="Moderate breeze"></windSpeed>
                <temperature unit="kelvin" value="292.47" min="292.47" max="292.811"></temperature>
                <pressure value="1015.01" unit="hPa"></pressure>
                <humidity value="74" unit="%"></humidity>
                <clouds value="clear sky" all="0" unit="%"></clouds>
            </time>
    ....

    but this doesn't:
    Code:
    current conditions:
    <?xml version="1.0" encoding="UTF-8"?>
    <current>
        <city id="0" name="">
            <coord lon="-1.38" lat="52.83"></coord>
            <country></country>
            <sun rise="2018-10-10T06:08:34" set="2018-10-10T20:08:34"></sun>
        </city>
        <temperature value="288.03302" min="288.03302" max="288.03302" unit="kelvin"></temperature>
        <humidity value="26" unit="%"></humidity>
        <pressure unit="hPa" value="990.60767"></pressure>
        <wind>
            <speed value="20.528172" name="gentle breeze"></speed>
            <gusts></gusts>
            <direction value="302.0" code="E" name="East"></direction>
        </wind>
        <clouds value="26" name="broken clouds"></clouds>
        <visibility value="7603"></visibility>
        <precipitation mode="rain" unit="3h" value="2.0"></precipitation>
        <weather number="800" value="heavy intensity rain" icon="01n"></weather>
        <lastupdate value="2018-10-10T10:08:34"></lastupdate>
    </current>
    
    forecast:
    <?xml version="1.0" encoding="UTF-8"?>
    <weatherdata>
        <location>
            <name></name>
            <type></type>
            <country></country>
            <timezone></timezone>
            <location altitude="0.0" latitude="52.83" longitude="-1.38" geobase="geonames" geobaseid=""></location>
        </location>
        <credit></credit>
        <meta>
            <lastupdate></lastupdate>
            <calctime>0.01</calctime>
            <nextupdate></nextupdate>
        </meta>
        <sun rise="2018-10-10T06:08:34" set="2018-10-10T20:08:34"></sun>
        <forecast>
            <time from="2018-10-10T13:18:34" to="2018-10-10T16:18:34">
                <symbol name="light rain" number="500" var="10n"></symbol>
                <precipitation unit="3h" value="0.0" type="no"></precipitation>
                <windDirection deg="302.0" code="NNE" name="North-northeast"></windDirection>
                <windSpeed mps="20.518131" name="gentle Breeze"></windSpeed>
                <temperature unit="kelvin" value="288.02045" min="288.02045" max="288.02045"></temperature>
                <pressure value="990.2873" unit="hPa"></pressure>
                <humidity value="14" unit="%"></humidity>
                <clouds value="few clouds" all="27" unit="%"></clouds>
            </time>
    ....

    The headers are the same, so I'm wondering if the game is checking the location information. Unless there's something else I've missed?

    [edit] i also aligned the forecast timings so they're on the hour, every 3 hours. No change.

    So it's either condition name / codes / weather symbols that I need to implement (lots of lookups and faffing) or proper location information (lots more lookups and faffing). Grrr.
    Last edited by mr_belowski; 10-10-2018 at 10:33.
    Crew Chief details here http://forum.projectcarsgame.com/sho...r-for-PC-users
    Website, download link and forum: http://thecrewchief.org
    Or make a donation, if you think the chief needs to drink more beer:
    https://www.paypal.com/cgi-bin/websc...=LW33XFXP4DPZE
    The following user likes this Post: Asturbo


  10. #30
    WMD Member Asturbo's Avatar
    Join Date
    Jun 2012
    Location
    Asturias / Spain
    Posts
    755
    Platform
    PC
    There're some differences but probably doesn't affect:

    <name>Castle Donington</name>
    <country>GB</country>
    geobaseid=""


    Other one is the forecast pattern. If you see how is generated, the slots are fixed with 3 hours time: 0:00 to 3:00, 3:00 to 6:00, 6:00 to 9:00...

    Probably you need the next fixed cicle to the current time. In your example:

    <forecast>
    <time from="2018-10-10T15:00:00" to="2018-10-10T18:00:00">


    In this post is a theory of how weather slots are filled using weathermap info.
    Last edited by Asturbo; 10-10-2018 at 11:05.
    CPU: Intel i7-8700K | GPU: nVidia GTX 1080 | RAM: Gskill 2x8GB DDR4 3200 | MB: Asus ROG Strix Z370 | SSD: Samsung 951 PCI 250GB | Monitor: Asus VG248 144Hz | Wheel: Fanatec CSL | SO: Windows 10 Pro 64bits
    WMD1 & WMD2 Gold Member /// Steam Profile /// Unofficial Issue List /// Button Box Label Template /// DS Flags Calculator

Similar Threads

  1. Change request on weather system when you use random slots
    By Scott1904 in forum General Discussion
    Replies: 1
    Last Post: 28-12-2017, 16:21
  2. Request: Random seasonal weather
    By ZulfoDK in forum General Discussion
    Replies: 4
    Last Post: 27-09-2017, 12:35
  3. Request: Weather API
    By palm3r in forum Third-Party Apps & API Discussion
    Replies: 1
    Last Post: 23-09-2017, 23:30
  4. Replies: 32
    Last Post: 19-07-2017, 14:38
  5. Weather Settings change request
    By Scott1904 in forum Multiplayer
    Replies: 0
    Last Post: 16-12-2015, 10:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •