Automobilista 2 Auto Director for Broadcasts

Discussion in 'Automobilista 2 - General Discussion' started by RnageyRover, Jun 24, 2023.

  1. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Hi All,
    Linked is AMS2 Auto Director running in Python. Automobilista 2 Auto Director
    GitHub - RangeyRover/Automobilista-2-Auto-Director: An auto director for AMS2 in python using UDP or Shared memory
    There are limited keyboard commands available, Up, down, enter for drivers, u to change across to cameras, left right, enter for camera type. Thats it.
    Auto Director runs in Python monitoring AMS2 in UDP & Shared memory mode.
    In UDP mode it can give data in Spectator, Broadcast and Replay.
    In Shared memory it can give data in Replay and Director (untested)
    [​IMG]


    Auto Director has some basic rules.
    • Smallest gap is the most dominant
    • Race Position is considered and customisable
    • It also looks for Rate of change between cars
    To Install:
    • Run AMS2AutoDirector.exe
    To Operate:
    • Start AMS2
    • Run AMS2AutoDirector.exe
    • Be in Replay, Spectator or Broadcast mode
    • Select UDP or Shared memory.
    • Select UDP port if selected.
    • Enter Camera Dwell time.
    • Enter Race Position Bonus.
    • Start the race
    • Click driver 1 and leave the game in focus
    • Press Space
    • AMS2AutoDirector.exe will press the buttons for you.
    Enjoy Auto Director!

    RangeyRover
     
    Last edited: Aug 18, 2024
    • Like x 7
    • Winner x 5
    • Agree x 1
    • Useful x 1
    • Optimistic x 1
  2. hb22

    hb22 Member

    Joined:
    Jul 25, 2022
    Messages:
    71
    Likes Received:
    34
    Sounds very good! I wonder if it could be good to have the options to auto switch to any car that leaves the track or makes contact with track or cars?
     
  3. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    RaceRoom Auto director does that, but to be honest I don't like it as it never switches the camera in time for the incident.
     
    • Informative Informative x 1
  4. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Auto director version for replays, Need to have simhub set to UDP mode for this to work.
     
    • Friendly Friendly x 1
  5. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Also works in Spectate mode on live races, Simhub data isnt available until after the first lap, but after that it does good.
     
    • Like Like x 1
  6. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Simhub dash for the overlay. To use as a Director or spectator change AMS2 to UDP mode in simhub, and use the OBS browser overlay in the streaming software.
    Auto director is a python based script that opens chrome and presses up, down and enter on your system to change cameras.

    I've taken a different direction with this and discovered that simhub can get useful data in Replays, Spectator and Broadcasters modes when switched to UDP.
    This means that we cant use gary swallows excellent plugin however as it doesn't work in that mode.

    What we have now is an Auto director that works in race mode only (for now) for Replays, Spectator and Broadcasters.

    It's driven by the simhub overlay. The simhub overlay gets the data from the streamers AMS2 and we use the OBS browser option of simhub to get the overlays into the stream. I was helped with the GFX (as thats not my thing ) by @Scotty_g of CASS Thanks Mate

    The python script (it's really a script glued together as an .exe) reads invisible text from the overlay to determine which racer to show, and opens a chrome instance of the overlay, reads it, and presses up, down and enter on your system to change cameras.

    Auto Director is too big to upload here, you can grab it at Automobilista 2 Auto Director - Updates

    It targets the smallest gap to view.
    Example of use here:
     

    Attached Files:

    Last edited: Sep 18, 2023
  7. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Also, if this ever gets read by anyone at Reiza, please please give us an API or keyboard commands to change cameras without the overlay being on the screen.
    Please add a comment if you are looking for broadcast options for your leagues, let Reiza know we would love to help promote the game!
     
    • Agree Agree x 5
  8. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,420
    Likes Received:
    1,447
    we demanded that from SMS since 2015 when pC2 development started.
    A simple interface where you can send external commands for camera control and driver switching.
    Also here in the forum it was done several times
     
  9. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Ok, well I won't hold my breath waiting then. I hope if we can make a decent Auto Director, and show the potential, it might give a compelling reason for Reiza to take action, as it will result in more online promotion of the sim.
     
  10. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,420
    Likes Received:
    1,447
    the functionality is here ( Director + Broadcaster )
    All we need is the interface
     
  11. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    That's true.
    I'm also running the Auto Director in Spectator & Replays, as well as Director/Broadcaster
    It's hard to find a Director Broadcaster Pair. You don't need to if you run in spectator mode, in fact you can spectate and Auto Direct on any open Multiplayer race. I'd just like the interface to get out of the way and we have this whole problem cracked.
     
  12. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    This is the Auto Director working with the data available in Director mode.
     
    Last edited: Sep 22, 2023
    • Like Like x 1
  13. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68

    Auto director working with replays in UDP mode
     
    • Like Like x 2
  14. Canarindamix

    Canarindamix New Member AMS2 Club Member

    Joined:
    Jul 30, 2023
    Messages:
    18
    Likes Received:
    16
    Thanks for that, I gave it a try with a replay of an event we had this week, worked pretty well, but for some reason the dashboard seems to be missing all the nice parts :p It shows only text for some reason. I've tried to open it in edit mode in simhub, it looks the same, I mean I don't see any elements there that would produce the same look as you have in your videos. Is it possible you uploaded an unfinished version maybe?



    After a while the script was stuck on one car for some reason (if I remember well the driver crashed and rage quit the session :D) and wouldn't show anything else anymore.
     
  15. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Really happy to see someone using it!
    I've fixed the pit bugs today, I hope.
    Here's the latest, the png that is the background is definitely in the ressources file, I checked.
    you can see in this example I had the same bug, I hope ive fixed it.
     

    Attached Files:

    • Like Like x 1
  16. Canarindamix

    Canarindamix New Member AMS2 Club Member

    Joined:
    Jul 30, 2023
    Messages:
    18
    Likes Received:
    16
    Thanks! So I think the problem is that in the version you uploaded to racedepartment, the dashboard which is included is the v0.1, not this v0.2. I Imported this v0.2 and now it looks like on your video.
    If you post a version of the script with your (potential) fix for the pit I can try it with my replay to see if that works there too ;)

    Also, when the script asks for the number of cars, should I include the safety car?
     
  17. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Hi mate,
    The smarts are actually in the simhubdash not the python script, that just does as it's told by the dash. As long as you add more than the drivers you are good, the only thing that is used for is to find position 1 again, if it presses too many times it doesn't matter.
    I only made v0.2 today, and just made V0.3 for you with all the pits smarts in I hope.
    Off to bed in Oz, let me know how you go.
    Edit, and it does work with replay, for sure, if you are in UDP mode in simhub
     

    Attached Files:

    • Like Like x 1
  18. Canarindamix

    Canarindamix New Member AMS2 Club Member

    Joined:
    Jul 30, 2023
    Messages:
    18
    Likes Received:
    16
    Hi there, I gave it another try and this time there was no monkey business, it managed the whole race properly ;)
    Thanks a lot for the bug fixes!
     
    • Like Like x 1
  19. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    That's excellent news. I'm working on a new version that can accommodate Practice and Qualification.
     
  20. RnageyRover

    RnageyRover Member AMS2 Club Member

    Joined:
    Aug 8, 2022
    Messages:
    60
    Likes Received:
    68
    Looks like I still have some bug fixes to do looking at your replay, it occasionally doesn't get the correct driver, I'm assuming because the race position has changed, and then the GFX aren't on the correct driver, also, Battle for 0rd? I really need to fix that lol
     

Share This Page