[REL] rFactor 2 automated camera plugin

Discussion in 'Other' started by HorCsa, Jul 23, 2015.

  1. HorCsa

    HorCsa Registered

    Joined:
    Jun 13, 2015
    Messages:
    28
    Likes Received:
    10
    Hello,

    We are a small rFactor community (some Hungarian leagues), and we doing always stream our races (rFactor1) with dedicated stream PC. But sometimes everyone racing (no one who would manage the camera). So i created autocam plugin for rFactor on last year. It is not a simple circling between drivers. It compares the differences, prefers the better place etc... Not perfect, but maybe enought.

    We will be soon switch to rFactor 2 and i'm working on rFactor2 version now. I'm not a professional programmer, but I feel I succeed. Easier handling the camera in the new version of rFactor and many more features.

    download: https://github.com/h0rcs4/rF2AutoCamPlugin/releases/tag/last last updated: 2015.09.13.
    Source code: https://github.com/h0rcs4/rF2AutoCamPlugin
    First rF2 plugin broadcast test (online AI qualy and race):

    Some FAQ:

    The primary goal of the rF2Autocam plugin: Broadcast online LIVE event without (human) director, or when the (human) director in rest (some long race eg.: endurance). If you're driving, you need an another client. It's useless if you're driving, because the plugin will rotate the camera.
    Plugin tested: offline (start race and press AI control) and online in spectator mode.
    Replay mode: I don't know that the plugin is running on replay mode. Plugins not starting in rF1 replay mode. I have not checked this now, but I guess not changed in rF2. I think that this possible by an external program, which reads the result xml file (stream part). You must start replay in sync. But the camera control would be quite complicated. But that's another project and not for me (not now).
    The plugin doesn't work in replay mode.
    The HUD "TV Style": The "TV Style" in the sample video is not mine. I don't write HUD, because GR TV plugin are perfect. Thanks for Gerald Jacobson. You find that here: http://isiforums.net/f/showthread.php/19806-Tv-Plugin
     
    Last edited: Nov 17, 2022
    DA likes this.
  2. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Very cool.. I'm curious though, did you make use of WantsToViewVehicle in your new plugin or are you doing keyboard emulation (or CheckHWControl) to switch cars? If you aren't using WantsToViewVehicle you should check it out. It allows you to seek exact timecodes in the replay and stuff like that. It's way more reliable than it was in rF1 with keyboard emulation.
     
  3. RoWo

    RoWo Member

    Joined:
    Jul 16, 2014
    Messages:
    570
    Likes Received:
    625
    That's great. Was waiting for something like that since Geoff Grammonds GP-Series!

    Ez király! Grammond Geoff GP sorozata óta vártam olyasmire. :)
     
    AMillward likes this.
  4. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,004
    Likes Received:
    1,058
    nice! :)
     
  5. Diogo Oliveira Falcão

    Diogo Oliveira Falcão Registered

    Joined:
    Jun 30, 2015
    Messages:
    60
    Likes Received:
    0
    Thank you very much for sharing with us, downloading right now.
     
  6. HorCsa

    HorCsa Registered

    Joined:
    Jun 13, 2015
    Messages:
    28
    Likes Received:
    10
    Yep. To identify which car is in focus very hard in rFactor 1. I'm using WantsToViewVehicle now. It's very easy and fast.
    New plugin same functionality with rF1 version, but i'm thinking some new features.
     
  7. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Yeah I wrote a plugin for rF1 and if I remember correctly I would hit "enter" before doing a seek which would put the focus back to the player car... from there I would +/- to the car I wanted. I also did the math to figure out which path (+ or -) was the shortest. But it was annoying to see the flashing as it would run through the field.

    The new API is full of improvements over rF1.

    Thanks for sharing this!
     
  8. HorCsa

    HorCsa Registered

    Joined:
    Jun 13, 2015
    Messages:
    28
    Likes Received:
    10
    I solved this (in rF1) by changing a moment become onboard camera. Whichever car is closest to the onboard, that is in the focus. :) It's working also in spectator mode. But it's a thing of the past. No more faulty camera switching in rF2. :)
     
    Last edited by a moderator: Jul 23, 2015
  9. HorCsa

    HorCsa Registered

    Joined:
    Jun 13, 2015
    Messages:
    28
    Likes Received:
    10
    I'm thinking on (automatic) replay events.
    Position change, accidents, off-track.
    Position change and accidents: I can see how to do it.
    But off-track? Can I check with plugin that someone is off-track? ("invalid path", material, coordinates or something else)
     
  10. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    Brilliant plugin many thanks for your work, looking forward to future updates. Just sat back and watched an AI race at Portugal & The Brickyard...loved it!
     
  11. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Me too but how do I use it? I installed the plugin (confirmed by it creating the ini file) but nothing happens. I started a race and went through all the standard camera view buttons.

    Does it work on replays as well as live races?
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I can't remember the exact names without looking at my code but mTrackEdge and mPathLateral or something like that. Subtract them from each other so see how far past the edge of the track they are. As cars enter the pits this can cause problems though depending on the track. I disable this logic when they are in the pits but it can still get triggered as they exit towards the pits but haven't actually entered them yet.
     
  13. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Only live. The plugin API in rf2 isn't active during replays.
     
  14. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    I just pressed the TV Cam key (forget the binding) and it worked, make sure you have extracted to the correct folder:
    \RFactor2\Bin64\Plugins

    Needs to be run in 64bit mode too I believe (due to the plugin being 64)
     
  15. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    Very nice, thank you.
     
  16. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    Is there any way to set a key for plugin's on/off?
     
  17. HorCsa

    HorCsa Registered

    Joined:
    Jun 13, 2015
    Messages:
    28
    Likes Received:
    10
    Not now. The auto=0/1 parameter to be read every 5 seconds, but I screwed up something, not working. :(
    on/off key is a very good idea. I'm working on a new version, it will be in it.
    I update the plugin in a few days.
     
  18. RoboCAT10

    RoboCAT10 Registered

    Joined:
    Oct 18, 2014
    Messages:
    639
    Likes Received:
    114
    This looks great and I will download tomorrow. By any chance does the camera cut to when a driver makes a pit stop? Great work :)
     
  19. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,004
    Likes Received:
    1,058
    Does this work on replays?
     
  20. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    No
     

Share This Page