[REL] rF2 Shared Memory Tools for Developers

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

  1. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    You do not need to sort by position. Just check rf2scoring.mscoringinfo.mnumvehicles. it contains number of updated vehicles. To save couple of picosecond. I don't clear buffer past active,as you noticed:)

    Check the monitor app it shows pretty much everything you need to do to read this stuff.

    Mimd me asking what are you trying to do?

    Let me know if you have questions.
     
  2. Nibo

    Nibo Member

    Joined:
    Oct 12, 2010
    Messages:
    1,856
    Likes Received:
    599
    I`m trying to do LIveTiming. Its really early as I`m trying out available server-client techs for me. I`ll ask if I need more info.
     
    ceecee likes this.
  3. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    something I did not investigate yet, is running plugin in dedicated server. There's untested code in plugin, that roots from rF1 plugin. But if you'll need it I can have a look at some point. Good luck :)
     
  4. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    One more thing - if you end up using this plugin, let me know please. Having list of users will help me convincing people to move, as running fewer plugins is good for rF2.
     
    Nibo likes this.
  5. Nibo

    Nibo Member

    Joined:
    Oct 12, 2010
    Messages:
    1,856
    Likes Received:
    599
    rF2ScoringInfo.mSectorFlag array always returns [1,11,11] if yellow flag is in any sector. For example, if YF is in S2 it is [1, 11, 11] instead of [11, 1, 11]. Is this a bug?
     
  6. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    Hmmm, I never heard CC announce yellow incorrectly. I checked the code and looks I am only reading this in CC during Race. What session is this?
     
  7. Nibo

    Nibo Member

    Joined:
    Oct 12, 2010
    Messages:
    1,856
    Likes Received:
    599
    Any session.
     
  8. Nibo

    Nibo Member

    Joined:
    Oct 12, 2010
    Messages:
    1,856
    Likes Received:
    599
    Ok, so I was testing before only on Silverstone International layout and there mSectorFlag does not work correctly. Now I tried other 2 Silverstone layouts and there it works correctly. So I guess its a Silverstone International track bug and not related to plugin. Sorry again.
     
  9. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    Yes: First lap of FCY
    upload_2018-3-22_8-35-17.png

    s3 yellow.
    upload_2018-3-22_8-32-15.png

    Note that shared memory plugin does pretty much nothing but copies rF2 internals, and if there's problem copying somewhere many things will be completely broken. The only artificial struct is rF2Extended.
     

    Attached Files:

  10. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    03/29/2018 - v3.0.1.0

    Plugin:
    • Add DedicatedServerMapGlobally preference to allow mapping dedicated server shared memory buffers to global section, so that users running under other accounts can access them. Note that "Create Global Objects" permission is needed on user account running dedicated server.
     
    Nibo likes this.
  11. ceecee

    ceecee Registered

    Joined:
    Jan 10, 2012
    Messages:
    692
    Likes Received:
    285
    Hi @The Iron Wolf
    How does one go about this ?
    "Note that "Create Global Objects" permission is needed on user account running dedicated server."
     
  12. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    Hi Ceecee, This is administrative/Group Policy task and you have to research it yourself unfortunately. But roughly, on Pro OS there's Local Security Policy->Local Policies->Create global objects.

    This might not be available on Home editions.
     
    ceecee likes this.
  13. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    09/04/2018 - v3.1.0.0

    Plugin:

    • Exposed FFB info. Add $rFactor2SMMP_ForceFeedback$ buffer to map rF2ForceFeedback structure. Note that since it is a single value buffer, and it is updated at 400FPS, no synchronization is applied nor needed while reading it.
    Monitor:

    • Updated to expose FFB info.
     
    ADSTA and bravotangosix like this.
  14. RoWo

    RoWo Registered

    Joined:
    Jul 16, 2014
    Messages:
    288
    Likes Received:
    350
    @The Iron Wolf
    Does your plugin support the data output of the new integrated ABS and TC?
    Seems like it doesn't. But would be cool for SimHub.
     
  15. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    Did S397 announce they exposed anything new (other than deltaBest)? I checked InternalsPlugin from s397, still good old v7 from ISI :) So I am not aware of any updates.

    There are 2 things related to TC/ABS in v7 internals:
    Code:
    // Driver input
      double mUnfilteredThrottle;    // ranges  0.0-1.0
      double mUnfilteredBrake;       // ranges  0.0-1.0
      double mUnfilteredSteering;    // ranges -1.0-1.0 (left to right)
      double mUnfilteredClutch;      // ranges  0.0-1.0
    
      // Filtered input (various adjustments for rev or speed limiting, TC, ABS?, speed sensitive steering, clutch work for semi-automatic shifting, etc.)
      double mFilteredThrottle;      // ranges  0.0-1.0
      double mFilteredBrake;         // ranges  0.0-1.0
      double mFilteredSteering;      // ranges -1.0-1.0 (left to right)
      double mFilteredClutch;        // ranges  0.0-1.0
    
    So I suppose when ABS fluctuates, Filtered brake will vary from Unfiltered. Same for TC and throttle.

    Second, aid settings are already exposed via
    rF2Extended::mPhysics

    namely:
    Code:
    struct rF2PhysicsOptions
    {
      unsigned char mTractionControl;  // 0 (off) - 3 (high)
      unsigned char mAntiLockBrakes;   // 0 (off) - 2 (high)
    
     
  16. Nibo

    Nibo Member

    Joined:
    Oct 12, 2010
    Messages:
    1,856
    Likes Received:
    599
    Hi. I see now that mServerName is available in API. Do you plan on adding it to rF2ScoringInfo? Would be useful to show server name in LiveTiming.
     
    RoWo likes this.
  17. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    Hi, I'll ping you on the Discord to discuss. I will be looking into plugin updates soon, because it turns out there are few fields in the reserved bytes that are given meaning in SCR/KQ plugin. I will see where this fits. I don't see code now but if it is not part of current ScoringInfo, it'll likely have to go the new buffer, or extended, because buffers are exact mirror of ISI structures.
     
  18. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    12/15/2018 - v3.2.0.0

    Plugin/Monitor:

    • Update exposed field headers and C# marhsaling code to include fields found in Rules/Knockout Qualifying plugins. See this commit to see what has changed.
    Special thanks for testing goes to @Nibo
     
    Nibo and Corti like this.
  19. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    01/28/2019 - v3.3.0.6

    Plugin/Monitor:
    • Expose Message Center messages, global status message and pit lane speed values via rF2Extended buffer. This functionality if off by default and is enabled via "EnableDirectMemoryAccess" plugin variable.
     
  20. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    952
    Likes Received:
    879
    02/08/2019 - v3.4.0.6

    Plugin/Monitor:

    • Expose Stock Car Rules plugin FCY instruction message in DMA mode.
    • Deprecate SCR plugin hosting (breaking change).
     
    Corti likes this.

Share This Page