PDA

View Full Version : rFactor 2 Unofficial Features



The Iron Wolf
26-01-2019, 22:44
Version 4.9.6.4 of the Crew Chief includes new rFactor 2 specific features. Basically, CC now has access to Message Center and track Pitlane Speed Limit data.


However, those features are off by default, because:


* Data is extracted by using unofficial means, not via rF2 Internals API. Since that is not supported, use this functionality at your own risk. It could potentially crash rF2, corrupting .json files, especially after game updates. I suggest having your .json files backed up. You've been warned :)

* Only English Message Center strings are recognized, if you are using another UI language, some functionality may not work.


To enable:
* Start Crew Chief in rF2 mode and allow it to update rF2 plugin.
* Start rF2 and exit the game (this will update CustomPluginVariables.json).
* set EnableDirectMemoryAccess: 1 in CustomPluginVariables.json
* if you want message center features, MC needs to enabled. I only tested "Message Center Detail":3 in player.json.


Here's how SM plugin configuration should look like (space before " Enabled" is required):


"rFactor2SharedMemoryMapPlugin64.dll":{
" Enabled":1,
"DebugISIInternals":0,
"DebugOutputLevel":0,
"DedicatedServerMapGlobally":0,
"EnableDirectMemoryAccess":1,
"EnableStockCarRulesPlugin":0
}


Recognized MC messages:
"Crew Is Ready For Pitstop"
"Headlights Are Now Required"
"Stop/Go Penalty: Cut Track"
"Stop/Go Penalty: Speeding In Pitlane"
"Drive-Thru Penalty: Speeding In Pitlane"
"Stop/Go Penalty: False Start"
"Stop/Go Penalty: Exiting Pits Under Red"
"Stop/Go Penalty: Illegally Passed Before Green"
"Disqualified: Driving In Dark Without Headlights"
"Disqualified: N Laps"
"Enter Pits To Avoid Exceeding Lap Allowance"
"Wrong Way"
"Warning: Driving Too Slow"


Pitlane Speed Limit
CC will announce speed limit on pitlane approach (CC tries to guess that you approach pitlane, it won't always work on all tracks). Also, there's new voice command to ask about pitlane speed:


what's the pitlane speed limit
what's the pit speed limit
pit speed limit


CC will consider tracks with Speed limit above 200kph as having no speed limit.


Next steps:


I'll be adding more messages as I catch them.
I'll try making Stock Car Rules plugin work in both offline and online sessions.
Will see if it is possible to calculate optimal tire/brake temperatures based on static curves for currently selected car/tires/upgrade.



Big thanks:
Jim for recording a lot of new sounds
Morten our CCMC colleague for his technical expertise and code contributions that made this feature possible
@Nibo (rF2 Log Analyzer author) for a lot of work he put in testing this stuff and collecting traces

The Iron Wolf
12-02-2019, 20:11
Version 4.9.6.6 of CC improves support for Stock Car Rules plugins (both official and evolving one by Matt Sentell).

To enable SCR support make sure "EnableDirectMemoryAccess" is enabled in SM plugin (see the first post), and make sure "Use American terms" option is enabled in the CC's preferences. For best experience, it is also recommended that oval tracks are mapped and marked as "isOval" in trackLandmarks.json file (most already are).

Note that old functionality of hosting SCR plugin is removed from the Shared Memory Plugin and is no longer supported. New functionality is based on reading text directly from the Low Speed Indicator. Note that LSI does not have to be visible for SCR messages to get picked up by CC. The best part is that this approach should work in both offline and online sessions.

If you notice an issue, please provide CC trace and log file with your report.

Special thanks goes to Mike Schreiner for the initial testing of this feature.

The Iron Wolf
31-03-2019, 20:20
CC update 4.9.7.2 enables order messages during Rolling/Formation and Full Course Yellow phases in the online sessions. Make sure "Frozen order" messages are enabled in CC preferences. And, this feature also needs EnableDirectMemoryAccess plugin feature enabled.

Special thanks goes to Brent Owen from HHRL, Brent collected a lot of traces and provided quality feedback that helped implementing this functionality :)

Seven Smiles
15-04-2019, 17:43
Version 4.9.6.4 of the Crew Chief includes new rFactor 2 specific features. Basically, CC now has access to Message Center and track Pitlane Speed Limit data.


A gotcha: Player.json setting


"Message Center Detail":3,

I had it 0 for some reason, that meant the Message Centre didn't warn me that I didn't have my headlights on and so neither did Crew Chief. First I knew about it was when I was DQ'd and dumped into the pits.



* Only English Message Center strings are recognized, if you are using another UI language, some functionality may not work.


There is another message "TURN ON HEADLIGHTS NOW". Yes, it really is ALL CAPITALS - maybe Crew Chief could shout? ;) With copious swearing for the sweary option of course :mad:

The Iron Wolf
15-04-2019, 18:00
A gotcha: Player.json setting


"Message Center Detail":3,

I had it 0 for some reason, that meant the Message Centre didn't warn me that I didn't have my headlights on and so neither did Crew Chief. First I knew about it was when I was DQ'd and dumped into the pits.



There is another message "TURN ON HEADLIGHTS NOW". Yes, it really is ALL CAPITALS - maybe Crew Chief could shout? ;) With copious swearing for the sweary option of course :mad:
Yes you are right, MC detail has to be on max which is 3.

If Jim feels like angry yelling and cursing I'll gladly add that message :D It pops when one ignores headlight warning, right?

Seven Smiles
15-04-2019, 20:24
Yes, this is the log. I saw it, I think it came after the second "Headlights Are Now Required". Because "message was already processed" Crew Chief doesn't repeat that message and it ignores "Turn On Headlights: JOY1 B18" so there is only one warning. rF2 warns 5 times altogether but [edit: yes you can] in VR you can't see the chat box that has the warnings so I am relying on Crew Chief.



18:24:10.573 : MC Message: processed - "Headlights Are Now Required"
18:24:10.966 : Playing sounds, events: penalties/warning_headlights_required
18:24:10.966 : (penalties/warning_headlights_required)
18:24:13.645 : MC Message: ignored - "Turn On Headlights: JOY1 B18"
18:24:16.915 : Fuel use per minute (basic calc) = 0.924 fuel(liters) left = 72.101
18:24:20.789 : Playing sounds, events: COMPOUND_sectorFlagChange_Sector2
18:24:20.789 : (flags/yellow_flag)
18:24:28.570 : MC Message: ignored - "Turn On Headlights: JOY1 B18"
18:24:29.984 : Playing sounds, events: COMPOUND_localFlagChange_clear
18:24:29.984 : (flags/green_flag_sector_2)
18:24:35.615 : MC Messages: message was already processed - "Headlights Are Now Required" Elapsed seconds: 25.04
18:24:36.637 : Leader fast lap - this lap time = 99.65205 session best = 99.65205
18:24:36.637 : Using hundredths for laptime of 01:39:652
18:24:37.032 : Playing sounds, events: COMPOUND_leader_good_laptime
18:24:37.032 : (opponents/the_leader_has_just_done_a, insert_pause:50, numbers/1_39, numbers/point65)
18:24:50.226 : MC Message: processed - "Disqualified: Driving In Dark Without Headlights"
18:24:50.619 : Playing sounds, events: penalties/disqualified_driving_without_headlights
18:24:50.619 : (penalties/disqualified_driving_without_headlights)
18:24:53.420 : Playing sounds, events: flags/black_flag
18:24:53.420 : (flags/black_flag)

(In my Rift VR the view is much brighter, coupled with Daylight Running Lights on the LMP2 car I was driving meant I didn't know I didn't have my headlights on.)

Seven Smiles
16-04-2019, 15:31
It's actually "TURN ON HEADLIGHTS NOW: JOY1 B18"

The Iron Wolf
16-04-2019, 17:30
It's actually "TURN ON HEADLIGHTS NOW: JOY1 B18"
How soon does this message pop up after initial Headlights are required message? I've concern that it comes too soon, and will produce a message overload, I believe that's why I did not add it initially.
Also, I am guessing you are a programmer - you are welcome to submit pull requests, just respect the way surrounding code is written and keep it consistent. If you are on Discord, we could chat about rF2 CC stuff, rF2 is very dev friendly sim. I would like to spend some time poking around VR stuff, so my CC activity will slown down a bit for next couple of months.