How to fix rF2 stock car rules

As someone who enjoys oval racing and is just getting into rFactor 2, I've found this updated Stock Car Rules plugin released on the Studio 397 forums.


I'm interested in trying it to see if this fixes the flag rule bugs currently present in rF2 oval racing. But don't understand how to get it working.

In addition to the CustomPluginVariables.JSON changes (which are simple to do) one seems to need to create a new 'Series' or 'RaceEvent' MAS file containing the updated RFM file included with the download. Is this correct? How specifically would I go about getting this updated, fixed plugin working in the game?


LATER EDIT: it does in fact fix the oval flag rule bugs, and Ole has kindly provided a clear step-by-step guide of how to do what needs to be done below!
 
Last edited:
As someone who enjoys oval racing and is just getting into rFactor 2, I've found this updated Stock Car Rules plugin released on the Studio 397 forums.


I'm interested in trying it to see if this fixes the flag rule bugs currently present in rF2 oval racing. But don't understand how to get it working.

In addition to the CustomPluginVariables.JSON changes (which are simple to do) one seems to need to create a new 'Series' or 'RaceEvent' MAS file containing the updated RFM file included with the download. Is this correct? How specifically would I go about getting this updated, fixed plugin working in the game?

Ok, first, I would advise you to download this: https://mega.nz/file/HA9EhB7S#pJ1WcBQ1O1kiYhBYTU6cXYA4fH8CQGCYcenY5Lu6Ix8
And sorry for the file being funky named. Rename it to StockCarRules.dll
This is the newest version of the plugin, not the 2018 one you found on the S397 forum.

I used that version in our club race at Martinsville almost a year ago, and we had no issues with flags, SC or anything: https://www.racedepartment.com/threads/birthday-baluba-nascar-martinsville-sun-21-mar-2021.200076/

Ok. Soooo. The MAS-thingy. Let's hope I'll be allowed to paste in picture in this thread.
In the folder *wherever you have installed rF2*steamapps\common\rFactor 2\Support\Tools (which will be Steam\steamapps\common\rFactor 2\Support\Tools in you don't have multiple SteamLibraries etc.) you find the MAS2 app.
1. Open that and click the "create package" button.
1643941170949.png


2. Click the "Create New Mod" button that shows up. (I will not show a picture of that, as it is very very self explanatory).

3. Give your mod the name you want (no issues with space in the name. Do note that @ and other special signs can only be put in if you have text behind it. So here I wrote "StockCarRules Martinsville", went back and added the "@" in between afterwards. aaanyway. Click the "B" on the rFm File: path
1643941360848.png

As you can see, I just downloaded the thing again to find it easier (I set everything up on the RD-server and not local PC last time). Note the new path for rFm.
1643941625263.png


4. Choose track(s) you want. (Hold CTRL and click on as many track you would like). Then click "next"
1643941720514.png


5. Do the same on car(s). Then click next. Remember that to use the Corvette PaceCar you need to choose that one as well in the "add vehicles". At least I had to, to get it to show on the server.
1643941774418.png


6. On "Other components" I don't add anything. Click "done".

7. Now it's the "ups. Do things right" part. It can work just as it is, but due to rF2 being rF2. I advise you to click the button marked in red. Which gives opens an option to rename the file. I would advise you to replace any spaces and @'s with an underscore. So "StockCarRules @ Martinsville" is renamed to "StockCarRules_Martinsville" as rfmod. (see point 7.2 below)
In what's being marked with blue, you can choose tracks and specific vehicles. You can in #4 and #5 above mark every car and track, then remove what you don't want in this part, but I find that is more work...
Do not check the checkboxs on "Locations" nor "Vehicles". That will not change the rfmod other than add loads of MB to it. If you see top right, it says version 1.0 and 7kb. That means the whole rfmod is 7kb. If you check the boxes to the left, it can jump to several hundred MB's.
When you are happy with the name of the rfmod (file) and what track, layout(s) and cars to have. Click "package" marked in green.
1643942015888.png


7.2 This is where you re-name the file. Just remove the @ and spaces, replace that with and underscore. Click "open" that is "save". As you can see from the list of rFmods I have, we name it a certain way. We also add in numbers, which are day-month-year, to make it easier to see.
1643942378315.png


8. Hopefully that will give you this message marked in red, and the "Install" button available. Click install. And hopefully you will have a "Mod installed successfully" message
1643942523021.png


9. As you remember, and as you see in the above screenshot. The Mod Name is "StockCarRules @ Martinsville". When you now open the game and click select series, you will hopefully find it there.
1643942695399.png


Enjoy, and have fun! :)
 
Thank you soooo much Ole for the thoughtful and thorough response detailing all the steps needed with maximum clarity. :inlove: So generous of you. :) I imagine this will also be helpful to others interested in this issue in the future, which is fantastic. Will likely try to do all this later tonight, and will let you know what the results are and/or if I run into any snags along the way.
 
Last edited:
Okay, I've just gone through the steps. Again, thanks so much for taking the time to put this guide together! :) Only thing that might not be 100% clear to a future reader is in Step 3 - that's where you use the StockCarOval.rfm file included with the download from the Studio 397 forum post I linked before.

And I've stayed up late to do some testing with the AI... and this works. It all works. I can't believe it. I have reliable full course cautions - even if all I do is spin on my own. I can block like a pillock in front of the leader who's about to put me a lap down and stay in front, get shown a blue flag because they're approaching, but not get a blue flag penalty for not letting them by. As far as I can tell, the flag rule bugs for stock cars in AI racing are gone. Plus, behaviour of oval AI under FCY is a little wonky, but serviceable. I'm very, very pleased!

This made my week. :) Going to sleep a happy boy tonight :laugh:
 
What would you like to add? I can add the needed clarification if you want/edit the one that's there now if that would be useful
Oh, cool! I personally took a moment before realizing in Step 3 that I needed to use the StockCarOval.rfm file included with the download from the Studio 397 forum post. So maybe just a clarifying comment about that in the spot where you say "As you can see, I just downloaded the thing again" would be helpful for future readers.

Another quick question: how do you delete one of these series once they're created? Cause I totally didn't mess up a couple times and create something I'd like to get rid of :rolleyes:

A final comment: looking back, I wish I'd titled the thread "How to fix rF2 stock car rules" or something similar. Would you, as a mod, be able to change it to something like that?
 
Last edited:
Oh, cool! I personally took a moment before realizing in Step 3 that I needed to use the StockCarOval.rfm file included with the download from the Studio 397 forum post. So maybe just a clarifying comment about that in the spot where you say "As you can see, I just downloaded the thing again" would be helpful for future readers.

Another quick question: how do you delete one of these series once they're created? Cause I totally didn't mess up a couple times and create something I'd like to get rid of :rolleyes:

A final comment: looking back, I wish I'd titled the thread "How to fix rF2 stock car rules" or something similar. Would you, as a mod, be able to change it to something like that?

Will fix that, hopefully tomorrow evening EU-time :)

To delete it: Click Manage content down left on the "content and settings" in the rF2 main menu.
dsfs.jpg


Find the file. As you can see, I have already clicked "uninstall item", which, well. Uninstalls it. Then you can click delete item.
1644026213038.png



You can just delete it off the "packages" folder in the rFactor 2 game folder as well. I tend to do that. Buuut, this is rFactor 2. I haven't deleted stuff for a while (as you can see), and I cannot guarantee that in a new build, something have changed. The safest way is to uninstall, then delete :)
 
Thanks for the "tutorial"!
I have three questions

1. I added the pacecar to the package but instead of the Corvette one of the mod cars I added to the packge (from another mod which I was running) became the safety car...

2. why do we need this package thing for these rules to work? What's wrong with the "vanilla rF2" in it's basic state without this package?

3. do I have to do this with road course stuff too? I just tried a road course race without packaging and it seems FCY works now (I turned off the stockcar dll) which is interesting because few weeks ago when I last tried FCY never stopped for me so the cars kept going around behind the safety car until the time was up.

Again thanks.
 
1. I added the pacecar to the package but instead of the Corvette one of the mod cars I added to the packge (from another mod which I was running) became the safety car...
I don't know what's going on here. Perhaps resident RD rF2 whisperer @Ole Marius Myrvold you have an idea?

2. why do we need this package thing for these rules to work? What's wrong with the "vanilla rF2" in it's basic state without this package?
In today's oval racing (e.g. stock cars) the moment there is an accident or something else goes wrong on track, the FCY is immediately thrown. There's no such thing as "local yellows". Also, there are not blue flag penalties requiring you to "get out of the way" (like in F1).

Using the vanilla Stock Car Rules plugin that ships with rF2, in my (and others') experience, an FCY is not immediately thrown like it should be. Even with a large accident. Instead, often, if not always, only a local yellow is thrown. Also, if a car behind you is a lap ahead, and you don't get out of the way, you are warned that you'll be penalized. Not how it should work. Billy Strange did a video a while ago discussing and showing these problems:


Using the guide Ole generously provided above, you basically install an updated StockCarRules plugin so that oval racing rules actually work as they should. No more problems like Billy got frustrated about! :)

Why Studio 397 have not shipped a fix to their broken vanilla plugin... I don't know. It baffles me. Especially when a working version exists. I guess they've just had other priorities and never gotten around to it... but why, I can't say.

3. do I have to do this with road course stuff too? I just tried a road course race without packaging and it seems FCY works now (I turned off the stockcar dll) which is interesting because few weeks ago when I last tried FCY never stopped for me so the cars kept going around behind the safety car until the time was up.
I don't know for certain. But it doesn't sound like you need to (on road courses). Perhaps others here know more about whether 397 implemented improvements to 'standard' FCY rules? But based on your experience, sounds like things are working well enough. :)
 
Last edited:
Also, I've just had a thought. If the folks who worked on the updated StockCarRules plugin provided permission, it would be a great thing if this updated plugin and any future updates (and its accompanying guide) were posted here on RD for easy access and wider visibility to the community in the rF2 Plugins downloads section.

Any chance this might be possible? If so, is there anything I could do to help to make this happen?
 
"Using the vanilla Stock Car Rules plugin that ships with rF2, in my (and others') experience, an FCY is not immediately thrown like it should be. Even with a large accident. Instead, often, if not always, only a local yellow is thrown."

OK, but I was asking about the rfm packaging thingy. :) If I simply replace the old dll with the new one (in the rF2/Bin64/plugins directory) you provided isn't that enough? Why do we need the packaging? That StockCarOval.rfm file consist some info which needed I guess?
 
OK, but I was asking about the rfm packaging thingy. :)
Oh whoops! Sorry I misunderstood.

If I simply replace the old dll with the new one (in the rF2/Bin64/plugins directory) you provided isn't that enough? Why do we need the packaging? That StockCarOval.rfm file consist some info which needed I guess?
Frankly, I don't know. Not enough of an rF2 expert to be able to say. I do know Ole's RFM method above works, and that's been enough for me :roflmao: Someone else more knowledgeable about the intricacies of rF2 would be better placed to answer! :)
 
Thanks for the "tutorial"!
I have three questions

1. I added the pacecar to the package but instead of the Corvette one of the mod cars I added to the packge (from another mod which I was running) became the safety car...

3. do I have to do this with road course stuff too? I just tried a road course race without packaging and it seems FCY works now (I turned off the stockcar dll) which is interesting because few weeks ago when I last tried FCY never stopped for me so the cars kept going around behind the safety car until the time was up.

Again thanks.

1. That's interesting. Not something I've ever experienced. Or, there are mods that have their own SC, that might be something that kicks in here.

3. We don't use SC on Road Courses in our club racing, and I only started checking out the stock car rules stuff for an oval race we did last year. I don't actually play rF2 (or any other sim) offline, so I'm not of much help there. Safety car is somewhat down to the track as well though. There's one Kyalami mod track where we've had to have standing starts in our club races (we normally have rolling starts), because the SC never goes in (so even though we've disabled the SC, the green flag never appears).

"Using the vanilla Stock Car Rules plugin that ships with rF2, in my (and others') experience, an FCY is not immediately thrown like it should be. Even with a large accident. Instead, often, if not always, only a local yellow is thrown."

OK, but I was asking about the rfm packaging thingy. :) If I simply replace the old dll with the new one (in the rF2/Bin64/plugins directory) you provided isn't that enough? Why do we need the packaging? That StockCarOval.rfm file consist some info which needed I guess?

That way it doesn't interfer with anything other. The rfm and own mod is strictly to keep the rules to that config only. That way you can make changes to the settings, and call it, let's say IndyOval.rfm and have other rules for that and so on :)

You don't have to do it, but this way you have a bit more control over it so to speak.
 
Also, I've just had a thought. If the folks who worked on the updated StockCarRules plugin provided permission, it would be a great thing if this updated plugin and any future updates (and its accompanying guide) were posted here on RD for easy access and wider visibility to the community in the rF2 Plugins downloads section.

Any chance this might be possible? If so, is there anything I could do to help to make this happen?

I'll ask :)
 
Hey, i installed the mod as described, which works. I can select it in rf2.

I tried to check how this would work with the AI on indy with the new indycar official content.

After a while there is a crash, but it doesnt work like it should. Everybody just crashes into the crashed cars.... see the pics in the next post and the red car that just crashes into the pile...

I do get a fc yellow with safety car, but 8 cars retired due to this incident...

Any advice on what to change so this stops happening?
 
Last edited:
Hey, i installed the mod as described, which works. I can select it in rf2. I tried to check how this would work with the AI on indy with the new indycar official content. After a while there is a crash, but it doesnt work like it should. Everybody just crashes into the crashed cars.... see the pics in the next post and the red car that just crashes into the pile... I do get a fc yellow with safety car, but 8 cars retired due to this incident... Any advice on what to change so this stops happening?
Thanks for trying this out! And happy to help :)

So first, a small clarification. Did the guide Ole provided to get a functional Stock Car Rules plugin work? As in, did it provide you (regardless of AI crashing) with a instantaneously-thrown full-course yellow and other oval racing rules? I believe, from what you say, the answer is yes. In which case Ole's tutorial did work as it 'should', in a way.

Sadly, there are two related but different issues at play here. First, there is a ruleset plugin changing when yellow flags are thrown and when pit stops are allowed. Second, there is AI behaviour.

rF2 developers (probably devs at Image Space Incorporated) clearly spent time coding at least some AI behaviour to go along with the ruleset plugin - following a pace car in single or double file, pit strategy, and so on. But we can't know how far they went with this. If they wanted the AI to slow down quickly after a FCY or evade accidents differently once one is thrown, they would need to have explicitly coded this. And your experience suggests that they did not.

If only the patched plugin provided in Ole's guide could instantly provide a compelling AI racing experience on ovals in rFactor 2. It fixes several major issues - local yellows and irrelevant blue flags - but is not a panacea. :redface:

In my opinion, as of today in 2022, for oval sim racing with AI, 20 years later, your best bet is still NASCAR Racing 2003 Season (a.k.a. NR2003). And it's not even close. Plus, there are Indycar mods (albeit of limited realism :p) for NR2003. Just the other day, I tried some AI racing in rFactor 2 at Indianapolis with the Stock Car 2018X, then hopped into NR2003 and did a short race with AI. rF2 has much better driving feel (as you would expect :roflmao:) but my Lord, the AI racing in NR2003 just feels right and instantly put a smile on my face... whereas in rF2 I was trying to look past issues like AI in a 'train track' line, weirdly inconsistent pace lap to lap, and AI cars slamming into walls on corner exit. Studio 397 could fix my and your issues with oval racing AI if they devoted time and effort... but sadly I've seen little evidence to suggest this is something they intend to do.
 
Last edited:

Latest News

Do you prefer licensed hardware?

  • Yes for me it is vital

  • Yes, but only if it's a manufacturer I like

  • Yes, but only if the price is right

  • No, a generic wheel is fine

  • No, I would be ok with a replica


Results are only viewable after voting.
Back
Top