[REL] Timed server control (race session every x hours like iRacing)

Discussion in 'Other' started by cubbi, Jun 24, 2014.

  1. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    New major update here with new features:

    - Automatic reverse-grid & auto-clear DQ penalty upon auto-restart with the new "Quick Race with Reverse Grid" mode!
    This is the dream mode for any pickup race server that want some none-stop quick & dynamic races. To correctly setup Server for this mode, please see "Help" page for detailed instruction (must disable Practice & Qualify session, then make sure Warmup session is enabled with enough time, and set Restart interval just long enough to cover both warmup and race session before auto-restart).

    - Added "Help" button, which opens a detailed page to guide user.

    - Replaced Restart timer with new & better code, which also eliminated a countdown bug that existed in old code. Restart interval can now be set to a max of 1000 hour/min/sec, which is long enough for something like weekly race rotation.

    - Added "Practice Session Only" activation countdown timer to Status section when selected. "Practice Session Only" is now auto-disabled if "Quick Race with Reverse Grid" is also selected.

    - In order to make auto reverse-grid work, It is now required to place this program in rFactor2 Root Folder and run from there. A notify message will show up and stop the program if it runs from other folder.

    - Rearranged various GUI elements and cleaned up codes.

    - Added "Skip Race if less than two players" option for all restart mode, useful for avoiding unnecessary one player race. It also bypasses "Auto-skip Warmup" timer at the same time.

    - Added "Auto-skip Warmup" option for "Quick Race with Reverse Grid" Mode. Useful when combined with "Skip Race" option, or if you want a much longer Warmup session when the restart system is not running.

    upload_2021-8-26_18-7-59.png
     
    Last edited: Aug 26, 2021
  2. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    Just updated version 20210826C with a few more features, updated new file in above post.

    - Added "Skip Race if less than two players" option for all restart mode, useful for avoiding unnecessary one player race. It also bypasses "Auto-skip Warmup" timer at the same time.

    - Added "Auto-skip Warmup" option for "Quick Race with Reverse Grid" Mode. Useful when combined with "Skip Race" option, or if you want a much longer Warmup session when the restart system is not running.
     
  3. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20210828B update:
    - Re-arranged and added many adjustable GUI elements.
    - Added "Restart Hour Range" option. When set to a specific hour range, scheduled restart will only take place during this hour range (default value "00"to"23" means restart will always in effect from 0 AM to 23 PM. And if you want only a single hour, just set both value to the same hour, such as 14 to 14 PM). This is useful if you want Race only during specific hours.
    - Added "Ingame Countdown msg" checkbox. When checked, it will sent restart & race start countdown message to chat box. Restart countdown will begin when 60s left. Race start countdown will begin when 30s left for warmup.
    - Minimum players for skipping race is now configurable in "Skip Race" section (to a max of 10 players threshold).
    - Added "During none Restart Hours" checkbox to "Skip Race" section. When checked, any race session will be auto skipped if current time is outside "Restart Hour Range".
    - Updated help page.

    xx.png
     
    Last edited: Aug 30, 2021
    Badboy and Corti like this.
  4. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20210831A (quick fix):
    - Fixed a bug where skip race would not skip (due to mismatched text)
     
    Badboy and Corti like this.
  5. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    Here is another major update, many functions have been changed and new options added for better usability.

    version 20210901D:
    - Rewritten majority of restart code, now the whole restart process will check server status and proceed accordingly. No longer needs to disable any server side session such as practice or qualify. Just setup server as you normally would, and make sure there is a Warmup session (longer than "Time before Race"), and that's it.

    - Removed Start Date setting, and is replaced with new "Restart Schedule" settings. Just check the day of week that you want to run scheduled auto Restart Races.

    - Added ability to limit reverse grid for a certain amount top players.

    - Changed various wording, rearranged GUI element for better usability.

    upload_2021-9-1_19-9-59.png
     
    Last edited: Sep 1, 2021
    cybe, Badboy, Corti and 1 other person like this.
  6. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20210907A:
    - fixed a rare crash bug.
    - improve countdown notify message, now only shows notify during race hour.
    - removed old 1.31 version number from window title.
     
    Badboy likes this.
  7. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20210926A:
    - Now auto-send Race Length & Fuel reminder message before race begins.
    - Restored start date setting (for restarting at specific time), renamed to Scheduled First Restart.

    upload_2021-9-26_15-49-6.png
     
  8. Paulfield

    Paulfield Registered

    Joined:
    Feb 18, 2012
    Messages:
    235
    Likes Received:
    242
    Great tool Thanks
     
    svictor likes this.
  9. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20220106A:
    - Add an option to select 3 different race length type "Laps, Minutes, Percent" inside "Set Race Length" box (as requested by Paulfield).
    Note: it is still required to manually determine & set correct amount "Restart Interval" time, as well as enough "Delay After Race" time in Multiplayer.JSON.
    - Updated help entries.

    upload_2022-1-6_12-28-22.png
     
    Badboy, MileSeven, DJCruicky and 3 others like this.
  10. MileSeven

    MileSeven Registered

    Joined:
    Apr 1, 2014
    Messages:
    650
    Likes Received:
    244
    @svictor - thanks for this work - we’re hoping to try it out for our current championship series from this weekend… Really looks as if this could make my admin job easier for events I can’t participate in directly:)

    I had a look at the help pop-up and main dialogue last night - but I’m confused as to which fields are relevant in which situations…

    At its most basic, I want our server to run normally all week except for one key reset at a specific time/day. I don’t want to override the race length, reverse its grid etc. but I would like to use the in-game countdown timer (I’d love that to be configurable by the way - 60 secs isn’t much warning on some of our car/track combos…)

    So how do I set it for that scenario?
    - Set 1st restart time date for our main event (obviously)
    - Set day-of-week to match (to let it run normally otherwise)
    - Restart range 00-23H and message ticked
    - Restart mode Full Restart (we want to run from Practice)
    - Race length? Time before race? (It’s not clear to me when these matter)
    - Reverse grid (obviously not used unless Restart Mode is a reverse grid)
    - Anything else to consider?

    We would really appreciate it if you could guide us on this!:):):)


    We have a secondary potential need/use for your tool too - but one that might need further features…;)

    We run a weekly evening of quick-fire reverse-grid sprint races. For various technical and social reasons we don’t need/want this to be totally automated as sometimes we need variable length warmups between races (no Qualy or practice). What would help us would be a ‘manual immediate restart’ option/button (in warmup, obviously) that a) sets the reverse grid based on the last race log, b) starts a race countdown timer (configurable duration would be lovely here too;)), c) auto starts race session on conclusion of timer….

    Any chance of that:D

    Thanks once again!
     
    svictor and GertjanD like this.
  11. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    The primary purpose of this APP is to repeatedly restart "race" by a given "restart interval", and it bypasses RF2 original end race restart method (which RF2 original end race restart method involves loading track again after every race, which is really a pointless and time wasting process, and not good for admins to set race stuff such as grid order)

    This meanings restart commend will always take place when the amount time set in "restart interval" is reached to zero (unless other restart conditions were not meet, then restart will be ignored).

    It doesn't have advanced options to set multiple different "restart interval" for different time of day or week, etc. However it is always possible to run multiple instances of the APP to control a single server, and in each opened APP instance, set "restart interval" and different condition accordingly, in order to achieve complex purpose.

    The best way to understand how it works, is to do local test (following help instruction), just run a server with some AIs, and toy with different options to see what they do.

    As for the in-game countdown timer, you can manually edit source code (the .ahk file) at line 257, and install autohotkey to run script directly, which doesn't require to be complied as EXE.
    -----------------------
    Case 1:

    For example, if you want to run:
    - 10mins auto-quick-race (assume the average lap time is 1:45.xxx, then 10mins about 5.7laps, which equals to 6 laps, you need to factor this 6 laps time into "restart interval" time)
    - 5mins warmup(break time, you must enable warmup session in server, and warmup session time is longer than the "time before race"), the final "restart interval" time would be 6*105 + 5*60 + 30s + 60s = 17 minutes (30s=beginning session waiting time, 60s=pre-race countdown time, you may want to add a few more seconds or 1 min, in order to make sure player can finish race before next restart)
    - with top 8 reversed grid
    - only during 20:00PM to 23:00PM from Sunday to Friday
    - only restart race when at least 3 people in server (works best when setting warmup session at max duration 165mins, but will not be good for Case 2 below)
    - with countdown message

    Then setup as below:
    upload_2022-1-7_19-56-19.png

    Case 2:

    If you also want a special race at Saturday, just run an extra instance of the APP, assume the Saturday race will be:
    - 1.5 hour weekly-repeated championship race
    - 15mins qualify time(you will have set up this in server setting), 5mins warmup(you will have set up this in server setting as well, "time before race" setting has not effect for "Full restart" & "Skip Practice session", as describe in help)
    - Start at 21:00PM
    - with countdown message
    Note: You must set "Scheduled First Restart" to have accurate weekly rotation. Setting restart range to 20-23 is to ensure the 21:00 restart does not miss in case if there is a slight a few sec delay or ahead of time.

    upload_2022-1-7_20-10-17.png
    ------------------------

    All in all, this APP is meant to be used for simple & quick automated race control with limited options. It is possible to have complex controls through the use of multiple instances (with good planning). It still has its limit, but at least it does good auto quick races (which original RF2 lacks of), and that's all that matters.

    Hope helps.
     
    Last edited: Jan 7, 2022
    Corti and DJCruicky like this.
  12. MileSeven

    MileSeven Registered

    Joined:
    Apr 1, 2014
    Messages:
    650
    Likes Received:
    244
    Great, thanks for clarifying that. I think it’ll still help significantly with the main race.
     
  13. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20220120A:
    - Fixed hour range that does not trigger auto-restart, when the first selectable hour value is greater than the second. Now it will trigger auto-restart during the selected hour range, include the hour that is selected. If you want to have 24 hour auto-restart, just keep default 00-23 range.
    - Fixed countdown race length message, it now states race type correctly.
    - Extended race length reminder timer, now it will notify message 3 mins before race start.
    - Updated help entries.
     

    Attached Files:

    Corti likes this.
  14. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    925
    Likes Received:
    6,278
    version 20220123A:
    - Added support for "Auto-Execute Command" after a percentage of completed Race Length. As a feature requested in this post.
    Since it is impossible to determine precise percentage Race Length for "Lap" type race, a special formula is used for calculating "Race Length" for best result, which is: Race Length = Restart Interval - Time before Race. So it is vital to set correct amount Restart Interval & Time before Race (also don't forgot to take pre-race countdown timer & post race time into consideration).
    Note: anything you type in the box will be sent, regardless whether it is a command or not. Leave it blank if you don't want to send anything.
    - Re-arranged GUI elements.
    - Updated help entries.

    upload_2022-1-24_0-0-53.png
     

    Attached Files:

    Last edited: Jan 23, 2022
    DJCruicky and Corti like this.

Share This Page