Research on rFactor plugin ecosystem

In my opinion, one of the coolest aspects of rFactor 1 is its ecosystem of plugins. Want to add a fancy dynamic track surface system and more detailed weather, including wet track surface? Use RFE. Want a legit H-pattern gearbox simulation? Use Grinding Tranny. Want a information-rich HUD? Use GID. Want a dynamic, user-configurable HUD? Use DynHUD. Want to be able to read data from the sim into external programs like SimHub? Use the shared memory plugin. And so on.

In my research on isiMotor2, I had uncovered very little in the way of modder knowledge sharing or official documentation about the plugin system. So I started specifically researching about plugins, and I'll share what I've found.

The first is a PDF document from Image Space Incorporated in 2006 describing the plugin architecture. A link is here: https://www.rfactor.net/downloads/rFactorInternalsPlugin.pdf

There was an example plugin created by ISI to give users a small idea of what plugins could do, and to potentially help the process of creating one. It can be downloaded in the pack here: https://www.racedepartment.com/downloads/isi-rf1-modding-tools-pack.59255/ The text of the PDF mentioned above says the following about the example plugin:

Copy the plugin to the \rFactor\Plugins directory. A compiled version can be found in the \ExamplePlugin\VC7\Release directory. Run rF Config.exe and make sure you choose a resolution that is less than your current desktop resolution and ensure the check box for windowed mode is checked. Then start rFactor and enter a race. Once the track has loaded click on the drive button. You will see the console this example plugin uses come alive. There will also be a text file in the root directory of the simulation that has captured telemetry data. If you see this item then you have successfully installed the example plugin.

What plugins for rF1 have been created where we could see the source code and study it to learn from?

rFactorSharedMemoryMap: A plugin for rFactor 1-based sims to export the standard telemetry and scoring data structs to a shared memory mapped file handle. This allows external programs to access the sim data without affecting frame times in the simulator.

pySRD9c: A Python library application for the Renovatio SRD-9c display. A sample application providing real-time telemetry data for RaceRoom Racing Experience and rFactor 1/Stock Car Extreme/Automobilista/Formula Truck/Copa Petrobras de Marcas is available in pyDash.py. It makes use of the psutil module (https://github.com/giampaolo/psutil) to detect which sim is running. It demonstrates custom mapping of RPM LEDs for use as push-to-pass/DRS indicators as well as warnings that blink the status LEDs during a critical state. It also features live lap timing, lap split time, field position, and lap progession during a race. The dash configuration is controlled via the pyDash.settings.json file (created on start-up if not found, re-read if modified while running).

VCR File Parser for rFactor 1: With this software, you can read and write the rFactor 1 replay files. Because those files are not well documented, only a bunch of events can get readed and manipulated. The rest will get handled as unknown event.

I also found a fascinating post from Marcel Offermans (a well-known sim racing developer who worked on rF1, AMS1, and rF2) about the plugin ecosystem in response to a user here on RD asking about whether an rF1 plugin could be created to add an extra gear:
There is no way to "add gears" using a plugin.
Ehm, I do not want to be a wise guy but I worked on rF1, rF2 and AMS1. None of those plugin interfaces supports what you describe. Yes, you can try and hack the exe to try and add this, but that's not what you were asking and in general much harder to pull off well (as such a thing would instantly also attract people using it to cheat).


Marcel's post makes me wonder what documentation exists (and if any of it was ever public) for the "plugin interface" for rFactor 1. His seemingly clear understanding of what a plugin would be capable of doing (and what it could not do) suggests to me that it must exist somewhere out there.
 
Last edited:
The PDF and example plugin you've found ARE basically the documentation that is around. For a programmer this should be enough information to create their own plugins.
Thanks so much for chiming in, Marcel! Really appreciate it. :) Okay, that is good to know.

FYI I decided to research this a bit because there's recently been a bunch of chatter in the AMS Unofficial Discord from people like Niels Heusinkveld about how "it would helpful to have a plugin that did X" to extend AMS 1 in certain ways or overcome certain limitations of the game engine (e.g. adding features that Reiza might have wanted to eventually add with their rF1 source code changes, but gave up on or didn't get around to). Plus there's all the great work being done on the GTR 2 Enhancements Patch through Crew Chief (which I believe involves memory editing and code injection, which as you mentioned in your post I quoted before, is a different beast). Anyway, given all this, I felt like it would be useful to try to dig up whatever could be found on the rF1 plugin system.
 
Thanks so much for chiming in, Marcel! Really appreciate it. :) Okay, that is good to know.
You're welcome.
FYI I decided to research this a bit because there's recently been a bunch of chatter in the AMS Unofficial Discord from people like Niels Heusinkveld about how "it would helpful to have a plugin that did X" to extend AMS 1 in certain ways or overcome certain limitations of the game engine (e.g. adding features that Reiza might have wanted to eventually add with their rF1 source code changes, but gave up on or didn't get around to). Plus there's all the great work being done on the GTR 2 Enhancements Patch through Crew Chief (which I believe involves memory editing and code injection, which as you mentioned in your post I quoted before, is a different beast). Anyway, given all this, I felt like it would be useful to try to dig up whatever could be found on the rF1 plugin system.
Niels is a good friend and I've worked with him on several projects (AMS1 being one of them). I'm sure that if Niels could program, he would have written his on racing simulator by now. The plugin API in rFactor (and rFactor 2) is quite powerful compared to most other sims. You get to run code directly in the physics loop and you can not only read information, but also act on it in several ways. Part of this we owe to the fact that rFpro is using very similar code for their "professional" simulators and there being able to change things is very important for customers.

I'm also closely following the work on GTR2, and as you say that is mostly done by "unofficial" ways to extend the simulation. Since that code is so similar to rFactor, some of the things that worked for the shared memory plugin (which does a combination of using the official API and some memory editing) will also work for GTR2. I'm curious how far they will get with this!

Finally, one way to explore more of these plugins is to start searching for projects that use them on GitHub. Just search for rFactor like this and you have a decent starting point: https://github.com/search?q=rfactor
 
The plugin API in rFactor (and rFactor 2) is quite powerful compared to most other sims. You get to run code directly in the physics loop and you can not only read information, but also act on it in several ways. Part of this we owe to the fact that rFpro is using very similar code for their "professional" simulators and there being able to change things is very important for customers.
Would never have thought of it, but makes so much sense that the plugin system would be related to how to allow rFpro customers to add custom elements as they see fit. So interesting. :)

Finally, one way to explore more of these plugins is to start searching for projects that use them on GitHub. Just search for rFactor like this and you have a decent starting point: https://github.com/search?q=rfactor
Somehow had been relying on web searches, and hadn't thought of searching directly on GitHub :roflmao: Thanks for the reminder. Already found these other open source plugins for rF1 with a quick search.

DynHUD
(I of course knew about this one, but didn't know it was open source!)

rfactorlcd
 
@Marcel Offermans Seeing that you are a Premium Member, it would be an honor to have you in an rF2 club-race (and it might scare some others, hah!) Re-living the old Simracing for Holland days in RD races ;) We even do multiclass! Nothing to lose in trying!


@MJQT I don't stop being surprised by all the things you keep yourself involved in, both old simracing stuff and newer!:D
 
Last edited:

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top