How to fix rF2 stock car rules

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.
Hi MJQT, yes the stock car rules plugin seems to work. I get a full course yellow and the cars follow the pacecar untill it goes in the pit.

I am not sure if it is 'instantaneously', but the ai does slow down ultimately for the pacecar. Have to give it a look again how long that takes.

What may be an option is to look at the files that determine how long a crashed part/car is displayed on track... Maybe i can lower that, reducing the 'additional' crashes due to AI not reacting to crashed cars

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.
What do you mean with ruleset plugin?
As for AI behaviour and how much rf2 developers spend time on this... Well i know from the past that it wasnt working for ovals, but i must say i am a bit surprised that the developer now sells a new indycar mod with focus on indianapolis that does still does not have a basic functionality for (or solution to) oval racing....

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.

Imo Iracing offers a good solution for offline oval AI racing. Full course yellows, safetycar, pitstops, strategy the game has it all. I just hate it that i can't save the game during a 500 mile race (with family life & work i'm just happy to do 1 full race spread out over the week).
 
Set AI Limiter.
Set at 0 is fantasy, that is saying all cars are equal.
In reality that could not be further from the truth.
Set to 0 you get more trains.
Set higher AI will spread out.


People also lower aggression when they should be putting it higher.
Set too low the cars will make half hearted runs to overtake and get caught in no mans land.
Set higher AI are more decisive .

What you set does not make for better racing all combos
You must test and adjust again.

I think most just can't race to that pace as soon as someone says AI are ramming me I know it's them at fault.

imho ACC and AMS2 AI behave like robots.
Just do 5 race restarts and watch it is so patently obvious.
 
Last edited:
What do you mean with ruleset plugin?
I just mean the StockCarRules plugin we've been talking about, that's all :) Sorry, didn't mean to be confusing. Just meant to say that there are racing rules and AI behaviour, and although they're related, they are somewhat separate issues.

What may be an option is to look at the files that determine how long a crashed part/car is displayed on track... Maybe i can lower that, reducing the 'additional' crashes due to AI not reacting to crashed cars
Perhaps! Let me know if you find anything. This is over my head to offer advice about, though.

As for AI behaviour and how much rf2 developers spend time on this... Well i know from the past that it wasnt working for ovals, but i must say i am a bit surprised that the developer now sells a new indycar mod with focus on indianapolis that does still does not have a basic functionality for (or solution to) oval racing....
You and me both. :redface: Don't forget they also have first-party Stock Car mods in the Steam Workshop and a first-party DLC track for Daytona, including the oval. Single player is just not their focus.

Now, in fairness, as @Durge Driven would tell you, if you spend lots of time tweaking parameter values, it is perhaps sometimes possible to get a rewarding AI experience with specific car and track combos. I'm unconvinced this is possible on ovals in rF2 at the moment, but @Durge Driven said in another thread that he had a satisfying Indycar oval racing experience at one point, so I may be wrong.

For more discussion on the Indycar oval racing AI experience at Indianapolis (and see Durge's post I mentioned) I'd suggest to switch to this thread below dedicated to that subject, so as to not clutter up this thread with a different topic :)

Imo Iracing offers a good solution for offline oval AI racing. Full course yellows, safetycar, pitstops, strategy the game has it all. I just hate it that i can't save the game during a 500 mile race (with family life & work i'm just happy to do 1 full race spread out over the week).
This is a great point - I forgot about iRacing's now-solid AI, my bad :)
 
Last edited:
Yes thanks.
Some will say I think rF2 is 99% when I will always add some provisos.
Best I think, it's "many warts and all" also vast hidden treasure.

Like take forced setup and/or changing fuel rate.
2x-7x Is okay but in *.plr you set fuel rate of AI to the decimal.
UI you at least double the stint laps (2.0x) where as in *plr
you can add as little as 1 lap to a 10 lap stint.
 
Just to add, i did some testing with the stockcar rules, now with the CART 1998 mod. What i found was that if i put the plugin in the correct folder and not do the whole mas thing then the safety car does NOT work in this scenario. I am not sure if it is due to the plugin not working or due to issues with the safety car in the cart 98 mod, but i dont get a sc.

So after that i tested the plugin via making the mas thing as described in this topic. I made sure i selected the pacecar in the list AND did what Bela described in post #17 as well (changed the pacecar name in the rfm).
After completing the whole process i tested the CART 98 mod again and now the plugin does work!

I tested it by not qualifying myself and retiring within a lap, and then let the AI race for a simulated 3 hour race at Michigan (close to 500 miles). I had a bunch of safetycars period. Everytime it happened i looked at the replay and the yellows and SC get out quickly and without many issues. The only thing i didnt really understand is sometimes there was a SC as a result of an AI retiring due to technical issues and in other instances an AI retired due to technical issues and no SC was issued.

I did one thing to make sure the AI worked ok-ish with the yellows:
* In the player.json file i set the vehicle removal time to 2 seconds (meaning after a crashed car stopped the debris/car will be removed within 2 seconds, greatly reducing the chances the AI will crash into it). I think it was 30 secs before.
 
Last edited:
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.
I'm in the middle of modifying the Indianapolis AIW and I'm done with Pocono and Auto Club Speedway (it's Apple Valley in the workshop). I do these for myself.
So what I concluded so far is that AI oval racing in rF2 can be very good (honestly superb) but you have to have a good AI fastpath and you need to modify some parameters in the AIW file because the defaults are not good.
If you think about it every modder and even ISI/S397 use the same parameter values for every single track no matter if it's a road course or an oval, if it's long or if it's short, narrow or wide, with slow corners or fast corners. You can't entirely blame them because almost nobody knows what these parameters do, ISI didn't care to write a know-how. So I had to experiment.

Another thing is the Indy fastpath is not fit for the Stock Cars or the IR18 because it was made for/by the DW12 by ISI (you can check the recorded speed of the waypoints, it's 360+ kmh even in corners), it's a superfast car with super high downforce so it's not a surprise almost every other cars are slow in corners, hit the wall, etc. because they understeer without slowing down a bit before corners.
After modifying these tracks my only last problem with the AI is that they rarely overtake with slipstreaming and no, the AIDraftStickiness doesn't change that.
 
Last edited:
Set AI Limiter.
Set at 0 is fantasy, that is saying all cars are equal.
In reality that could not be further from the truth.
Set to 0 you get more trains.
Set higher AI will spread out.
The AI limiter works exactly the opposite way as you described. The lower the value the AI cars will spread out more. :) The spread is decided based on the talent files found in the car mod. The problem comes when a modder does the mod for online racing only and doesn't make a proper AI talent file.
Higher value means long trains because the game will artificially make the AI drivers talents/speed closer.
 
Last edited:
on second thought forget it, other day I just put up a 5 lap race at 0 limiter and they spread out heaps...so ? Yes every combo is different 100% in one mod/track is 120% in another
 
Last edited:
I'm in the middle of modifying the Indianapolis AIW and I'm done with Pocono and Auto Club Speedway (it's Apple Valley in the workshop). I do these for myself.
I didn't know you could modify the AIW files for Steam Workshop tracks from Studio 397 (like Indy) or ISI (like Apple Valley) yourself. I thought they were encrypted and un-modifiable. So that's a great discovery if they are in fact modifiable. :)

I really hope you find some means of sharing these with the community. I, for one, would love to experience better oval racing with AI in rF2. Perhaps you could make a cloud storage (e.g. MEGA, Google Drive) folder, upload these updated AIW files, and you could share a link on the Studio 397 forums?

If you think about it every modder and even ISI/S397 use the same parameter values for every single track no matter if it's a road course or an oval, if it's long or if it's short, narrow or wide, with slow corners or fast corners. You can't entirely blame them because almost nobody knows what these parameters do, ISI didn't care to write a know-how. So I had to experiment.
I mean, I think you can blame them for not trying to find the parameters that actually work with their own game engine. That's what they're paid to do as developers. And it's what you're paying for when you buy the game and DLC content from them.

But yeah, there's no how-to manual on what all these parameters mean. I've been learning about and working on AIW modifications and parameter settings for rFactor 1 and Automobilista recently, so I understand exactly where you're coming from.

Would you be willing to share what you changed about the AI fast paths and AIW parameters to get a better oval experience? I'd be really interested to know more. :) It would probably be best suited to be posted in a new separate thread, though.

Another thing is the Indy fastpath is not fit for the Stock Cars or the IR18 because it was made for/by the DW12 by ISI (you can check the recorded speed of the waypoints, it's 360+ kmh even in corners), it's a superfast car with super high downforce so it's not a surprise almost every other cars are slow in corners, hit the wall, etc. because they understeer without slowing down a bit before corners.
Are both the Indy layouts (Brickyard and Oval) made for the DW12? Logically, "Oval" should be for Indycars, while the "Brickyard" (as in the Brickyard 400) should be for NASCAR-like stock cars. If they were both made for the DW12, that's just odd IMO.
 
Last edited:
I didn't know you could modify the AIW files for Steam Workshop tracks from Studio 397 (like Indy) or ISI (like Apple Valley) yourself. I thought they were encrypted and un-modifiable. So that's a great discovery if they are in fact modifiable. :)

I really hope you find some means of sharing these with the community. I, for one, would love to experience better oval racing with AI in rF2. Perhaps you could make a cloud storage (e.g. MEGA, Google Drive) folder, upload these updated AIW files, and you could share a link on the Studio 397 forums?


I mean, I think you can blame them for not trying to find the parameters that actually work with their own game engine. That's what they're paid to do as developers. And it's what you're paying for when you buy the game and DLC content from them.

But yeah, there's no how-to manual on what all these parameters mean. I've been learning about and working on AIW modifications and parameter settings for rFactor 1 and Automobilista recently, so I understand exactly where you're coming from.

Would you be willing to share what you changed about the AI fast paths and AIW parameters to get a better oval experience? I'd be really interested to know more. :) It would probably be best suited to be posted in a new separate thread, though.


Are both the Indy layouts (Brickyard and Oval) made for the DW12? Logically, "Oval" should be for Indycars, while the "Brickyard" (as in the Brickyard 400) should be for NASCAR-like stock cars. If they were both made for the DW12, that's just odd IMO.
I can start older and free tracks in devmode but not the DLCs. I can't load into devmode Donington for example... :(
I was mainly talking about 3rd party modders in regards to "blaming". :) But in the case of S397 you' re right, they should know. However I think they're just as much modders when it comes to content as any other they just have to make higher quality content because they get paid but I think in terms of the AI they just copy-paste old ISI-stuff.
Altering the AI path is a long and frustrating process... if you want it to work with all types of different cars then you need to make a fastpath with a car with low(-ish) downforce. Then you have to modify the speed of the different waypoints one by one in corners so the AI always use less then 100% of the available grip (around 80% is good). I talked about the parameters here: https://forum.studio-397.com/index.php?threads/ai-slipstream.70595/#post-1103899
Just a hint: when you're driving a car in devmode you will see three lines moving around in front of the car. The yellow line shows you the particular waypoint the AI is "reading" at the moment.
At Indianapolis both the Oval and the Brickyard uses the same path, it seems logical because it's the same track (I think they made one and they used that for both of the layouts) but as you said irl they use them with different cars so they should've made a different AIW fastpath for the Brickyard.
 
Last edited:
I really hope you find some means of sharing these with the community. I, for one, would love to experience better oval racing with AI in rF2. Perhaps you could make a cloud storage (e.g. MEGA, Google Drive) folder, upload these updated AIW files, and you could share a link on the Studio 397 forums?
When I'm ready I will upload the files.
I've been struggling with Apple Valley. The problem was that the track is too bumpy in certain parts of the road in the two turns and since the AI has this cardboard box kinda physics they bounce all over the place which causes grip loss for them and so I had to slow them down substantially to the point they became uncompetitive. I tried everything earlier, my AIW file is at version 50 :D I made so many different fastpaths and I couldn't make them faster...
I almost gave up but then I looked into the TDF file and modified the parameters for the bumpy road (bumpamp and bumpwavelength) and now it's much better. I lose some bumpy FFB effects but at least I will be able to have good races. Now I just have to redo everything on this track... :D
 
Last edited:
since the AI has this cardboard box kinda physics they bounce all over the place which causes grip loss for them and so I had to slow them down substantially to the point they became uncompetitive. I tried everything earlier, my AIW file is at version 50 :D I made so many different fastpaths and I couldn't make them faster...
I wonder if there's a way to enhance the collision detection on the Stock Cars. I read this about "feeler flags" for GTR 2 recently, and your "cardboard box" comment made me think of it:

Don't forget the AI's on-off throttle and brake pressing in rF2 (as if they were driving with a keyboard), which will slow them down in gentle, sweeping, low-banked corners like at Auto Club. We may just need to run them at a higher Strength percentage. That, or maybe you can raise the BestAdjust, MidAdjust, and WorstAdjust values (or whatever those lines in AIW files are called in rF2)?

I almost gave up but then I looked into the TDF file and modified the parameters for the bumpy road (bumpamp and bumpwavelength) and now it's much better. I lose some bumpy FFB effects but at least I will be able to have good races. Now I just have to redo everything on this track... :D
This is a great trick to know! Interesting. As you accumulate this know-how, I'd suggest making a separate thread of your own in the rF2 forum here or the S397 forum to better share these tidbits with others :)
 
Last edited:
Don't forget the AI's on-off throttle and brake pressing in rF2 (as if they were driving with a keyboard), which will slow them down in gentle, sweeping, low-banked corners like at Auto Club. We may just need to run them at a higher Strength percentage. That, or maybe you can raise the BestAdjust, MidAdjust, and WorstAdjust values (or whatever those lines in AIW files are called in rF2)?
Thanks, I know about this. :) I gave these Adjust parameters 1 / 1.2 / 1.4 values since the beginning and I also tried the AISpec with all sorts of different values but didn't matter. Btw if I set the Adjust parameters too high then they become too fast in T1 compared to T2, the bouncing AIs in T2 are hilarious, they have no grip.
I knew about the TDF parameters because I made some tracks a few years ago but until now I thought that the road mesh itself is bumpy but I loaded the track into 3dsimed and then I saw that those bumpy parts of the road have different material name with RDR prefix which refers to the bumpy road in the TDF so it's not the road mesh. I wouldn't modify the TDF file in normal circumstances because I don't want to modify the track itself but I have to on this track if I want a good AI. Btw I suspect this is the case with the Tchachalowski version too.
 

Attachments

  • apple3dsimed.jpg
    apple3dsimed.jpg
    513.7 KB · Views: 54
Last edited:
OK, so. I'm sharing my patch for Apple Valley because I'm done with the fastpath. I'm not 100% sure about all the AIW settings so I think I will play with those more later on.
I tested this patch with:
- Stock Car 2018 and 2018x
- Indycar DW12 and IR-18
- Classic Stock Car by Machine
- S397 GTE cars and Cadillac DPI-VR :D
Recommended settings:
AI Mistakes ~1 in player.json (if you want some AI mistakes)
AI Logic Override 1 in player.json (important!!!)
AI Limiter 1
AI strength ~100 for Stock Cars (I run ~39s laptimes with the 2018, if you're new to the track then less than 100)
AI strength ~85-90 for Indycars


Put the file in the rFactor 2/Packages folder, you can install it in the game and later you can uninstall it from there like it was never installed before.
Let me know what do you think.
 
Last edited:
OK, so. I'm sharing my patch for Apple Valley because I'm done with the fastpath. I'm not 100% sure about all the AIW settings so I think I will play with those more later on.
Solid progress! :thumbsup: Installed your mod and player.JSON tweaks. AI no longer bounce (except a teeny bit occasionally on T1 entry) thanks to your TDF tweaks, and the fast line works great with the Stock Cars. Actually had some fun racing the AI at 105% (I can run low 39s). :) To be realistic to how real-world NASCAR races at Auto Club (here's a link to the 2018 Cup race) I set the AI Limiter lower (30%) to get more field spread, and I think you could set it even lower, probably.

I'd suggest next investigating AI corridors (to see if you could help them use more of the track width) and how to get the AI to leave a little more room beside you (probably a "lateral distance" AIW parameter?). I'm also certain I read somewhere about a setting (either in AIW or RCD) to increase AI line variability, but I can't find it now on the Internet for the life of me :roflmao: If I find it, I'll let you know.
 
Last edited:
Solid progress! :thumbsup: Installed your mod and player.JSON tweaks. AI no longer bounce (except a teeny bit occasionally on T1 entry) thanks to your TDF tweaks, and the fast line works great with the Stock Cars. Actually had some fun racing the AI at 105% (I can run low 39s). :) To be realistic to how real-world NASCAR races at Auto Club (here's a link to the 2018 Cup race) I set the AI Limiter lower (30%) to get more field spread, and I think you could set it even lower, probably.

I'd suggest next investigating AI corridors (to see if you could help them use more of the track width) and how to get the AI to leave a little more room beside you (probably a "lateral distance" AIW parameter?). I'm also certain I read somewhere about a setting (either in AIW or RCD) to increase AI line variability, but I can't find it now on the Internet for the life of me :roflmao: If I find it, I'll let you know.
Thanks. Believe me I watched a few real Nascar races and iRacing races to know how they look like. :) Earlier I had a version with a middle-ish running fastpath and a 20 meter wide AI line variability. It was fun but too easy to beat because the AI made too many mistakes.
For the AI limiter I suggested 1, that's the lowest (except for 0). :)
The AI line variability you are referring to is the parameter called "acceptabledriverlinenoise". By defaults it's 0.5 on every track. I've set it to 1.5, it's in meters on both sides of the fastpath (so it's 3 meters wide on this track with my patch). I tried it all they way up to 9.99 (so overall 20 meters wide) and the problem is if you set it too high 1. they are more likely to hit the wall 2. they are more likely to lose control of the car, usually they understeer so they have to slow down too much most of the time in T2. Using a high value can be fun, it looks good but that's also not really realistic.
More room beside me? I don't know about any parameter that does this.
There is a parameter called Lanespacing and I couldn't figure out the purpose of this. I've read that this should do the trick, I tried it 0.1, 1, 5 and 10, nothing changed, at least nothing I could notice. :D

edit: about the bouncing. I couldn't eliminate it completely because it turned out that in fact there are some bumps on the road mesh so it's not just in the TDF. The TDF helps but can't remove all the big bumps.
 
Last edited:
For the AI limiter I suggested 1, that's the lowest (except for 0).
Oh dear, my mistake. I had one race with 30% limiter where I felt like the AI spaced out much more, but it must have been an outlier.

The AI line variability you are referring to is the parameter called "acceptabledriverlinenoise". By defaults it's 0.5 on every track. I've set it to 1.5, it's in meters on both sides of the fastpath (so it's 3 meters wide on this track with my patch). I tried it all they way up to 9.99 (so overall 20 meters wide) and the problem is if you set it too high 1. they are more likely to hit the wall 2. they are more likely to lose control of the car, usually they understeer so they have to slow down too much most of the time in T2. Using a high value can be fun, it looks good but that's also not really realistic.
I see! Your approach seems sensible :)

There is a parameter called Lanespacing and I couldn't figure out the purpose of this. I've read that this should do the trick, I tried it 0.1, 1, 5 and 10, nothing changed, at least nothing I could notice. :D
Sounds like that should be the right parameter... that's unfortunate it seems to do nothing.

about the bouncing. I couldn't eliminate it completely because it turned out that in fact there are some bumps on the road mesh so it's not just in the TDF. The TDF helps but can't remove all the big bumps.
That's a good thing, cause the detailed road mesh and FFB of rF2 is one of the main draws over an old sim like NR2003 for offline oval racing :)
 
OK, so. I'm sharing my patch for Apple Valley because I'm done with the fastpath. I'm not 100% sure about all the AIW settings so I think I will play with those more later on.
I tested this patch with:
- Stock Car 2018 and 2018x
- Indycar DW12 and IR-18
- Classic Stock Car by Machine
- S397 GTE cars and Cadillac DPI-VR :D
Recommended settings:
AI Mistakes ~1 in player.json (if you want some AI mistakes)
AI Logic Override 1 in player.json (important!!!)
AI Limiter 1
AI strength ~100 for Stock Cars (I run ~39s laptimes with the 2018, if you're new to the track then less than 100)
AI strength ~85-90 for Indycars


Put the file in the rFactor 2/Packages folder, you can install it in the game and later you can uninstall it from there like it was never installed before.
Let me know what do you think.
thank you very much for editing this track, is really great fun!

apparently there is a slight issue with the AI when their outlap line merges with racing line... must be too harsh/rough because they slow down massively.... which is a bit annoying..
maybe you can fix this
thx
Lars

have figured it out by myself and created an update now!
 
Last edited:

Latest News

What's needed for simracing in 2024?

  • More games, period

  • Better graphics/visuals

  • Advanced physics and handling

  • More cars and tracks

  • AI improvements

  • AI engineering

  • Cross-platform play

  • New game Modes

  • Other, post your idea


Results are only viewable after voting.
Back
Top