rFactor Motec Plugin

Lazza

rFactor (1) Motec Plugin - v1.10, 14th Feb 2012

Mirrors:
http://www.mediafire.com/download.php?kpzdtu803cxc005
http://www.gamefront.com/files/21330879/rF1MotecPlugin_14Feb2012_rar

'g' version (non-Trymedia version) patch:
https://www.dropbox.com/s/9g808ij800o24fz/MotecPlugin_patchedG.rar?dl=0

Installation

Extract the entire archive to your rFactor root folder. If done correctly you'll have the MotecPlugin.dll sitting inside your rFactor\Plugins folder.

You'll also find a Plugins\MotecPlugin folder containing a few sounds used to indicate logging progress (logging on/off, 'log building' completed - more info below), plus in your rFactor\ folder you'll have rFactorToMotec.exe for generating i2Pro track diagrams.

Once installed, load up rFactor to the menu (no need to go to the track just yet), quit out, and if the plugin is running correctly you'll find a MotecPlugin.ini in your rFactor folder. This contains some settings you might like to adjust, which I'll explain later.

Telemetry

For those not familiar with telemetry logging: you might have noticed on your HUD you can see things like your current average tyre temperatures, engine oil/water temperature, brake temps, etc. Also if you're using a GUI that has included the brake disc indicators you can exit back to the pits and see the current brake disc thickness, helping you work out the right setup parameters to maximise performance while minimising the risk of a failure.

That's all well and good, but what if you're so busy driving you can't keep an eye on your tyre temps? Or you do a 20-lap stint to check your brake wear... and then forget to look before changing the setup or heading back out on track? (gee, I did that a lot lol) What about all the other things you can't really see - ride height, suspension behaviour, or even how much throttle you used when you nailed a particular corner?

With telemetry logging you can look at laps you've driven and see exactly what was going on both at the controls and with the car itself. Instead of having to glance at the HUD mid-corner to see what your tyres are doing under load, and maybe Esc back to the pits to check the temperature balance across the tyre at that moment (and interrupt your run), you can bring up your tyre temp graphs and see how they changed over the course of a corner, or a lap, or a stint. If looking at the graph is a bit bewildering you can display the average temps (across each tyre) for the lap; if you'd prefer you can 'switch off' values when you were on a straight, and generate average temps during cornering; if you're really keen you can even separate left and right corners and check out exactly what your front left is doing over the course of a lap when it's actually being used - for example :p

Logging process

In real life the logger is activated before the car rolls out onto the track. Motec is therefore built around an expectation of having an out-lap, timed laps, and an in-lap. With a plugin we aren't limited to this, so you can switch it on for a lap (or a corner) if you wish, but be aware you might find some strange apparent laptimes if you do this.

To minimise memory use this plugin only stores a couple of seconds worth of data at any one time; it writes data out to a temporary file in 1-second chunks, and when you finish logging either by switching it off or exiting the car it will convert that file to an i2Pro compatible log file. (the log file format is such that generating it on-the-fly isn't possible).

In doing this conversion it places some extra load on the CPU, so the .ini allows you to set whether to start converting logged data while still in the car, plus how 'hard' to work both in-car and at the monitor. The good news it only takes a few seconds to convert an hour or two's driving at normal telemetry rates, but if you find your monitor updating slowly or rFactor 'hanging' on exit it will be the data conversion process.

Extra channels

This plugin will read extra values from the current downloaded rFactor .exe (v1.255f) including: brake disc thickness, steered angle (uses setup steering lock and current steering input), engine boost, brake bias, and it calculates an 'engine wear' figure as well (in seconds, so to put it in context you need to go and find out your engine's average life). I honestly don't know if this works with other versions of the .exe file. (I'm guessing not)

MotecPlugin.ini options

The MotecPlugin.ini file has comments which should be self-explanatory. If you need to revert to defaults just rename your .ini file and the plugin will recreate it on rFactor startup.

One point to note: There are two sounds to indicate log-conversion processing. 'One log built' is by default just a single beep, and indicates that one file was converted but more are pending. This is a leftover from a previous version of the plugin that did the conversion much more slowly; it's unlikely now that you'll manage to have more than one log conversion pending unless you collect several hours' worth of data and then collect a few short bursts, or you've disabled in-car file conversion and collect a number of logs before returning to the garage.

If you choose to switch logging off (and begin conversion) in the car and find your framerate suffers as the log file is converted, try reducing 'Duty log cycles'. Same goes for 'Idle log cycles' if you find your monitor struggling with the conversion, but it's usually better to suffer a few seconds of stuttering video than sitting and waiting for the log to be ready :)

'Data Rate' - rather than log all channels at the same rate, I've set the default rates to match those found in the log sample provided with Motec. You can reduce this setting to -1 or even -2 if you want to reduce the log file size, but you will lose resolution by doing this. "= 1" sets the rates somewhat higher, while "= 2" puts all channels on 90Hz. 0 or 1 are usually enough for most purposes.

Usage

If you've set logging to be active on startup, as soon as you jump in the car you'll hear beeps indicating logging is active.

Otherwise, hit Ctrl-M (or your own defined key) to switch logging on.

'Upwards beeps' = logging on. 'Downwards beeps' = logging off.

When logging is finished, either through switching it off or by exiting the car, you will hear the beeps indicating the log has finished being built (converted from the temp file) usually after a short pause. You can then open it up in i2Pro as you wish.

rFactorToMotec

This tool, which you will find in your rFactor folder after extracting the .rar, is to generate track maps for MoTeC.

Recent versions of MoTeC include GPS map capability. My previous plugin logged GPS position data which could be used to compare driving lines between laps - but to actually see the track itself you had to log the track edges manually, just like real life (drive around the entire track staying first on one side, then on the other, then select those laps and tell Motec what they are).

Not a huge chore for a single test track that isn't too long... but a headache for anything else.

So, if you run the tool (double-click rFactorToMotec.exe in the rFactor folder you installed the plugin to) it will go through the rFactor tracks present, read the layout data, and create Motec Track files in your Motec project folder.

It checks rFactor's config.ini first, so if you've changed to a custom tracksdir it will find it. (if for some reason it can't find a config.ini, it'll just look in all subfolders for tracks)

If you already have i2 Pro installed, and have opened up a project with it previously, the tool will find the project location using the registry and write all the track files into the appropriate place. It will write all track files into every project folder it finds. (if you don't have i2 Pro installed yet, or haven't loaded a project into it, the tool will create a new Motec Tracks folder in your rFactor install and write all the tracks there. You'll have to move them to the appropriate project folder yourself - or run the tool again after installing and running i2 Pro)

If you install a new track and want to generate the map for Motec, just run the tool again. It will find all the tracks but will ask if you want to overwrite each one - hit the 'z' key (for 'no to all') and it won't overwrite any existing files, just the new ones. (that way any custom sectors you've set up for existing tracks won't be lost)

Finally, to avoid conflicts, both the Plugin itself and the tool append a checksum to the track name. Since various versions of a particular track can have the same track name (pretty sure I have several Barcelonas, for example) this avoids getting the wrong map for your particular layout. It just means the track name in Motec might be something like "Barcelona qmq5w1".

Issues

- Logging is done in 1-second chunks. If you Escape as soon as you cross the line you might not get the laptime recorded. So just leave a few seconds either side of laps :)
- If rFactor crashes and you're left with just the .ldtemp file, the plugin won't try to convert it later.
- I don't use UAC. I don't know how it affects things.

Disclaimers

First, I don't offer any guarantees on this plugin's performance, ability to work ;), or it not formatting your hard drive. I've used it for many many hours without issue but computers are weird things. If you have a problem I'm not promising to fix it.

Second, the EULA for i2Pro states it's not to be used with data generated by non-Motec devices. While strictly speaking I don't think this falls into that category as it's not replacing a Motec 'device' (read: plugin) you should be aware Motec doesn't support the use of i2Pro with rFactor logs. Do NOT ask them for help!!!

Feedback is welcome :)
 
Last edited:
Much appreciated Lazza, looking forward to giving this plugin a run tonight. Cheers mate ;)
 
This is great, thank you!
Exactly what I've been looking for since I started playing with telemetry.

By the way - do you know if it is possible to import/convert KML or GPX files (GPS logs created by "casual" gps receivers) and to use them as track outlines?
 
Last edited:
I've edited the first post to better suit my insanely-long-post trademark, not really much else to say on the matter.

If you're new to Motec/i2Pro please take your time - it's a powerful tool but can be daunting, so don't expect to master it in 5 minutes.

By the way - do you know if it is possible to import/convert KML or GPX files (GPS logs created by "casual" gps receivers) and to use them as track outlines?

I'm not familiar with those files, so I can't really comment on how difficult they would be to 'convert'. It's possible someone has already done it for real-life applications - but therein lies my next question: what use would real-life GPS logs be for a simulation?
 
I'm not familiar with those files, so I can't really comment on how difficult they would be to 'convert'. It's possible someone has already done it for real-life applications - but therein lies my next question: what use would real-life GPS logs be for a simulation?
I wanted to make a more detailed track-map for Motec, so I thought it would be a good idea to make a raster map of the track, calibrate it to same coordinates as in the game, draw a route in some GPS software and use this route in Motec :) But Motec only accepts track routes from Motec log files.
But I understand it's an issue with Motec and has nothing do to with rFactor or your plugin so It's not the best place to ask.
 
Ah, I see.

Have you tried the rFactorToMotec tool I included? It generates the 3 'lines' for tracks (driving line, left and right edges) using the AIW (so approx 5m resolution) and that's all Motec itself can really handle (can't specify kerbs or fences, etc)
 
Yes, it works fine :)
I read somewhere that they will be adding a feature to use raster maps (like google satelite images) in Motec but they haven't released any update since August.
 
Wow Lazza! Nice surprise. I hope it works with ISI's latest EXE that was released to enable the G27 LEDs. I will report back if it does later tonight.
 
If you have it setup to convert the log while you are on the track, would it be possible to use a second computer to snag the data and start looking at it while you are still on track? I run in an endurance league and it would be great if the other team mates could check the status of the car remotely.

I can't wait to get home to test. I could probably answer this question on my own.
 
Okay.. from what I can tell it will only convert the file when you exit to the monitor or hit Ctrl+M to disable logging. I was hoping it could convert the temp file every so many seconds or minutes. I guess I could just turn it on and off as I drive when every my team mates request data.
 
I hope it works with ISI's latest EXE that was released to enable the G27 LEDs. I will report back if it does later tonight.

Hmm... don't think I have that one. Can't say whether the 'extra' data (steered angle, brake discs, etc) will work on it.

Okay.. from what I can tell it will only convert the file when you exit to the monitor or hit Ctrl+M to disable logging.

Yep. That's what the first post says :)

I've followed the 'motec way' of logging entire runs. Potentially it could log each lap separately (or some other defined period, which could make a mess if it's less than a full lap) but they would be separate files; to add 1 lap to a 20 lap-log you'd have to rebuild the entire thing because each channel is written out in its entirety in the log files (so adding even 1 value to a channel means moving the entire next channel's data along, and again for the next channel, ...)

I'm curious: what sort of data would your teammates be looking at during a race? 90% of the telemetry is really only useful for tweaking a setup rather than any changes you might make during a stop, or strategy. Things like tyre wear or fuel are pretty easily relayed on voice chat by the driver - and tyre wear especially is probably more dependent on what the driver's feeling than anything else.
 
Our team would want to monitor tire wear, brake thickness (we have had to change brake bias to the rear to save the brakes before) and fuel load. Most of this stuff can be communicated of the radio but I suck at watching the pit menu and talking about strategy while trying to drive. I would rather them be able to peak in on there own without disturbing me. I started writing a plugin of my own for most of this stuff but never finished it. The brake thickness isn't something we have access to in the internals interface so that was the main thing I got excited about with your mem sniffing plugin.

I did some testing on my laptop and the plugin works fine. But it isn't generating the INI file on my racing rig. I have a feeling it is because I have the G27 exe. I will swap out the EXE and see what happens.
 
I put the old EXE back in place and the plugin still will not create an ini file. The track generator gives me a Side-By-Side error and I am sure the plugin DLL is compiled with the same dependencies. I have installed, re-installed, uninstalled every combination of the VC++ runtimes (x86 and x64) and can't resolve the Side-By-Side errors.
 
The plugin works fine on my laptop (also running Win7 Pro x64) so I used Dependency Walker to figure out which DLLs from the WinSxS directory where being used on my laptop and dropped those into my rFactor root directory on my race rig and it still gives me Side-By-Side errors.
 
Yeah, sorry mate, it's likely the build settings I've used (as was the case with my rF2 plugin) - I'll have a new build out shortly, just trying to track down an intermittent freeze/crash issue first.
 
Hello Lazza.
Maybe I missed something, but I found that breaks data are missing at all (driver input as well as pressures).
I've checked rf internals plugin and there are data for it. It is known issue or something else?
I've tested it with latest i2Pro.

BTW: where track maps are saved to, if generated before i2Pro is installed (and project existing)?
 
Great job Lazza. Providing new plugin to support latest i2Pro is something many have waited for so long. Thank you very much indeed.

I'd like to ask one question about those extra channels - is there possibility to grab tyre index number used ? That would enable to check what compounds are used during qual or race.
 
MaXyM, it generated them in "<rFactorRoot>\Motec Tracks" on my machine.
 
Yeah, sorry mate, it's likely the build settings I've used (as was the case with my rF2 plugin) - I'll have a new build out shortly, just trying to track down an intermittent freeze/crash issue first.

Updated version now in first post. I've used similar build settings to my more recent rF2 plugin versions which seem much more compatible with a range of PCs. Did similar with the track tool so hopefully it's a bit more robust too - also fixed a bug with it.

Oh, and this plugin doesn't keep its temp files anymore either - the rF2 plugin inherited that one and I've only just got around to fixing it here...

Maybe I missed something, but I found that breaks data are missing at all (driver input as well as pressures).
I've checked rf internals plugin and there are data for it. It is known issue or something else?
I've tested it with latest i2Pro.

Brakes definitely work. It could be some of the default graphs are looking for channels that aren't there (brake pressure front and rear, for example), but if you look in the channel list on the right (in most default views) you should see the brake data. So just a matter of getting it displayed.

BTW: where track maps are saved to, if generated before i2Pro is installed (and project existing)?

Noel's answered this, but I also detailed this in the first post.

I'd like to ask one question about those extra channels - is there possibility to grab tyre index number used ? That would enable to check what compounds are used during qual or race.

Not really something I'd thought about including, so now I have - each log shows the used tyre file in the Details section (under Vehicle Comments), and it logs the front and rear compound index (1-based). If rFactor lets you use different compounds left and right (I can't remember!) it uses the left only, sorry.
 
Thank you Lazza. I loaded data into default project of latest MoTeC and brake data were missing on graphs. Maybe you named channels other way than required by Motec. But if data are existing - it is not problem anymore. thanks
 
Wahoo!! It works perfect now. And thanks for deleting the temp files. I could see them adding up fast.

Thanks so much for your work on this!
 
One question about these maps that rFactorToMotec generates. For now I am just using the default "Circuit" project that comes with MoTeC i2Pro. I see the map but it doesn't look any different than the old gforce generated maps that MoTeC can generate on it's own. My understanding is that rFactorToMotec would generate a simulated GPS map with the inner and outer track boundaries. How do I display the map in this way and have my "driven" line be displayed on the map?
 
Never mind. I added a new worksheet and then added the "GPS Track" object and put a check in the driven, inner and outer check boxes. It will be cool to use this to overlay my laps to team mates to see what we can learn from one another.

View attachment 1157

One thing that is strange it the dropouts on the red line. This is an AI lap so maybe that is why it looks strange. I will have to drive some real laps when I get home tonight.
 
Last edited:
Cool.. I like how you have the wheel base in the details. I had to enter the wheel base into the details by hand to make the oversteer math work on the old MoTeC plugin.

This plugin is much better then the old MoTeC plugin.

Thanks again Lazza!
 
Updated version now in first post.

Not really something I'd thought about including, so now I have - each log shows the used tyre file in the Details section (under Vehicle Comments), and it logs the front and rear compound index (1-based). If rFactor lets you use different compounds left and right (I can't remember!) it uses the left only, sorry.

Wow, you are great Lazza :) Another thing that we've been waiting for so long. I can acknowledge tyre compounds channel works like a charm! So big thanks.

I can say that Brakes channel works ok, too. It's named Brake Pos instead of Brake Pressure, Maxym. But you can use mapping channels in Motec if you don't want to change project workbooks.

Little bug report:
1. Channel names inconsistency for tyres temperatures - centre/center.

Edit:
2. Slide Pct channels give weird readings - somehow reversed?
Take a look:
kT7MB.png

Cursor is placed on the straight.
 
Last edited:
Little bug report:
1. Channel names inconsistency for tyres temperatures - centre/center.

I mentioned this somewhere, I thought in this thread but obviously not - the default channels used for the tyre temp graphs have the centre/center inconsistency. So to have the data show up in the default project it needed to be that way, and I thought it was a neat way of avoiding a "which one is more correct?" argument, so I followed it for the rears too ;)

Edit:
2. Slide Pct channels give weird readings - somehow reversed?

Yeah, that's the way they come out of rFactor. 1.0 is no sliding, 0.0 is complete sliding.
 
Ad1.
Oh, my fault then, I must have omitted that info. Sorry. I use my own custom project so I did(n't) notice it ;)

Ad2.
I see. Apparently author of DataAcquistionPlugin somehow reversed that internally before outputting data to Motec. Thanks for clarification it's not bug :)
 
Yeah, reversing it is pretty easy, not something I ever thought to do really lol
 
It looks like the extra channels that you are gathering from memory don't work on the newer G27 release of rFactor. Would it be possible to at least put a second steering channel in the output that comes from the internals interface without taking into account the steering lock in the car setup? Or even better (although I understand it is a pain in the butt), could you add support for the new EXE?

That exe can be downloaded here:
http://downloads.rfactor.net/rFactor_G27Update.zip

It works on all wheels, not just the G27 and it doesn't force you to reactivate with TryMedia or anything like that. The only difference is they added support for the G27 LEDs and they reversed the FFB forces so you no longer have to set the force to -100 on Logi wheels.
 
@Lazza
Please take a look at Wheel Rot Speeds channels. I get negative angular speeds:
sgP2j.png

Should be positive.
 
You could make a new channel like this:
Code:
abs('Wheel Rot Speed FL' [rad/s])

That will always give you a positive number but if the car spins around and is rolling backwards it will still show a positive number. Probably not really a problem though.
 
How were you able to read extra values from the latest rFactor.exe (v1.255f) ( brake disc thickness, steered angle, engine boost, brake bias ) ? I don't see theses variables available in the latest internal plugin v3. Do you have access to front and rear brake pressure ? ( I'm not talking about the unfiltred the brake pedal ).
 
@Lazza
Please take a look at Wheel Rot Speeds channels. I get negative angular speeds:
sgP2j.png

Should be positive.

Yeah, they are negative for forward rotation (just the way the axes work in the coordinate system... too early to think about it right now lol). I've tended to leave things like that (and 'Slide Pct') the way they are in the rFactor interface, but I suppose it wouldn't hurt to invert them. I'll do that in the next update.

In the meantime, you can 'fix' those channels without having to create a new one;

Go to Tools -> Maths
Select an existing 'file' on the left or Add a new one (calling it 'scales/offsets' would make sense).
Click 'Add Scale/Offset' on the right
Click the button and select the desired channel (Wheel Rot Speed FL, for example), then change the Scale from 1.000 to -1.000

In all graphs that channel will now be inverted. Note the raw value as shown in the channel list will still be as it was.

For the Slide Pct channels, make the scale -1.000, and the offset 100.000 - that will get them ranging from 0 (no sliding) to 100% (completely sliding (!) )

How were you able to read extra values from the latest rFactor.exe (v1.255f) ( brake disc thickness, steered angle, engine boost, brake bias ) ? I don't see theses variables available in the latest internal plugin v3. Do you have access to front and rear brake pressure ? ( I'm not talking about the unfiltred the brake pedal ).

They aren't available in the interface, the plugin reads them directly from memory. I haven't looked for front and rear brake pressure, it does read the current brake balance so you could multiply that out by the current brake input and get an applied braking for front and rear, but it's not really the direct pressure as such. rF2 is the same at the moment (it provides front and rear pressure, but it's actually just a percentage based on current brake strength and balance, not the actual brake pressure; apparently it will be changed in a future update).
 
Last edited:
They aren't available in the interface, the plugin reads them directly from memory. I haven't looked for front and rear brake pressure, it does read the current brake balance so you could multiply that out by the current brake input and get an applied braking for front and rear, but it's not really the direct pressure as such. rF2 is the same at the moment (it provides front and rear pressure, but it's actually just a percentage based on current brake strength and balance, not the actual brake pressure; apparently it will be changed in a future update).
Nice, I need to implement the brake pressure in my plugin. I made a DLL that send the telemetry data to a java class via UDP. Could you explain me how you were able to read theses values from the memory ?

Thanks,
David
 
Yeah, they are negative for forward rotation (just the way the axes work in the coordinate system... too early to think about it right now lol). I've tended to leave things like that (and 'Slide Pct') the way they are in the rFactor interface, but I suppose it wouldn't hurt to invert them. I'll do that in the next update.

In the meantime, you can 'fix' those channels without having to create a new one;
[...]

Thanks for the tip about Scale/Offset - I didn't know it. And thanks Noel for advice. However it's really strange about those negative/reversed values. First Slide Pct and now this angular velocity. I understand these are raw values from the rFactor but why negatives... Of course it's niggling but I haven't got such readings from a few other sims.
 

Back
Top