[REL] rF2 Shared Memory Tools for Developers

Discussion in 'Other' started by The Iron Wolf, Jan 19, 2017.

  1. Luca Martino

    Luca Martino Registered

    Joined:
    Jul 21, 2021
    Messages:
    16
    Likes Received:
    6
    that's why i'm going crazy :(
     
  2. lagg

    lagg Registered

    Joined:
    Oct 1, 2012
    Messages:
    3,043
    Likes Received:
    1,958
    Have you tried to run Steam as Admin?
    Not much faith, but...
     
  3. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    Do you mean the 2015, 2017, 2019, 2022 runtime package? (x86 and x64 from here) (note that these aren't backwards compatible; if a program needs 2012 runtimes, the 2015-2022 package won't help)

    And just to be doubly sure, you installed all 4 of the runtimes included with rF2 (x86 and x64).

    2 things:
    • Run each of those runtimes packages again and uninstall each one. Reboot as necessary. Reboot afterwards. Then run them all again and install them.
    • Share your complete trace file in case we can spot anything else.
     
    lagg likes this.
  4. Luca Martino

    Luca Martino Registered

    Joined:
    Jul 21, 2021
    Messages:
    16
    Likes Received:
    6
    did it and still nothing :(


    tried everything that you said but nothing is moving, i'll try uninstall and reinstall the game (last hope)
    here's the last trace
    massive thanks for the time, appreciate it
     

    Attached Files:

  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    I don't think a reinstall will help, there must be something dll or runtime related that is missing. Perhaps a tool like dependency walker will be useful.
     
  6. Luca Martino

    Luca Martino Registered

    Joined:
    Jul 21, 2021
    Messages:
    16
    Likes Received:
    6
    downloaded it but don't actually know how does it work :oops: should i just open the dll with it (sharedmemory) or do something else? what am i looking for?
    sorry for that
     
    Last edited: Sep 6, 2022
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    Off the top of my head I wasn't sure myself. Judging by the top layer after opening up the dll it really should be only msvcr120 required (that's the 2013 runtimes, one of those included with rF2). I don't know why your system isn't running it :confused:

    The only curious thing I'd say is that all the plugins you're using that I have (everything except FanaLEDs) is using msvcr110, not 120. If the sharedmemory is the only one using the 2013 and it's the only one you can't run, that would suggest a 2013 runtimes issue.
     
    lagg and Seven Smiles like this.
  8. Luca Martino

    Luca Martino Registered

    Joined:
    Jul 21, 2021
    Messages:
    16
    Likes Received:
    6
    FIXED THANK GOD

    Instead of repairing/uninstalling and reinstalling the 2013 runtimes from the rf2 support folder i've downloaded them from HERE and repaired; it took a little bit more time than the rf2 folder ones to get installed but yes, worked.

    Massive thanks, super thanks to you @Lazza , i owe you guys a beer :)
     
    EricW, Kevin van Dooren, lagg and 2 others like this.
  9. Hinyaldee

    Hinyaldee Registered

    Joined:
    Nov 24, 2021
    Messages:
    130
    Likes Received:
    41
    Hello ! I encounter an issue regarding the use of CC with rF2. I used to be on Win 7 and it worked perfectly fine. I upgraded my PC this weekend and had to install Win 10 but now, despite the app working when I use a button press on the controller to talk to it, whenever the window isn't in focus, the button press doesn't work anymore. Which means I can't interact with CC when playing the game, is there any fix for this issue, please ?
     
  10. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Minor update of the plugin (using InternalsPlugin.hpp#8 which was released today [EDIT: plus "Lazza's fix"]) here: https://www.mediafire.com/file/s6ojcr9zrs6q9ls/rf2_sm_tools_3.7.15.1.zip/file

    These battery/electric motor entries are the only things that have been added but nothing is making use of them yet so the recommendation is that only developers of programs that use the plugin should download this new version.
    Code:
      double mDeltaBest;                       // (omitted in error by S397)
    
      double mBatteryChargeFraction; // Battery charge as fraction [0.0-1.0]
    
      // electric boost motor
      double mElectricBoostMotorTorque; // current torque of boost motor (can be negative when in regenerating mode)
      double mElectricBoostMotorRPM; // current rpm of boost motor
      double mElectricBoostMotorTemperature; // current temperature of boost motor
      double mElectricBoostWaterTemperature; // current water temperature of boost motor cooler if present (0 otherwise)
      unsigned char mElectricBoostMotorState; // 0=unavailable 1=inactive, 2=propulsion, 3=regeneration

    At some point Crew Chief will be updated to install this instead of the current one but until then if you do install the new version it will try to overwrite with the current plugin (it works perfectly well with the new one it just nags you to install the one it knows and loves).

    Crew Chief has been updated to install this version.
     
    Last edited: Jun 23, 2023
  11. elgagon

    elgagon Registered

    Joined:
    Dec 21, 2022
    Messages:
    213
    Likes Received:
    139
    Hi all.
    Thank you for this dll.
    I've a couple of questions
    Taking a look to the thread, i've understood that, in order to make the dll work on a dedicated server is necessary to activate the "DedicatedServerMapGlobally" in the CustomPluginVariables.JSON, is it correct?
    Second question.
    If there are several dedicated servers running, how do i identify the server i want to work with?
     
    Last edited: Mar 10, 2023
  12. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    935
    Likes Received:
    6,342
    Thank you very much for the new version update.

    I have just managed to add and test those new API in pyRfactor2SharedMemory with BTCC(DLC), and notice a few thing:
    1. mBatteryChargeFraction always returns 0.0, as if this data is encrypted or something.
    2. mElectricBoostMotorTorque, mElectricBoostMotorRPM, mElectricBoostMotorTemperature, mElectricBoostWaterTemperature all seems working with correct readings.
    3. mElectricBoostMotorState would return a series of none sensible values as following pic shows, which doesn't match the data description. I wonder if this is a game bug (as I don't see any issue with the code from API or plugin) or something else?
    upload_2023-3-20_14-44-5.png

    Thanks for any help!
     
  13. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    That’s worrying. I don’t have any battery cars so I couldn’t test the new values.
     
    svictor likes this.
  14. Lenniepen

    Lenniepen Registered

    Joined:
    Oct 5, 2010
    Messages:
    225
    Likes Received:
    38
    I tried running the example plugin v8, which writes the data to a .txt file. I found similar issues:
    - mBatteryChargeFraction returns 0 all the time as well
    - mElectricBoostMotorState: returns weird values, like:
    3.16e-322
    7.91e-323
    1.77e-321
    - mElectricMotorTemperature has a range of 0° (P2P off) to about 7000° (P2P active), not sure this is realistic.
    - mElectricBoostWaterTemperture reports 0° (P2P off), around 50 when P2P is active, starting at 0 doesn't seem realistic.

    Anyway, the issue is not with Shared Memory Plugin it seems.
     
    svictor and The Iron Wolf like this.
  15. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    The motor state is an unsigned char, and the example plugin outputs it as text by using its values as an array index. It may not be outputting correct values (from a very quick test I think I was getting similar to those reported earlier in this thread) but you're doing something wrong with it if you're getting those numbers.
     
    Lenniepen and The Iron Wolf like this.
  16. Lenniepen

    Lenniepen Registered

    Joined:
    Oct 5, 2010
    Messages:
    225
    Likes Received:
    38
    Ah my bad. The example plugin as it was caused rF2 to crash, it worked when skipping BoostMotorState, so I tried something different.
     
  17. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    Yeah, it's probably crashing due to trying to reference a 4-element array using values like 80, 240, etc. Just guessing though.
     
  18. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    Last edited: Mar 25, 2023
    svictor, Lenniepen and Seven Smiles like this.
  19. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Last edited: Mar 25, 2023
    svictor likes this.
  20. elgagon

    elgagon Registered

    Joined:
    Dec 21, 2022
    Messages:
    213
    Likes Received:
    139
    Hello. I need some help. I'm trying to make a program that gets the vehicles of the session.
    It works in the client pc but i want to run it in the server.
    I can't get it to connect in the server.
    I've configured the CustomPluginVariables.JSON as this

    Code:
     "rFactor2SharedMemoryMapPlugin64.dll":{
        " Enabled":1,
        "DebugISIInternals":1,
        "DebugOutputLevel":1,
        "DebugOutputSource":1,
        "DedicatedServerMapGlobally":1,
        "EnableDirectMemoryAccess":0,
        "EnableHWControlInput":1,
        "EnableRulesControlInput":1,
        "EnableWeatherControlInput":1,
        "UnsubscribedBuffersMask":0
      }
    Do you know what could be wrong?

    Thank you
     

Share This Page