Scripted weather races

Discussion in 'Technical & Support' started by Andy Bonar, Feb 13, 2021.

  1. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    I have read that the warmup session is a time scaled version of the race settings, so the weather you setup for the race is also used in the warm up, but time scaled.

    In my case, practice starts dry, with a rain session at 25%, with dry weather till the end. This gives a big wide dry line on track at the start of qualifying, as I set each session real road to be progressive on the server. This then, you would expect to give a dry race start, and I have a rain session during the race, again, drying to the race end.

    However, when you start the race, after completing the warm up session (not skipping it) the track is wet again, when it should be dry.

    I have tried using a real road session in race to be pre-rubbered, rather than progressive, but this seems to stop the drying line developing....

    So, my question is, is the only way around this to completely skip the warm-up session on the server? I know it works as I have tested it, but dont really want to do that. Everyone likes a quick break during a league event before the race starts.

    I cant see much info about people using wet weather inrf2, so maybe it jsut doesnt work properly.
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    I think you kind of answered your own question, unless I read it wrong.

    You have a rain period during the race, so that means if you run warm-up you'll have a rain period there as well, which will wet the track.

    Your options are:
    • skip warmup completely
    • set a very long warmup and only use part of it (won't avoid the problem with all weather patterns)
    • use a plugin to set the weather live, overriding the script, during warmup.
    The plugin option should be quite easy for a single mode (like, always dry), and I imagine could monitor the weather in the final minute(s) before warmup and replicate those conditions.

    I can have a go at doing a plugin if you'd like - no guarantees I can make it work properly, sometimes the game doesn't cooperate as you'd expect...
     
    Xzanman and Andy Bonar like this.
  3. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    Thanks Lazza
    Yes, i think youve read it right.

    I think the best option for now is to drop the warm up session...from memory, I can change the pause between sessions to a bit longer to give people a couple of minutes between the two.

    Appreciate your offer of a plugin, thats really good of you. To be honest, its for the last race of our season (we usually try to incorporate a bit of weather or timescale to the last race at its a bit longer at 60 minutes) but the race is next weekend, and we might not even use it again until the next league, so dont want you to go to the trouble.

    Cant S397 look at this though, its a bit of a problem, isnt it? Even if had the option to set the warm up weather in the server GUI, that would resolve it.
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    For a long time I've wished for better weather support (I know there's a couple of plugins that do weather, but from an implementation point of view there are definitely some holes). This also ties into better 'weekend structure' support, something we've never got.
     
    Xzanman and mesfigas like this.
  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    I'll consider there to be no pressure, but I've just found that the reason my idea of a plugin sounded sort of familiar is that I did exactly that back in 2014 :p

    I had a whole server controller running back then though, and it would dictate the weather and feed this plugin a new weather file for each update period, whereas you can make do with just a single weather condition to be applied to warmup. I need to update this plugin to work with my current toolset, if I think it makes sense I'll do a few quick tests and hand it to you; if not, I won't, and no damage done.
     
    Seven Smiles and Andy Bonar like this.
  6. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    Sure, I got the dates wrong too....the "weather" race is actually the 28th Feb, so I do have a bit more time to test it out.

    I'll put the session settings we are running below, with the warmup session pretty much dry after qually.


    Session start time 730am
    upload_2021-2-15_11-25-50.png


    Session start time 4pm
    upload_2021-2-15_11-26-18.png

    Session start time 6.30am (60 minute race night to day normal time progression)
    upload_2021-2-15_11-31-43.png
     
  7. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I’m glad I’m not the only one who’s done that, I have got as far as writing and debugging programs with a nagging feeling "this is familiar" before eventually stumbling over the one I wrote before o_O
     
    Lazza and Andy Bonar like this.
  8. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    @Andy Bonar here's a plugin to set static warmup weather, hope you're running 64 bit because that's all I've done :D

    So just chuck this in Bin64\Plugins, when you start the server it should create a new .ini file in the server player folder (whichever folder/profile you use, it should find it) where you can set the weather (rain, cloud, temperature). This is very un-fancy, so it's just the 1 weather condition and that gets applied for the whole warmup session. That .ini file is read at the start of each warmup session, so you can change it 'sort of live' if you want.

    It doesn't do anything (basically) outside of warmup, and should have zero impact on stability/performance. It does log to a text file in the rF2 root folder each second (or each time the game asks for a weather update), again only during warmup, just confirming what it's setting for the rain.

    If you can do a quick test to confirm it works, I don't have a server set up at the moment so only tested in single player, but should work the same.

    It uses the same runtimes as the game so shouldn't need to do anything special for it to run.

    Cheers!
     

    Attached Files:

    atomed, Corti and Andy Bonar like this.
  9. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    Great, thanks for that. I'll drop it on the server in a minute, and try it out at some point this morning..i'll let you know how it goes
     
  10. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    Thanks Lazza, really appreciate this, it works a treat.
    Not a big issue, because its only warm-up/break time but the temperature only changes the air temp not the track temp. Im guessing thats another rf2 thing :)

    Thanks again for this.
     
  11. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    Sure is :D
     
    Andy Bonar likes this.
  12. Checo Rivera

    Checo Rivera Registered

    Joined:
    Jan 19, 2021
    Messages:
    11
    Likes Received:
    1
    you only need to put the race session on the green
     
  13. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    Does setting up weather in the *.wet files still work? I wrote a python script a couple of years ago that would use Openweathermap to get the current weather at a track location's lat/lon and write it into the wet file. I haven't checked it recently to see if it still works, though.
     
  14. Andy Bonar

    Andy Bonar Registered

    Joined:
    Mar 17, 2011
    Messages:
    639
    Likes Received:
    93
    This is the only way I could get it to work, by manually editing the wet file after it was created.
    A complete PITA , it should be a lot easier to do than this.
     

Share This Page