[REL] DAMPlugin for rF2

Discussion in 'Other' started by Lazza, Jul 18, 2015.

  1. valentini

    valentini Registered

    Joined:
    Nov 22, 2015
    Messages:
    6
    Likes Received:
    0
    My Antivirus deleted the installer indeed. Unfortunately I don't have the admin password for it and am not able to stop the antivirus temporarily so only option is manual install. Not sure where the |
    "Rfactor data" folder is though...
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    I need to edit that post, sorry. rF2 has changed slightly since then.

    Just extract the archive to your rF2 folder.
     
  3. valentini

    valentini Registered

    Joined:
    Nov 22, 2015
    Messages:
    6
    Likes Received:
    0
    All good now. Cheers
     
  4. NIsmo97_

    NIsmo97_ Registered

    Joined:
    Feb 4, 2023
    Messages:
    8
    Likes Received:
    2
    A recent RC update mentioned the physics API now returning torque values: https://www.studio-397.com/2023/02/release-candidate-update-2-now-available/

    I noticed that the plugin already returns torque, but only for the free/unencrypted cars. Could this change on the RC make it so all cars return torque?
    They also mention an example plugin, but I have no idea what they're mentioning. The modding repository hasn't been updated for this AFAIK.
     
  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    The plugin currently returns the engine torque, which I guess will be separate from the battery output (those bullet points on the announcements end up as a list, where they probably should be indented). This output, along with other areas, tends to be blocked in DLC. I'm pretty sure that won't change. There is a workaround using upgrades but I'd rather not go into that here. (search/ask elsewhere)

    The new values would have to be added to my plugin for logging, as you've noticed there doesn't appear to be an example yet, maybe it'll come with the final release. Presumably there's already some extra values being output but I can't be bothered with the trial and error to identify them, as the info will hopefully be coming soon anyway.
     
    NIsmo97_ likes this.
  6. Ivyr34

    Ivyr34 Registered

    Joined:
    Mar 21, 2016
    Messages:
    2
    Likes Received:
    0
    Two questions, if you can answer me;
    -Wheel Y Location: What is it referenced to? ¿the center at rest?
    -Susp force: Is it measured on the shock stem?
    Thanks for the Plugin, it works very well.
     
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    I think the Y location is in the vehicle coordinates, so 0 will be somewhere near the undertray.

    Susp force is on the spring/damper, so in comparison to the tyre force it will be impacted by the motion ratio.

    I hope I'm right, and that it helps :)
     
    Ivyr34 likes this.
  8. MotherDawg

    MotherDawg Registered

    Joined:
    Sep 2, 2015
    Messages:
    82
    Likes Received:
    67
    Hey @Lazza
    It might be just me but from your OP, I can DL both Auto and Manual install of v0.810 and v0.924 but for the v0.930, I can only DL the Manual file (which is the one I use np). The Auto Handler rF2_DAMPlugin_Handler_v0_930.zip, I'm getting a "Secure Connection Failed" error on that link in Firefox and Chrome.

    Firefox detail's PR_CONNECT_RESET_ERROR

    Thank you for all your work dude! It's quite appreciated. Hopping the Setup Comparer utility I maintain can be of use to you.
     
  9. Croniat

    Croniat Registered

    Joined:
    Feb 25, 2023
    Messages:
    2
    Likes Received:
    0
    unfortunately
    1. the site is identified as containing the URL:Blacklist virus and my PC doesn't accept downloding
    rF2_DAMPlugin_Handler_v0_930.zip
    2. I could download this version rF2_DAMPlugin_Handler_v0_924.zip but when I select rF2 directory "<where is steam>\steamapps\common\rFactor 2" I get Invalid folder.

    What to do, please ?
     
  10. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    Being the most recent of the exe files, that's the most likely to still not be cleared as safe by antivirus/antimalware software (on your PC, or somewhere along the chain to you). All those files are just attachments on the forum, so there's no hosting issue or anything like that.
     
  11. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    Download the 'manual install' instead. Extract it to your rF2 folder.

    (the Handler is a program, and some antivirus pick it up, so that's why your issue)
     
  12. Croniat

    Croniat Registered

    Joined:
    Feb 25, 2023
    Messages:
    2
    Likes Received:
    0
    This is what I did, and there is no problème with the handler! I assure you.

    However, constructive remarks:

    #1 - This problem is spotted on the url named https://forum.studio-397.com/index.php?attachments/rf2_damplugin_handler_v0_930-zip.49425/.
    To remove any ambiguity, couldn't you remove what makes this program/URL look like "URL:Blacklist" virus signature (name, url, design, I don't know)? If however you are sure that this virus itself is not included there (unintentionally I hope)?

    #2 - You said : Download the 'manual install' instead. Extract it.
    I would add:
    - put the extracted DAMPlugin.dll into <your steam folder>\steamapps\common\rFactor 2\Bin64
    - put the extracted PluginData folder into <your steam folder>\steamapps\common\rFactor 2\

    These two sentences are very simple to understand and to apply.
    Why the "manual installation" paragraph in the documentation on page #1 is so ambiguous and not precise on what to do!?

    In any case, thank you for your work, that works perfectly after all.
     
  13. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    1. It's not that easy. I'm using a scripting language to easily make the executable, but because it has very few dependencies it's also popular for malware. So the 'colour' of the generated code will make antivirus programs suspicious. Then, it uses registry queries to find where rF2 is installed, and finally extracts embedded files (and also possibly deletes existing ones). So it's basically doing a lot of things malware might do, in a package that potentially looks a bit like malware. Yeah, I could change to a new approach, but whitelisting will fairly quickly cover most packages anyway, and there's always the manual install...

    2... and yes, I should make that more clear. When I wrote that originally most common antivirus didn't generate so many false-positives, and I had lots of people not following even clear instructions so I was really aiming people towards the Handler method. I appreciate the input :cool:


    *edit: edited the first post now, tiny bit shorter, slightly simpler instructions.


    @Croniat just re-reading your post I think I should say: this virus warning was the same with previous versions too. Over time as the file becomes more common antivirus packages accept it as safe. As much as I can be, I'm sure the 930 handler doesn't have any virus etc in it.
     
    Last edited: Feb 27, 2023
  14. Chet

    Chet Registered

    Joined:
    Aug 6, 2022
    Messages:
    6
    Likes Received:
    1
    First of all, thanks @Lazza for provideing such an amazing app.
    It has increased my knowledge in vehicle dynamic so much it has even helped my career.

    I have 2 small question here and hope someone can help me figure it out.
    1. Do the plugin have ABS and TC active function? for example if ABS is active on GT3 car the value will change from 0 to 1.
    2. Do rfactor provides yaw angle for the plugin to record?

    thanks.
     
  15. Robin Pansar

    Robin Pansar Member

    Joined:
    May 20, 2018
    Messages:
    150
    Likes Received:
    119
    1. You have filtered input channels that show TC and ABS engagement. For throttle and brake the channels are called Throttle Pos Filtered and Brake Pos Filtered. Some basic math involving the normal channel and filtered channel and you'll be able to see when TC or ABS is engaged.

    2. As far as I know, only yaw rate and yaw acceleration get logged. Local Rotation Y & Local Rot Accel Y.
     
  16. Chet

    Chet Registered

    Joined:
    Aug 6, 2022
    Messages:
    6
    Likes Received:
    1
    Thanks for the enlightenment.
    1. I will try to figure out TC and BAS later.
    2. I tried to use the derivative funtions "derivative('Yaw Rate' [deg/s])" , but I think the result is not correct, something went wrong?
     
  17. Zoaal

    Zoaal Registered

    Joined:
    Apr 17, 2012
    Messages:
    53
    Likes Received:
    18
    Greetings!
    Does anyone know what is causing this error? Or a possible solution for it?
    Thank you for your time!

    DAMPlugin v0_930

    03/17/23 16:35:40 D:\SteamLibrary\steamapps\common\rFactor 2\Motec\2023-03-17 - 16-35-40 - Laguna Seca - P1.ldtemp
    03/17/23 16:54:16 Error creating file:
    03/17/23 16:54:16 D:\SteamLibrary\steamapps\common\rFactor 2\Motec\2023-03-17 - 16-54-16 - Laguna Seca - P1.ldtemp
    03/17/23 17:22:32 Error creating file:
    03/17/23 17:22:32 .\\LOG\2023-03-17 - 17-22-32 - Laguna Seca - P1.ldtemp
    03/17/23 17:22:54 Error creating file:
    03/17/23 17:22:54 .\\LOG\2023-03-17 - 17-22-54 - Laguna Seca - P1.ldtemp
    03/17/23 17:33:47 Error creating file:
    03/17/23 17:33:47 .\\LOG\2023-03-17-17-33-47-Laguna Seca-P1.ldtemp
     
  18. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    Looks to me like it literally can't create files in that folder. Disk space? Permissions? Antivirus blocking it? Not sure.
     
  19. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    1 is discussed in another thread, I'll get to that later.
    2 try this (I haven't actually looked into this previously, so here's my first guess!):

    upload_2023-3-19_6-40-46.png

    (note the quantity, result unit, and display unit)

    **(also note I assume average rear toe is zero. The plugin captures setup values, the rear toe values can hopefully be incorporated into the formula to compensate for any offset)
     
    Last edited: Mar 18, 2023
  20. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,515
    Likes Received:
    6,672
    The game itself doesn't provide any direct (especially digital) indicator for these. Hopefully at some point that gets added, and I presume it'll be an analog signal which we'll then be able to scale as we see fit for analysis. Anyway...

    TC: as Robin suggests, this is as easy as checking filtered vs unfiltered throttle. The game reduces throttle input when applying TC and this is reflected in the filtered value, but still logs your actual input with the normal value. Note:
    • filtered throttle is also reduced when the game helps handle a gear change (auto-lift), and possibly other occasions I can't think of right now (oh, pit speed limiter, there's one)
    • as the filtered value will reduce from the full throttle value, if you want a 0-1 indicator you'll have to decide the threshold yourself, and work it out as a percentage of full throttle. I'd also recommend ignoring very low throttle applications to avoid dirtying your data/graph.
    An example formula:
    upload_2023-3-19_8-36-2.png

    I've ignored (raw) throttle positions below 20% and used the min() function along with a scaling factor of 2.0 (you could make that a constant and adjust it separately, along with the min throttle threshold) to push the 'TC active' value to 1 when the filtered position is less than 66.6% of the unfiltered, and keep the maximum output value to 1. There's basically an unlimited number of ways to calculate and approach this, so this is just one example. (I've used max(0.001,...) in the denominator to remove division by zero; you could forego this and somewhat remove the TC active indication during gearchanges, but I'm not sure I like the idea of it being invalid if TC actually makes filtered throttle zero...)

    I haven't played much with the various functions relating to data boundaries, you could possibly use those to remove the throttle filtering around gear changes.


    ABS: there was discussion of this in this thread, and @Kevin van Dooren gave good concise information I later tested there illustrating how it works. I've just done a formula and regrettably it's ended up quite a mess as I've included all 4 wheels, but it uses a similar principle to TC above:
    upload_2023-3-19_9-0-57.png

    Notes:
    • I'd definitely define the threshold ('20') and the scaling factor ('2.0') as constants and reference those instead, so that this is much easier to adjust.
    • It might be easier to manage (and clearer for display) to do each wheel separately rather than all together. You could have another overall indicator that combines those.
    • One of my test logs had many driving aids turned on, and strange things were happening with the brake pressures (e.g. the total brake front + rear brake pressure exceeded 100%!). I have very little experience with the aids so I can't give good guidance on that, I've only tested this stuff with the on-vehicle ABS/TC.
    In case you want to just try this as-is, here's the text so you don't have to recreate that monstrosity:
    Code:
    choose(
    'Brake Pos' [%] > 20,
    max(
    max(min(1, (('Brake Bias Rear' [%] / 'Brake Pressure RL' [%]) - 1) * 2.0),
    min(1, (('Brake Bias Rear' [%] / 'Brake Pressure RR' [%]) - 1) * 2.0)),
    max(min(1, (((100 - 'Brake Bias Rear' [%]) / 'Brake Pressure FL' [%]) - 1) * 2.0),
    min(1, (((100 - 'Brake Bias Rear' [%]) / 'Brake Pressure FR' [%]) - 1) * 2.0))
    ),
    0)
    
    and here's the TC one as well just for ease of use, though I think this one could definitely use refining:
    Code:
    choose(
    'Throttle Pos' [%] > 20,
    min(1, ('Throttle Pos' [%]/max(0.001,'Throttle Pos Filtered' [%]) - 1) * 2.0),
    0)
    
     
    Kevin van Dooren likes this.

Share This Page