Creating plugins using Visual Studio

Discussion in 'Plugins' started by hamiltonfan2205, Jun 5, 2017.

  1. hamiltonfan2205

    hamiltonfan2205 Registered

    Joined:
    Feb 2, 2013
    Messages:
    506
    Likes Received:
    5
    I just want to ask what are the first steps when doing an rF2 plugin? Do you use the Create Project From Existing Code or do you use something else?
     
    Spectator6 likes this.
  2. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Spectator6 and The Iron Wolf like this.
  3. hamiltonfan2205

    hamiltonfan2205 Registered

    Joined:
    Feb 2, 2013
    Messages:
    506
    Likes Received:
    5
    Is there a more in depth tutorial on how to use this than on the S397 site? Seems easier than i thought it was but just want to know if there is a tutorial...;

     
  4. palm3r

    palm3r Registered

    Joined:
    Jan 11, 2012
    Messages:
    37
    Likes Received:
    11
    Search "rfactor 2 plugin" in Github.
    You can find some good examples.
     
  5. Sergi Heras

    Sergi Heras Registered

    Joined:
    Mar 18, 2017
    Messages:
    2
    Likes Received:
    0
    I've encountered the same problem. I'm a web developer and I'm quite lost with this.
    I managed to compile the example KnockoutQualifying plugin, and run it, and make it work.
    But seems like any change I do on the code doesn't make any effect, as the sessions duration keep being the same.

    Any of you that have made a plugin and can help with this?
    Also I'd like to say, that in Visual Studio, you need to go to properties -> Configuration Properties (on the example project) and make it 64bit and release, otherwise it won't be seen by the game.
    And then "Build solution", and you'll have a new folder where you have several files, including the dll.

    I had to learn this 64bit thing all by myself, losing quite a lot of time.
    I think we should have a basic guide to make a lot easier for people wanting to develop plugins, specially now with DX11.

    This is what I made, idk if it's correct or not, so I would appreciate some help on knowing if this is right, and then why the example plugin whatever time or session changes I made in the code, it keeps making the same.

    Thanks in advance!

    PS: I think we should help us more between us if we wanna develop things.
     
  6. ZordheR

    ZordheR Registered

    Joined:
    Apr 22, 2018
    Messages:
    1
    Likes Received:
    0
    What version of Visual Studio are you using? I am compiling the example InternalsPlugin in Release and 64 bits with Visual Studio 2015 but RFactor2 does not list it.
     
  7. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    I searched github, but, not a lot going on, a shared mem wrapper is all I could find. Does anyone know of a c# wrapper for writing plugins?
     
  8. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
  9. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    I was going to introduce head roll with (cockpit camera) based on g-force rather than steering wheel based, but, c++ is my achilles heel.. y development cycle is compile, run, bsod, repeat ;). Think I can live with head roll with wheel as stashed away in the ini files ;)
     
  10. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    Yeap I tried that, but, it was chewing cpu like crazy for some reason, I see for AC they released a patch that fixed that issue, not sure if fix is localised to AC though? Some chat about it on GTP a while back, not reinstalled since though.
     
  11. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,004
    Likes Received:
    1,058
    Does the motionhead plugin not do this?
     
  12. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    hmm.. i replied to a post asking the same question, i see it was removed. Yes it does, but, it was killing framerate on my setup for some reason. The ini roll function ticked this box for me. Wierd that the devs will hide the most intersting and usefull settings away in an ini instead fo exposing them in the ui ;)
     
  13. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    I will try installing the RHM plugin again and see if i can replicate actual camera/head motion, while some people try to move away from this and stabilise the crap out of their camera, IRL it actually has a LOT of movement, that I would like to replicate.
     
  14. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,345
    Likes Received:
    6,572
    @CeeBee in real life your brain also corrects for a lot of that movement, something it can't do with an image on screens. But your personal preference is exactly that, so you do what feels best to you.

    Ironically I have a head tilt plugin but it's a static tilt/position adjustment. I never had any requests for head movement options, I think RHM should suffice there and should perform fine so you'll just need to sort that out.

    (If it's bugged let me know - I could have a play with adding those options to mine)
     
    CeeBee likes this.
  15. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    205
    Likes Received:
    123
    Will poke a stick at this on the weekend. Having never actually driven a racing car IRL I cannot say how much correction happens in my grey stuff, but, on my motorcycles when i hit rough roads like Wollombi in NSW at speed, it is bone jarring to the point of flying my glasses down my nose in my helmet, i think the "juicyness" of your body absorbs a lot of the bounce too, so it would not be as harsh as the helmet camera's for sure, closer in my noggin to this chest mount video of that road. (its on elastic, so probably closer to what I "feel" in my head" (turn audio down)

    EDIT: I see the RHM plugin has identified and fixed the issue that was chewing the bum off of FPS, defo give it a go this weekend then, it was really killing my games previously)
    https://www.racedepartment.com/threads/new-real-head-motion-plugin-reduced-cpu-usage.186079/

    EDIT2: Oh crap, only optimised for ACC.. bummer.
     

Share This Page