Visit RaceSimCentral.com
 

Go Back   RaceSimCentral Forums > Racing Simulations > Image Space Incorporated > rFactor modding > Car and Track Addons/advice section > Track and Car editing advice
Register FAQ Rules Members List Calendar Mark Forums Read

Donate to RSC!
Reply
 
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 09-04-2007, 02:41   #1
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
The rFactor engine.ini file and it's role in defining the car

The rF engine.ini File

This thread is to record the contribution that the engine file makes to the definition of the cars in rFactor and to their behaviour.

In this thread is a posting at the top that contains an engine file from the original game - I have chosen the Sauber BMW released with version 1.150. Each line in the file is accompanied by the comments in the original. Lines are annotated with additional comments in bold about the purpose and role of the parameter, as the information becomes available. Due to the limits of my information, the data is incomplete and also probably wrong in places.

This thread is based on and updated from a similar thread I wrote for F1C. They may get a little out of synch from time to time. If there are contradictions, this thread will be more current.


Engine.ini files are text files and may be viewed and edited in any decent text editor or even Notepad.

There are be similar threads for the other physics files.

Contributions are invited to help fill in the gaps.
__________________
Seemed like a good idea at the time...
Bristow is offline   Reply With Quote
Old 09-04-2007, 02:54   #2
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
This is the engine file BMWP86_engine.ini for the BMW Sauber F1. Engine files are text files and may be viewed and edited in any decent text editor or even Notepad.

This is a quote from the preamble to an hdv file from ISI. "Everything is in SI units (kg, m, kPa, N, etc.), except: Engine speed is measured in RPM. Angles are measured in degrees." As it turns out, not everything follows those 'rules'. Fuel consumption responds to engine rotation expressed in radians.

The original is shown in regular text. My comments are in bold.

// Maximum Torque: 316 NM @ 15500 RPM
// Maximum Power: 723 horsepower @ 17500 RPM
"//" symbols are used to delimit comments in the original file and in other physics files. All characters after // and before the next Carriage Return are ignored by the game

RPMTorque=( 0, -32.3, -32.3)
RPMTorque=( 500, -32.1, -20.0)
RPMTorque=( 1000, -33.4, 3.0)
RPMTorque=( 1500, -35.2, 29.8)
RPMTorque=( 2000, -37.2, 59.5)
RPMTorque=( 2500, -39.1, 84.3)
RPMTorque=( 3000, -40.9, 99.2)
RPMTorque=( 3500, -42.8, 114.1)
RPMTorque=( 4000, -44.7, 130.2)
RPMTorque=( 4500, -46.6, 162.2)
RPMTorque=( 5000, -48.6, 175.2)
RPMTorque=( 5500, -50.7, 184.2)
RPMTorque=( 6000, -52.8, 193.1)
RPMTorque=( 6500, -55.0, 208.2)
RPMTorque=( 7000, -57.2, 219.2)
RPMTorque=( 7500, -59.4, 225.2)
RPMTorque=( 8000, -61.7, 237.2)
RPMTorque=( 8500, -63.9, 252.3)
RPMTorque=( 9000, -66.2, 260.2)
RPMTorque=( 9500, -68.5, 272.2)
RPMTorque=(10000, -70.9, 278.3)
RPMTorque=(10500, -73.4, 281.2)
RPMTorque=(11000, -76.0, 287.3)
RPMTorque=(11500, -78.9, 293.9)
RPMTorque=(12000, -82.0, 296.4)
RPMTorque=(12500, -85.4, 298.3)
RPMTorque=(13000, -89.3, 301.3)
RPMTorque=(13500, -93.6, 307.4)
RPMTorque=(14000, -98.3, 310.3)
RPMTorque=(14500, -103.4, 313.3)
RPMTorque=(15000, -109.1, 315.3)
RPMTorque=(15500, -114.9, 316.2)
RPMTorque=(16000, -120.9, 310.3)
RPMTorque=(16500, -127.0, 304.2)
RPMTorque=(17000, -133.3, 301.3)
RPMTorque=(17500, -139.6, 294.2)
RPMTorque=(18000, -146.0, 281.2)
RPMTorque=(18500, -152.7, 266.3)
RPMTorque=(19000, -160.1, 243.2)
RPMTorque=(19500, -168.8, 207.8)
RPMTorque=(20000, -179.4, 157.7)
RPMTorque=(20500, -192.8, 52.8)
RPMTorque=(21000, -210.6, 0.0)
RPMTorque=(21500, -233.8, -24.8)
RPMTorque=(22000, -265.6, -87.3)
RPMTorque=(22500, -309.4, -164.7)
RPMTorque=(23000, -353.1, -275.8)
The table above defines the torque characteristics of the engine. On each line there is
- The rpm at which these values apply
- The maximum Back-torque, or drag, in Newton-metres from the engine at closed throttle
- The maximum Torque in Nm from the engine at full throttle
These torque values will be less (closer to zero) at part-throttle openings.

For the first line where RPM=0, values for engine torque which are less than brake torque will cause an error report in the log file trace.txt. The error is not fatal.

Horsepower developed may be calculated from these numbers. Imperial horsepower as commonly used in the US (33,000 ft-lb/min) is (RPM * torque / 7121). Please note there are a variety of horsepowers with differing sizes, among them the metric PS which is slightly smaller than the Imperial. Please see references here and here.

FuelConsumption=3.110e-005 // affected by throttle position and engine speed
A factor which defines fule consumption, not further documented by ISI.

Thanks to Carham for wanting to understand and then Kangaloosh and Kalma for exposing the facts -

This factor has the units of litres/radian. The "FuelConsumption=" rate is multiplied by filtered throttle position (to take account of Traction Control and other interventions) and engine speed in radians/sec to deplete the fuel mass remaining in the tank. The answer is in litres/sec. Filtered throttle values are within range 0-1.0.

Some rough numbers using F1 as a basis-

At 15,000 rpm and 66% throttle for 1hr 40min:
15,000 rpm is ~1571 rads/sec

0000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000010571 * 0.66 * 3.11x10^-5 * 100 x 60 is ~193 (litres)


FuelEstimate=1.745 // fudge factor for differences between vehicle types (used for lap estimates and AI pit scheduling)
Even less documentation than above.

EngineInertia=0.0518 // rotational inertia of engine components
Defines the inertia of the engine so that it can be used as part of the calculations for net torque available to the wheels for acceleration. For modelling engine sizes and types (and maybe from time periods) for which we have no examples, the values in the files supplied by ISI could be amended according to capacity, engine type (road car, sports car etc) and age to provide values for other engine types.

IdleThrottle=1.0 // throttle multiplier to help maintain idle speed
? Maybe used with a manual transmission with clutch to assist with not stalling the engine. Not applicable to F1. Note also that engine torque at idle speed must be greater than ClutchFriction in the hdv to prevent stalling.

This line is optional.

IdleRPMLogic=(3925.0, 4150.0) // attempt to maintain idle speed between these RPMs
Defines the idle speed aim range, in rpm. Affects the pitch of the idle sound - faster is higher.

LaunchEfficiency=0.993 // efficiency (0.0-1.0) of launch control, or 0.0 if N/A
LaunchRPMLogic=(7800.0, 11000.0) // holds RPM in this range before launch (used for AI even if launch control is N/A!)
LaunchVariables=3 // level of traction control used (0-3) and whether auto-upshifting is enabled (add 4); default=7
This section defines the values used to manage launch control for the player car, if enabled, and for the AI at all times. Note that F1 cars do not use auto-upshift, so the default LaunchVariables flag of 7 does not apply to this car.

The LaunchVariables line is optional.

RevLimitRange=(18000.0, 50.0, 21)
RevLimitSetting=15
Defines the rpm at which the rev limiter cuts in and the aim point for max revs for auto-upshifting.

This is a typical set of ISI Range and Setting lines. The first line has three values - the first is the base or start value of the range, the second is the size of the increase for each step of the range and the third is the number of steps. The settings start from zero and go to 20, which is the 21st value, so the RevLimit can be set to any of 21 values from 18000 to (18000 + 20 x 50) or 19000 in 50 rpm increments.

RevLimitLogic=150.0 // RPM range around current setting where rev limiter operates
Defines the range around the RevLimit at which the limiter can cut in.

RevLimitAvailable=1 // whether to use a rev limit (if 0, you still must have a "rev limit", just make it 40000 or so, and make sure to change [CONTROLS]->UpshiftAlgorithm to fix shifting points)
A switch to enable or disable the rev limiter. Disabling the rev limiter permits the player to over-rev the engine when using manual shifting, causing engine damage and premature failure. Note the comment about [CONTROLS]->UpshiftAlgorithm, which is found in the hdv.

This line is optional.

EngineMapRange=(0, 1, 5) // 0 = most driveable, max = most power (low gears only) (unimplemented)
EngineMapSetting=2
Not implemented

EngineBoostRange=(0.0, 1.0, 10)
EngineBoostSetting=1
BoostEffects=(15.0, 0.005, 0.052) // RPM increase per setting, fuel increase (1%) per setting, engine wear rate (5.2%) per setting
BoostTorque=-0.0043 // 0.4% less torque per setting (applies to all RPMs)
BoostPower=0.000150 // % more horsepower per setting
This section defines the effect of boost settings available to the player/driver by using the increment, decrement or temporary boost buttons.

This section is optional.

Here is an example of usage of the boost settings as provided by Kangaloosh in post #8 further down.

BoostEffects=(15.0, 0.005, 0.052) // RPM increase per setting, fuel increase (1%) per setting, engine wear rate (5.2%) per setting
BoostTorque=-0.0043 // 0.4% less torque per setting (applies to all RPMs)
BoostPower=0.000150 // % more horsepower per setting

The order that rFactor applies these setting is important:

The BoostTorque change is applied uniformly across the entire torque curve, from 0 to peak rpm. The change applied is multiplied by the garage setting - as with all rF settings you can have as wide a range as you choose to declare; if you are implementing
a Push-2-Pass option like Champcars or A1GP
then just have two settings and map rF's temporary boost button.

After the torque curve has been modified, the power change is applied. This is not only multiplied by the garage setting, it is also multiplied by rpm - in this way you can make the engine curve more (or less) peaky.

In the example given the engine is made more peaky - the torque is dropped everywhere, but the top end of the curve is picked up by the rpm-multiplied power boost.

At any rpm value, the boosted torque value is the original value x (1 + boost-setting x BoostTorque)


V1.250 added ram-air effects on engine. Example usage:

RamCenter=(0.0, 0.8, -1.5) // location of ram air intake;
RamDraftEffect=3.0 // multiplier for effect that draft has on ram air velocity;
RamEffects=(2.0e-5,2.0e-5,2.0e-5,2.0e-5) // torque % increase per m/s, power % increase per m/s and RPM, fuel increase per m/s, engine wear increase per m/s.


EngineBrakingMapRange=(0, 1.20e-04, 6) // input throttle is ranged from minimum to 100%, with the minimum = setting * step * RPM
EngineBrakingMapSetting=2 // the default is 1 * 0.000133 * 15000 RPM = 2% applied throttle at zero input throttle
Defines the amount of throttle (% of full) held open under closed throttle conditions to reduce engine braking slightly, stabilise the engine and the car.

OptimumOilTemp=106.7 // degrees Celsius at which engine operates optimally
Oil temperature as an analog for engine temperature and, consequently, health. See the Lifetime lines below.

CombustionHeat=88.5 // degrees Celsius added per liter of fuel burned
Same original comment as found in F1C. Heat generated by combustion and proportional to fuel consumed. It cannot be literally 88.5 deg of temperature added per litre but surely must be kiloJoules or the like. The calorific value of auto gasoline is around 43,000 kJ/kg, or around 35,700 kJ/l.

EngineSpeedHeat=2.185e-003 // heat added linearly with engine speed
Heat generated by internal friction, proportional to rpm. Again, no units.

OilMinimumCooling=5.050e-004 // heat dissipated without radiator
OilWaterHeatTransfer=(1.28e-2,3.45e-4) // heat transfer from oil to water (base, w/ engine speed)
WaterMinimumCooling=6.000e-004 // heat dissipated without radiator
RadiatorCooling=(12.40e-04, 2.50e-04) // cooling rate with velocity (base, per setting)
This section quantifies the ways in which heat is removed from the engine.

LifetimeEngineRPM=(17730.0,344.0) // (base engine speed for lifetime, range where lifetime is halved)
LifetimeOilTemp=(125.4,2.90) // (base oil temp for lifetime, range where lifetime is halved)
LifetimeAvg=8105 // average lifetime in seconds
LifetimeVar=2940 // lifetime random variance
This section calculates the engine life dependant on rpm, oil temperature relative to optimum, and statistical treatment of average life. The following is from ISI, courtesy of Maxsilver. I have edited the original to fit with the numbers in this file -

"The LifetimeAvg and LifetimeVar are ... the mean and variance of a normal distribution.

The lifetime of the engine is continually reduced based on the current RPM and temperature. If you were able to drive around perfectly maintaining an RPM of 17730.0 and oil temp of 125.4 deg C, the lifetime would reduce by 1 every second. So on average, you'd have 8105 seconds before your engine exploded.

Now obviously you can't maintain that exact RPM & temp, so the lifetime reduction happens faster if you're above the RPM & temp and slower if you're below. It's an exponential curve - at 17730.0 + 344.0 RPM and 125.4 + 2.90 deg C, the lifetime reduces by 2 every second. At 17730.0 + (2 * 344) and 125.4 + ( 2 * 2.90) deg C, the lifetime reduces by 4 every second, etc. The RPM and temperature each contribute half to the calculated lifetime reduction."

EngineEmission=(0.0, 0.50, 0.0) // where flames and smoke are emitted (relative to ref frame at rear axle)
EngineSound=(0.0, 0.50, 0.0) // where engine sound is played (relative to ref frame at rear axle)
Defines the location on the car where various engine emissions are emitted - sort of around the centre of the engine.

SpeedLimiter=1 // whether vehicle has a pitlane speed limiter
Switch for pitlane speed limiter. Set to zero for old cars and set the track to suit as well.

OnboardStarter=0 // whether vehicle restarts when stalled
Switch for the presence of an onboard starter.

StarterTiming=(0.1, 0.0, 3.6) // average and variable cranking time, then time to blend with starting sound
Seems straightforward.
__________________
Seemed like a good idea at the time...

Last edited by Bristow; 03-08-2008 at 22:44. Reason: clarity
Bristow is offline   Reply With Quote
Old 12-06-2007, 20:09   #3
rodeo7
Registered
 
Join Date: Jan 2007
How do you figure the Back Torque or Drag numbers? That is what I am trying to figure out as I can convert the Torque from Ftlbs to Nm.
rodeo7 is offline   Reply With Quote
Old 13-06-2007, 05:54   #4
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
Units conversion is relatively easy - Google it and use the calculator, or use one of the many conversion programs around. That is how I found -

1 Foot-pound = 1.356 Newton Meters. 1 Newton Meter = 0.7376 foot pounds
__________________
Seemed like a good idea at the time...
Bristow is offline   Reply With Quote
Old 15-06-2007, 17:00   #5
rodeo7
Registered
 
Join Date: Jan 2007
I know how to convert, but what is the formula to figure out the back torque or drag is what I am asking. I have not figured out how you get a negative number for each line.

I have the Torque and HP figured out.

thanks for the quick reply Bristow! The reason I ask is I'm trying to make a engine from what data I have found on it but can not find data on Back torque or drag.
rodeo7 is offline   Reply With Quote
Old 15-06-2007, 17:39   #6
JTbo
Registered
 
JTbo's Avatar
 
Join Date: Nov 2002
Location: Finland
Age: 32
Quote:
Originally Posted by rodeo7
I know how to convert, but what is the formula to figure out the back torque or drag is what I am asking. I have not figured out how you get a negative number for each line.

I have the Torque and HP figured out.

thanks for the quick reply Bristow! The reason I ask is I'm trying to make a engine from what data I have found on it but can not find data on Back torque or drag.
Only good explanation which I have found is from Racer pages and even that lefts lot to be guessed:
Engine braking
JTbo is offline   Reply With Quote
Old 27-03-2008, 01:47   #7
lordv8dr
Registered
 
Join Date: Sep 2006
OptimumOilTemp=106.7 // degrees Celsius at which engine operates optimally
LifetimeOilTemp=(129.0,15.00) // (base oil temp for lifetime, range where lifetime is halved)

I have the above in a mod that I am using.
Question: does the engine lifetime decrease when the OilTemp is below, at, or above 129 or only at or above 144 (129+15)?

I tried some laps with a qualifying setup and I couldn't really get the oil temp above 137.

I can monitor engine temperature with Motec, what temperature should I keep the engine under and how would I calculate that.

Last edited by lordv8dr; 27-03-2008 at 01:49.
lordv8dr is offline   Reply With Quote
Old 28-03-2008, 23:14   #8
Niels_at_home
Registered
 
Niels_at_home's Avatar
 
 
 
Join Date: Aug 2001
Location: Netherlands
Age: 29
Thanks to the info from ISI mentioned earlier, we can now play GOD!




If you use Excel, this is the equation:
Code:
 =((B2-B4)*LN(2))/LN(B5/B3)
B2 = Base engine speed for lifetime (RPM)
B4 = Target engine speed where you want it to last a certain time (RPM)
B5 = HALF the desired lifetime at the Target engine speed 
B3 = Base engine lifetime (seconds)
B5 is HALF the desired lifetime because the total engine lifetime is 50% due to revs and 50% due to oil temperature variations.


Edit: above is just half the story, not perfectly accurate.. However, I did crack it including oil temp, see attached pic
Attached Thumbnails
Click image for larger version Name: engine_life_2.png Views: 185 Size: 38.1 KB ID: 449592  
__________________
Corvette 3.0 physics update available here: http://forum.racesimcentral.com/show...&postcount=558

Last edited by Niels_at_home; 29-03-2008 at 14:30.
Niels_at_home is offline   Reply With Quote
Old 29-03-2008, 16:28   #9
Niels_at_home
Registered
 
Niels_at_home's Avatar
 
 
 
Join Date: Aug 2001
Location: Netherlands
Age: 29
I don't understand this bit:

Quote:
OptimumOilTemp=106.7 // degrees Celsius at which engine operates optimally

Oil temperature as an analog for engine temperature and, consequently, health. See the Lifetime lines below.
I don't see how it will affect the lifetime calcs because those calcs use their own oil temperatures. So what does the OptimumOilTemp line do?
__________________
Corvette 3.0 physics update available here: http://forum.racesimcentral.com/show...&postcount=558
Niels_at_home is offline   Reply With Quote
Old 03-04-2008, 02:38   #10
Emery
Registered
 
Join Date: Mar 2008
Location: The Fiat Farm
Just a guess, but...

Wouldn't Optimum temp apply to peak power? That is the oil temp has to be at this value to get the maximum power from the engine and it's scaled back if you go hotter or cooler.
Emery is offline   Reply With Quote
Old 19-06-2008, 19:11   #11
Carham
Registered
 
Carham's Avatar
 
Join Date: Jun 2008
[quote=Bristow;3421062]- The maximum Back-torque, or drag, in Newton-metres from the engine at closed throttle

Hi Bristow,....... Im new to RSC. Found your post regarding engine files through a search at another site. Your posts are very informative. I have a question relating to the above quote regading "back-torque:

Can you site your source for this information?
Do you know for a fact, that the "back-torque" values are at "closed throttle"?

I'm trying to determine values for "indicated hp" i.e., the sum of brake & friction(WOT) horsepower. If the back-torque data were at 100% throttle, then they would represent mosty mechancal friction with very little "pumping" loss. Otherwise, I'll have to calculate out the throttle plate pumping loss for each rpm value, which will require more research and the use of more assumptions, both of which I would prefer to avoid.

Any additional information you can provide will be of great benefit to me, and will be greatly appreciated.

Thanks in advance.
Carham
Carham is offline   Reply With Quote
Old 22-06-2008, 02:14   #12
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
I do not have a formal source as such. Looking at the rpm, back-torque and torque values, and then comparing the product of torque and rpm values with power figures published with some of the ISI engine files or elsewhere lead me to the conclusion that the output of the engine was rpm x torque. In other words, the torque numbers were net, at the flywheel. In that case the back-torque had to be applied at some other time than when the torque number was applied, and the answer was "closed throttle".

I have also varied the B-T for a number of engines as trials for setting suitable values and to see how the game responded. My experience was that drag-limited top speed did not change when I changed B-T over a range of about 2x. This supports my conclusion.

That is as good a 'source' as I have.
__________________
Seemed like a good idea at the time...
Bristow is offline   Reply With Quote
Old 24-06-2008, 05:16   #13
Carham
Registered
 
Carham's Avatar
 
Join Date: Jun 2008
Thanks for responding!

I agree that the positive torque values in the engine file represent net (brake) torque and apply to "open throttle" operation. My interest is in determining if the back-torque values represent only "motored" engine friction (open throttle), or if they also include the closed throttle "pumping loss",or possibly reflect only the throttling loss (?). I'm looking for away of determining the negative torque associated with the engine's mechanical friction only.........this may not be possible. Understanding the game's actual definition of the back-torque data would be of great asistance either way.

I found links to your "engine" posts at another site.......they have proven very helpful.

Carham
Carham is offline   Reply With Quote
Old 24-06-2008, 06:33   #14
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
Quote:
My interest is in determining if the back-torque values represent only "motored" engine friction (open throttle), or if they also include the closed throttle "pumping loss",or possibly reflect only the throttling loss (?)
There isn't anything to tell us explicitly what is in there. I have not asked as no questions came up prior to yours. One can infer certain things in addition to what has been said in the last few posts: It is the only data set which could deal with various engine frictions - the only other available parameter for defining lags and drags for the engine is EngineInertia. There are clutch inertias and frictions but they are south of the flywheel. I also infer that since there is no function available to turn the fuel off other than to run out, that any open-throttle operation will use the torque numbers (while there is fuel available).

Quote:
away of determining the negative torque associated with the engine's mechanical friction only
You don't say what you are going to do with this information. In any event, there is inadequate information available in the game files to do this, unless you want to reverse-engineer the B-T values. My experience is that ISI will simplify the physics to make it fit with the code-space and the processing load and this may be one example.

You might consider asking ISI through rFactor Support <support@rfactor.net>. One is expected to have asked in the forum prior to asking directly, and you have done so. I would mention this thread and our exchange, maybe include a link to your first post. I would be interested in seeing the result.
Quote:
I found links to your "engine" posts at another site...
I hope they linked to the other physics threads as well.
__________________
Seemed like a good idea at the time...
Bristow is offline   Reply With Quote
Old 03-08-2008, 18:18   #15
Strava
Registered
 
Strava's Avatar
 
 
 
Join Date: May 2001
Location: United States
Age: 56
I think a typo was made when updating post#2 for fuel consumption.

Shouldn't
1571 * 0.66 * 3.11x10^-5 * 100 x 60 is ~193 (litres/sec)

be

1571 * 0.66 * 3.11x10^-5 * 100 x 60 is ~193 litres

????
Strava is offline   Reply With Quote
Old 03-08-2008, 22:46   #16
Bristow
Registered
 
Bristow's Avatar
 
 
 
Join Date: Dec 2002
Location: Av, NSW, Oz
Quote:
I think a typo was made
Yes it was. Thanks Strava. Now fixed.
__________________
Seemed like a good idea at the time...
Bristow is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 21:27.


Copyright ? 2001-2008 RaceSimCentral D.S.I. (RSC) unless otherwise stated. All rights reserved.
RSC Official Forum Skins by: .