The Iron Wolf
Registered
Hi fellow rF2 Players,
Please find rFactor 2 Shared Memory Tools for Developers.
Download:
https://www.mediafire.com/file/45kvt7p3lb23gww/rf2_sm_tools_3.7.15.0.zip/file
Install:
Drop rFactor2SharedMemoryMapPlugin64.dll into [rF2Root]\Bin64\Plugins
Description
This plugin mirrors exposed rFactor 2 internal state into shared memory buffers. Essentially, this is direct memcpy of rFactor 2 internals (except for extended stuff implemented to workaround API limitations/bugs). Plugin also allows some level of input back into the rFactor 2 API.
Reading and writing shared memory allows creating external tools running outside of rFactor 2 and written in languages other than C++ (C# sample is included). It also allows keeping CPU time impact in rFactor 2 plugin threads to the minimum.
This plugin is carefully implemented with an intent of becoming a shared component for reading rF2 internals. For read operations, it can handle any number of clients without slowing down rF2 plugin thread. A lot of work was done to ensure it is as efficient and reliable as possible.
rFactor 2 API has some limitations/bugs, and plugin tries to deal with that by deriving some information: basic accumulated damage info, tracking session transitions and optionally reading game memory directly.
This work is based on:
- rF2 Internals Plugin sample #7 by ISI/S397 found at: https://www.studio-397.com/modding-resources/
- rF1 Shared Memory Map Plugin by Dan Allongo found at: https://github.com/dallongo/rFactorSharedMemoryMap
Source: https://github.com/TheIronWolfModding/rF2SharedMemoryMapPlugin
Refresh Rates:
* Telemetry - 50FPS.
* Scoring - 5FPS.
* Rules - 3FPS.
* Multi Rules - on callback from a game, usually once a session and in between sessions.
* ForceFeedback - 400FPS.
* Graphics - 400FPS.
* Pit Info - 100FPS.
* Weather - 1FPS.
* Extended - 5FPS and on tracked callback by the game.
Uses:
You are allowed to include this .dll with your distribution, as long as it is:
Current known clients
If you would like to support Crew Chief Mega Corp Team, and all sorts of immoral lifestyle, send beer money here.
Release history:
09/07/2020 - v3.7.14.2
This version introduces input buffers. See "Input Buffers" readme section for more info.
Plugin:
* Expose `rF2PitInfo` and `rF2Weather` buffers. Special thanks for prototyping `AccessPitMenu` and `CheckHWControl` plugin functionality go to Tony Whitley.
* Expose `rF2HWControl` input buffer, which allows sending limited number of inputs into the game.
* Expose `rF2WeatherControl` input buffer, which allows changing weather conditions dynamically.
* Expose `rF2PluginControl` input buffer. Allows requesting additional plugin features dynamically.
* Experimental: Expose `rF2RulesControl` input buffer, which allows sending rules input into the game.
* Intenral: rework tracing and reduce code duplication.
Monitor:
* Updated to demo newly added features.
11/10/2019 - v3.7.1.0
Plugin:
Plugin:
So, to unsubscribe from Multi Rules and Graphics buffeers set UnsubscribedBuffersMask to 40 (8 + 32).
05/01/2019 - v3.6.0.0
Plugin:
Plugin:
02/08/2019 - v3.4.0.6
Plugin/Monitor:
01/28/2019 - v3.3.0.6
Plugin/Monitor:
12/15/2018 - v3.2.0.0
Plugin/Monitor:
09/04/2018 - v3.1.0.0
Plugin:
Plugin:
02/21/2018 - v3.0.0.1
Hotfix for physics options not being captured.
02/16/2018 - v3.0.0.0
Rework Plugin to replace mutexes with buffer version tracking mechanism. Update Monitor to match new way of reading data.
01/24/2018 - v2.4.0.0
Plugin:
Plugin:
10/04/2017 - v2.2.1.0
Plugin:
9/01/2017 - v2.1.1.1
Plugin:
7/22/2017 - v2.0.0.0
Complete redesign/rework to better reflect rFactor 2 internals read model. Interpolation is removed, plugin is now essentially double buffered memcpy of rF2 internals.
3/22/2017 - v1.1.0.1
Plugin:
Fixed synchronization of:
01/31/2017 - v1.0.0.0
Please find rFactor 2 Shared Memory Tools for Developers.
Download:
https://www.mediafire.com/file/45kvt7p3lb23gww/rf2_sm_tools_3.7.15.0.zip/file
Install:
Drop rFactor2SharedMemoryMapPlugin64.dll into [rF2Root]\Bin64\Plugins
Description
This plugin mirrors exposed rFactor 2 internal state into shared memory buffers. Essentially, this is direct memcpy of rFactor 2 internals (except for extended stuff implemented to workaround API limitations/bugs). Plugin also allows some level of input back into the rFactor 2 API.
Reading and writing shared memory allows creating external tools running outside of rFactor 2 and written in languages other than C++ (C# sample is included). It also allows keeping CPU time impact in rFactor 2 plugin threads to the minimum.
This plugin is carefully implemented with an intent of becoming a shared component for reading rF2 internals. For read operations, it can handle any number of clients without slowing down rF2 plugin thread. A lot of work was done to ensure it is as efficient and reliable as possible.
rFactor 2 API has some limitations/bugs, and plugin tries to deal with that by deriving some information: basic accumulated damage info, tracking session transitions and optionally reading game memory directly.
This work is based on:
- rF2 Internals Plugin sample #7 by ISI/S397 found at: https://www.studio-397.com/modding-resources/
- rF1 Shared Memory Map Plugin by Dan Allongo found at: https://github.com/dallongo/rFactorSharedMemoryMap
Source: https://github.com/TheIronWolfModding/rF2SharedMemoryMapPlugin
Refresh Rates:
* Telemetry - 50FPS.
* Scoring - 5FPS.
* Rules - 3FPS.
* Multi Rules - on callback from a game, usually once a session and in between sessions.
* ForceFeedback - 400FPS.
* Graphics - 400FPS.
* Pit Info - 100FPS.
* Weather - 1FPS.
* Extended - 5FPS and on tracked callback by the game.
Uses:
- Basic: Most clients (HUDs, Dashes, visualizers) won't need synchronization, see rF2SMMonitor.MappedBuffer<>.GetMappedDataUnsynchronized for sample implementation.
- Advanced: If you would like to make sure you're not reading a torn (partially overwritten) frame, see rF2SMMonitor.MainForm.MappedBuffer<>.GetMappedData for sample implementation.
You are allowed to include this .dll with your distribution, as long as it is:
- Free
- Readme is included
- You had my permission via email
Current known clients
- Crew Chief: https://github.com/mrbelowski/CrewChiefV4
- SimHub: https://github.com/zegreatclan/AssettoCorsaTools/wiki
- rFactor 2 Log Analyzer: https://forum.studio-397.com/index....ffline-and-league-championship-manager.48117/
- Sim Racing Studio tools - https://www.simracingstudio.com/download
- Second Monitor - https://github.com/Winzarten/SecondMonitor
- Realistic Gearshift - https://forum.studio-397.com/index.php?threads/realistic-gearshift-version-2.62996/
If you would like to support Crew Chief Mega Corp Team, and all sorts of immoral lifestyle, send beer money here.
Release history:
09/07/2020 - v3.7.14.2
This version introduces input buffers. See "Input Buffers" readme section for more info.
Plugin:
* Expose `rF2PitInfo` and `rF2Weather` buffers. Special thanks for prototyping `AccessPitMenu` and `CheckHWControl` plugin functionality go to Tony Whitley.
* Expose `rF2HWControl` input buffer, which allows sending limited number of inputs into the game.
* Expose `rF2WeatherControl` input buffer, which allows changing weather conditions dynamically.
* Expose `rF2PluginControl` input buffer. Allows requesting additional plugin features dynamically.
* Experimental: Expose `rF2RulesControl` input buffer, which allows sending rules input into the game.
* Intenral: rework tracing and reduce code duplication.
Monitor:
* Updated to demo newly added features.
11/10/2019 - v3.7.1.0
Plugin:
- Expose UsubscribedBuffersMask via rF2Extended::mUnsubscribedBuffersMask. This can be used by clients to validate UBM, and might be made client writable in the future.
Plugin:
- Expose rF2Graphics (GraphicsInfoV02) buffer via $rFactor2SMMP_Graphics$. Note that it is not subsribed to by default.
- It is now possible to configure which buffers get updated and which don't. This is done via UnsubscribedBuffersMask value in the CustomPluginVariables.json file. To specify buffers to unsubscribe from, add desired flag values up.
So, to unsubscribe from Multi Rules and Graphics buffeers set UnsubscribedBuffersMask to 40 (8 + 32).
05/01/2019 - v3.6.0.0
Plugin:
- Fix version string not behaving as expected (breaking rF2Extended change, Sorry!)
- Reduce amount of string copies in DMA mode.
Plugin:
- Expose LSI messages in DMA mode.
- Clear out accumulated damage on return to Monitor.
- Harden DMA mode against crashes.
- Implement Frozen Order detection based on LSI messages. That's the only way to handle FO in the online sessions.
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).
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.
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.
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.
- Updated to expose FFB info.
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.
02/21/2018 - v3.0.0.1
Hotfix for physics options not being captured.
02/16/2018 - v3.0.0.0
Rework Plugin to replace mutexes with buffer version tracking mechanism. Update Monitor to match new way of reading data.
01/24/2018 - v2.4.0.0
Plugin:
- Expose Stock Car Rules plugin DoubleFileType setting.
- Rearrange rF2Extended to better expose hosted plugin variables.
- Improve Rolling Start detection when no SC present.
- Correctly calculate distance to the SC.
- Add Frozen Order sub-phases for Rolling start without SC, while assigned pole/pole row.
Plugin:
- Allow hosting of StockCarRules.dll plugin. Capture mMessage members filled out by SCR plugin and pass them out via SM.
- Remove .ini file config and move to standard rF2 plugin config via CustomPluginVariables.json.
- Minor fixes and changes to support SCR plugin hosting feature.
10/04/2017 - v2.2.1.0
Plugin:
- Expose rF2MultiRules buffer
- Add rF2SessionTransitionCapture to rF2Extended. This allows tracking some state on session transition.
- Add mSessionStarted, mTicksSessionStarted and mTicksSessionStarted to rF2Extended to help tracking session transitions.
- Buffers are no longer cleared out on EndSession. This is neccessary to capture data in StartSession.
- Add Frozen Order rules detection.
9/01/2017 - v2.1.1.1
Plugin:
- Fix crash in physics update that happens when buffer can't be mapped.
- Expose TrackRules01 as rF2Rules buffer.
- Improve Win32 error tracing.
- Minor reliability improvements.
- Add rF2Rules tracking.
- Force invariant culture on the app.
7/22/2017 - v2.0.0.0
Complete redesign/rework to better reflect rFactor 2 internals read model. Interpolation is removed, plugin is now essentially double buffered memcpy of rF2 internals.
3/22/2017 - v1.1.0.1
Plugin:
- Replaced rF2State::mInRealTime with mInRealTimeFC and mInRealTimeSU values, to distiguish between InRealtime state reported via ScoringUpdate, and via Enter/ExitRealtime calls.
- rF2State::mCurrentET is no longer updated between Scoring Updates, and matches value last reported by the game.
- Extended monitor to dislay more information
- Implemented correct "Best Split" time calculation logic.
Fixed synchronization of:
- rF2State::mElapsedTime
- rF2State::mLapStartET
- rF2State::mLapNumber
This eliminates the gap those values had between telemetry and scoring update
01/31/2017 - v1.0.0.0
- Plugin: Added damage and invulnerability tracking
- Monitor: Added phase and damage tracking and logging
Last edited: