[REL] rF2ImpulseTachGenerator - Tool for creating historic impulse tach effect

svictor

Registered
rF2 Impulse Tach Generator
Project page: https://github.com/s-victor/rF2ImpulseTachGenerator
Download: https://github.com/s-victor/rF2ImpulseTachGenerator/releases

A nonlinear gauge code generator for simulating historic impulse-like tach in rF2.

This tool works around rF2 limitation by creating special nonlinear gauge code to restrict gauge needle movement at specific range, which allows an approximate simulation of impulse-like needle movement for historic tachometer or other gauges.

Both linear scale & nonlinear scale type gauge is supported in this tool.

index.php



Preview

Nonlinear scale impulse effect generated from this tool:

index.php

Note: initial scale 2.0 from 0RPM to 3000RPM, then scale 1.0 from 3000RPM to 7500RPM.
// Impulse-like Tachometer (Nonlinear Scale Mode)
// SmoothRange:100
// Target:0, Range:0-400, Step:500, Scale:2
TachometerNonlinear=(0,0)
TachometerNonlinear=(399,0)
// Target:500, Range:500-900, Step:500, Scale:2
TachometerNonlinear=(500,1000)
TachometerNonlinear=(899,1000)
// Target:1000, Range:1000-1400, Step:500, Scale:2
TachometerNonlinear=(1000,2000)
TachometerNonlinear=(1399,2000)
// Target:1500, Range:1500-1900, Step:500, Scale:2
TachometerNonlinear=(1500,3000)
TachometerNonlinear=(1899,3000)
// Target:2000, Range:2000-2400, Step:500, Scale:2
TachometerNonlinear=(2000,4000)
TachometerNonlinear=(2399,4000)
// Target:2500, Range:2500-2900, Step:500, Scale:2
TachometerNonlinear=(2500,5000)
TachometerNonlinear=(2899,5000)
// Target:3000, Range:3000-3400, Step:500, Scale:1
TachometerNonlinear=(3000,6000)
TachometerNonlinear=(3399,6000)
// Target:3500, Range:3500-3900, Step:500, Scale:1
TachometerNonlinear=(3500,6500)
TachometerNonlinear=(3899,6500)
// Target:4000, Range:4000-4400, Step:500, Scale:1
TachometerNonlinear=(4000,7000)
TachometerNonlinear=(4399,7000)
// Target:4500, Range:4500-4900, Step:500, Scale:1
TachometerNonlinear=(4500,7500)
TachometerNonlinear=(4899,7500)
// Target:5000, Range:5000-5400, Step:500, Scale:1
TachometerNonlinear=(5000,8000)
TachometerNonlinear=(5399,8000)
// Target:5500, Range:5500-5900, Step:500, Scale:1
TachometerNonlinear=(5500,8500)
TachometerNonlinear=(5899,8500)
// Target:6000, Range:6000-6400, Step:500, Scale:1
TachometerNonlinear=(6000,9000)
TachometerNonlinear=(6399,9000)
// Target:6500, Range:6500-6900, Step:500, Scale:1
TachometerNonlinear=(6500,9500)
TachometerNonlinear=(6899,9500)
// Target:7000, Range:7000-7400, Step:500, Scale:1
TachometerNonlinear=(7000,10000)
TachometerNonlinear=(7399,10000)

Linear scale impulse effect generated from this tool:
index.php

// Impulse-like Tachometer (Linear Scale Mode)
// AverageStep:750, RandomRange:250, SmoothRange:100
// Target:0, Range:0-847, Step:947, Scale:1
TachometerNonlinear=(0,0)
TachometerNonlinear=(846,0)
// Target:947, Range:947-1582, Step:735, Scale:1
TachometerNonlinear=(947,947)
TachometerNonlinear=(1581,947)
// Target:1682, Range:1682-2334, Step:752, Scale:1
TachometerNonlinear=(1682,1682)
TachometerNonlinear=(2333,1682)
// Target:2434, Range:2434-2966, Step:632, Scale:1
TachometerNonlinear=(2434,2434)
TachometerNonlinear=(2965,2434)
// Target:3066, Range:3066-3952, Step:986, Scale:1
TachometerNonlinear=(3066,3066)
TachometerNonlinear=(3951,3066)
// Target:4052, Range:4052-4779, Step:827, Scale:1
TachometerNonlinear=(4052,4052)
TachometerNonlinear=(4778,4052)
// Target:4879, Range:4879-5773, Step:994, Scale:1
TachometerNonlinear=(4879,4879)
TachometerNonlinear=(5772,4879)
// Target:5873, Range:5873-6366, Step:593, Scale:1
TachometerNonlinear=(5873,5873)
TachometerNonlinear=(6365,5873)
// Target:6466, Range:6466-7325, Step:959, Scale:1
TachometerNonlinear=(6466,6466)
TachometerNonlinear=(7324,6466)
// Target:7425, Range:7425-8136, Step:811, Scale:1
TachometerNonlinear=(7425,7425)
TachometerNonlinear=(8135,7425)
// Target:8236, Range:8236-8667, Step:531, Scale:1
TachometerNonlinear=(8236,8236)
TachometerNonlinear=(8666,8236)

Generate & add impulse effect to existing mods using Upgrades Output from this tool:
index.php

UpgradeType="Impulse Tachometer"
{
UpgradeLevel="Disable"
{
Description="Disable Impulse Effect for Tachometer"
}

UpgradeLevel="Enable"
{
Description="Enable Impulse Effect for Tachometer"
// Impulse-like Tachometer (Linear Scale Mode)
// AverageStep:750, RandomRange:100, SmoothRange:100
// Target:0, Range:0-554, Step:654, Scale:1
CPIT=TachometerNonlinear=(0,0)
CPIT=TachometerNonlinear=(553,0)
// Target:654, Range:654-1264, Step:710, Scale:1
CPIT=TachometerNonlinear=(654,654)
CPIT=TachometerNonlinear=(1263,654)
// Target:1364, Range:1364-2028, Step:764, Scale:1
CPIT=TachometerNonlinear=(1364,1364)
CPIT=TachometerNonlinear=(2027,1364)
// Target:2128, Range:2128-2727, Step:699, Scale:1
CPIT=TachometerNonlinear=(2128,2128)
CPIT=TachometerNonlinear=(2726,2128)
// Target:2827, Range:2827-3389, Step:662, Scale:1
CPIT=TachometerNonlinear=(2827,2827)
CPIT=TachometerNonlinear=(3388,2827)
// Target:3489, Range:3489-4174, Step:785, Scale:1
CPIT=TachometerNonlinear=(3489,3489)
CPIT=TachometerNonlinear=(4173,3489)
// Target:4274, Range:4274-4995, Step:821, Scale:1
CPIT=TachometerNonlinear=(4274,4274)
CPIT=TachometerNonlinear=(4994,4274)
// Target:5095, Range:5095-5776, Step:781, Scale:1
CPIT=TachometerNonlinear=(5095,5095)
CPIT=TachometerNonlinear=(5775,5095)
// Target:5876, Range:5876-6429, Step:653, Scale:1
CPIT=TachometerNonlinear=(5876,5876)
CPIT=TachometerNonlinear=(6428,5876)
// Target:6529, Range:6529-7167, Step:738, Scale:1
CPIT=TachometerNonlinear=(6529,6529)
CPIT=TachometerNonlinear=(7166,6529)
// Target:7267, Range:7267-7927, Step:760, Scale:1
CPIT=TachometerNonlinear=(7267,7267)
CPIT=TachometerNonlinear=(7926,7267)
// Target:8027, Range:8027-8630, Step:703, Scale:1
CPIT=TachometerNonlinear=(8027,8027)
CPIT=TachometerNonlinear=(8629,8027)
// Target:8730, Range:8730-9402, Step:772, Scale:1
CPIT=TachometerNonlinear=(8730,8730)
CPIT=TachometerNonlinear=(9401,8730)
// Target:9502, Range:9502-10169, Step:767, Scale:1
CPIT=TachometerNonlinear=(9502,9502)
CPIT=TachometerNonlinear=(10168,9502)
// Target:10269, Range:10269-10908, Step:739, Scale:1
CPIT=TachometerNonlinear=(10269,10269)
CPIT=TachometerNonlinear=(10907,10269)
}
}


Usage

Generate gauge code
  1. Select a gauge type from Gauge Type drop-down list.
  2. Click Generate to generate step code.
  3. Click Stop any time to stop a generating process.
  4. Click Save As to save code to a text file for later use.

Apply code to CockpitInfo.ini

  1. Select CockpitInfo tab.
  2. Click Copy to Clipboard to copy all code from CockpitInfo tab to Clipboard.
  3. Open cockpitinfo.ini file from a rF2 vehicle mod with text editor.
  4. Paste generated code to the end of cockpitinfo.ini file and save, done.
    Note, any changes to CockpitInfo.ini file will not take effect until a session is restarted from main menu.

Apply code to Upgrades.ini

  1. Select Upgrades tab to view outputs.
  2. Click Copy to Clipboard to copy all code from Upgrades tab to Clipboard.
  3. Open Upgrades.ini file from a rF2 vehicle mod with text editor.
  4. Paste generated code to the end of Upgrades.ini file and save.
    Note, if rF2 is ready running, any changes to Upgrades.ini file will not take effect until rF2 is restarted.
  5. Start rF2 dev mode, select vehicle and go to Tuning, select Impulse Tachometer > Enable from Upgrade, done.
Using Upgrades.ini method is more flexible for toggling impulse effect on and off based on preference and can be easily added to any existing mods, while CockpitInfo.ini method is easier for debugging in Dev Mode. Note, avoid use both methods on the same vehicle mod, otherwise it may cause issues. It is recommended to save code from both methods for later use.


Configuration
  • Gauge Type:
    • Set gauge type that used as prefix for output, which includes Tachometer, Speedometer, WaterTemp, OilTemp.
  • Scale Mode:
    • Set scale mode for Linear or Nonlinear gauge.
    • Linear scale mode generates code based on Average Step and other Parameters options.
    • Nonlinear scale mode generates code based on values set in Target & Scale columns from nonlinear scale table, and is affected by Smooth Range from Parameters options.
  • Add Comments:
    • Add step info comment to generated code.

Parameters

  • Maximum Value:
    • Set maximum value according to gauge's capacity. Only used in Linear scale mode.
    • For Tachometer, this value represents RPM.
    • For Speedometer, this value represents KPH.
    • For WaterTemp, OilTemp, this value represents degree.
  • Minimum Value:
    • Set minimum value for the starting impulse step, negative value is supported. Only used in Linear scale mode.
  • Average Step:
    • Set average range value for each impulse step. Only used in Linear scale mode.
  • Random Range:
    • Add random amount positive or negative variation to each impulse step. For example, a 200 value sets a random range in -200 to +200, and a value will be randomly picked from this range for each generating process and step. Only used in Linear scale mode.
  • Smooth Range:
    • Set amount smooth transition to needle movement between each impulse step. A 0 value makes needle move instantly between steps.
  • Linear Scale:
    • Set constant linear scale for generating code while in Linear scale mode.

Nonlinear Scale Table

  • Target Column
    • Target column is available after enabled Nonlinear scale mode. Each row sets a target value corresponding to unscaled gauge reading.
    • For Tachometer, this value represents RPM.
    • For Speedometer, this value represents KPH.
    • For WaterTemp, OilTemp, this value represents degree.
  • Scale Column
    • Scale column is available after enabled Nonlinear scale mode. Each row sets a scale value that scales step range for next impulse step.

Note, there are total 30 rows, empty rows are skipped and excluded from calculation and output. The table does not support inserting or removing rows, it is recommended to make a reference spreadsheet in other program for setting up the values.

For more info, see project page.
 

Attachments

Last edited:
Good thing that I have not yet done this for D50, so I will have perfect opportunity to test this.

Thank you ! Amazing how you mastered this subject so quickly and even made a customisation tool haha
 
Thank you everyone.

@mantasisg I think it's one of those little details that makes driving more fun, glad to have it in RF2. Best luck to your progress.
 
mesfigas was probably suggesting a more dynamic weather system (besides the known WeatherPlugin that rely on real weather data), as RF2's built-in weather system is largely script-based, where each session is limited to 5 predefined weather nodes + rain chance set in session setting, and it only works well in time-type session, while has some issues in lap-type session (ex, in time-type session, 5 weather nodes are evenly spread and applied to different stages across entire session, but in lap-type session the timing of applying those nodes are completely messed up).

A non-script based weather system (and also not tied or limited to external source) that changes unpredictably would be more interesting and fun, especially for singleplayer. It may not be easy, but I'll probably give it a try later.
 
Whatever is possible, doable and is a positive improvement is always nice for sure.

@svictor To me the download of this tacho tool failed. Gets block due to supposed virus.
 
Whatever is possible, doable and is a positive improvement is always nice for sure.

@svictor To me the download of this tacho tool failed. Gets block due to supposed virus.
False positive is very common for open source APP, especially with scripting language like Autohotkey.

This tool is written in Autohotkey language, it is a very popular automation scripting language, and also open source, there are several other rf2 APPs in this forum that written with it. If your anti-virus program can't trust the executable file bundled in the release Zip file, you can always install a fresh copy of Autohotkey from Autohotkey official website, and then just run the script (source code file with *.AHK extension) directly. Autohotkey also comes with an executable compiler to compile this script to .EXE file (which is the one that used for release file).

Autohotkey official website, make sure you download & install 2.0 version:
https://www.autohotkey.com/

Then, just download "source code" from either release page or project page (the big green Code button > Download Zip).
 
Off-topic and probably uncalled for but anyway, do you think it is possible to create a tool like this to generate the code needed for an upgrade.ini with the option for a realistic clutch behavior without which the gear could not be changed, and with proper automatic change delay both for player and for the AI? Apologies if it´s not the place to ask for.
 
Off-topic and probably uncalled for but anyway, do you think it is possible to create a tool like this to generate the code needed for an upgrade.ini with the option for a realistic clutch behavior without which the gear could not be changed, and with proper automatic change delay both for player and for the AI? Apologies if it´s not the place to ask for.
From my Point of View, it's not necessary to create a Tool for that.
But if @svictor wants to create one.... :)
You just have to adapt a few HDV Values to get what you want.
I usually modify only

SemiAutomatic=
UpshiftDelay=
UpshiftClutchTime=
UpshiftLiftThrottle=
DownshiftDelay=
DownshiftClutchTime=
DownshiftBlipThrottle=
 
Yes, I think there should be a line where it is worht to make a tool. I suppose it is not a matter of few hours to design a tool. And if someone is generous enough to do and share such tools, there must be sufficient payoff about them. Sometimes perhaps it would be better just to have clear well put and easy to find instructions, which Svictor also has no shortage of.

I have been working on non linear gauges with this tool for Cooper T43. The tool majorly helped me to understand what is going on, thanks to brilliance of Svictor at being able to find things out. But I still had to do a lot of additional tweaking, because I still did not underrstand how things are being controlled perfectly well.

On the long run tools like this, and like tools from redapg saves thousands of hours through many people doing modding, and makes a lot more projects succeed. But it is not like they create them in just couple of hours.
 
I agree, the variables are those we already know, but the mechanics behind them is where it gets tricky.
 
Thanks, I'm glad that those tools are provided to be helpful.

Thanks for the idea @atomed, though I'm not familiar with clutch stuff. It's definitely not easy job to write tools as @mantasisg mentioned. I'm currently a bit burned out after a long month of work, and there are still a lot of scheduled stuff ahead.

I have the same feeling with @redapg, it's probably simpler just to create a collection of upgrades.ini template files (preferably with explanation comments from experienced modder) for various similar tasks, and copy/paste/edit values which would be more flexible and faster.
 
Oh, that's also a good idea. I'm having some issues to get the clutch to be more "intolerant" in case you do a clumsy gear change.
 
Back
Top