The online racing simulator
Throttle model improvements
Edit: See this post for my proof-of-concept implementation results (Scawen, if you could have a look, that would be greatly appreciated!).

After watching Niels Heusinkveld's video about the "wrong" throttle model used by many sims (including LFS, but also the likes of ACC, iRacing and others, even the newer AC Evo (at least in its early access status)), I've been thinking about ways to improve this behavior.
First off, how does LFS compute part-throttle torque? Well, it simply scales the torque curve to the throttle input - this kind of works in general, but comes with two main drawbacks:
  • low RPM torque is way too low: torque should follow the full throttle curve at low RPM (or close to it)
  • higher RPM torque can be too high/over-peaky: part-throttle torque should dip significantly at higher RPM, instead of following a flattened full-throttle curve
The first point is responsible for the difficult launch behavior of most cars: it's incredibly difficult to just start rolling with low throttle in a realistic way without stalling. It also makes cars "too easy" to drive out of corners, in the sense that they will lack some of the torque they should have, therefore drivers are encouraged to almost floor the pedal instead of feeding throttle.
The second point means wheel spin behavior is weird, as higher RPM will actually tend to increase torque, therefore worsening the spin, instead of decreasing torque, which helps stop the spin.

For more detail, please do refer to Niels Heusinkveld's video https://www.youtube.com/watch?v=0gW-cbSX3Uc

Now, what can be done to improve the model? Well, LFS could follow in BeamNG's steps: https://www.beamng.com/game/news/blog/throttle-torque-curves/ (by the way, there's another video by Niels comparing LFS's model with the improved one, no need to talk about the third model, as it's plain wrong and just bad).
This article is really nice to see how the curves look, and combined with Niels' video, they should give enough understanding of the issue.

My understanding of BeamNG's 2016 model is that they basically follow the 100% throttle curve up to a certain point, and then dip down to lower values. Their 2023 model refines this by introducing some smoothing at that transition (maybe it improves other areas, but let's focus on the basics for now).

From the above, I would like to suggest introducing a new throttle model, which basically works as follows:
  • keep the current max torque logic, as it's the full throttle torque, and is good as is
  • for part-throttle torque, follow the full-throttle torque up to some point, then interpolate down to the current scaled-down (interpolated) part-throttle torque curve, which is currently the final torque value
  • introduce a smoothing transition to prevent abrupt behavior change when leaving the full-throttle curve
  • introduce some parameters to control the general shape of the part-throttle curves, either per engine (and exposed to mod makers) or as general, hard-coded values that would not be accessible.
  • additionally, the target throttle curve should be scaled up slightly, as spacing doesn't seem to be linear: 10% throttle may be spaced at 20% instead (random value here), with the curves bunching up toward full throttle.
As a first thought, and based on BeamNG's curves, I would do the following:
  • transition point: for throttle input T, aim for RPM_idle + 0.5*T * (RPM_redline - RPM_idle)
  • dip down from full throttle curve: interpolate exponentially from 100% to T, between the transition point calculated above and redline RPM
  • smoothing: haven't thought too much about that yet, I'll try experimenting and see if I can come up with something decent, but I guess we could use a small percentage of RPM_redline-RPM_idle, centered around the transition point, as an RPM interval to interpolate linearly between the curves
My hope with this is that we could, at some point, replace what I believe is a simple "throttle input -> lerped torque output" formula with a slightly more complex one (probably involving a couple lerps and an exponential interpolation, not exactly resource intensive calculations), that could result in a somewhat low-hanging fruit type of improvement, that would make driving both more realistic and more enjoyable (especially for cruisers with manual clutch, I guess? Big grin)
Now I'm no genius, so if you see any obvious flaw in my reasoning and ideas, feel free to say so!
It's loud about this again... I hope LFS devs fix this someday.

From physics point of view..

Where do torque comes from? Pressure on the piston times stroke length. Throttle input changes pressure on the piston but it can't change stroke length! Even small force, multiplied by leverage makes it huge so... small throttle input gives a lot of torque on low rpm. ...and then it drops due to lack of energy to keep pressing on that piston.

Current model in most games feels like we use throttle to manipulate piston stroke.

Throttle linearty won't fix it.

Part throttle should follow 100% throttle curve to the certain point before dip. That point of throttle dip should depend of throttle input.
That will feel correct.

BTW intake restrictor should work the same way.


Edit:

BTW intake restrictor should work the same (yes it may broke some BOPs and make harder to do new ones but thats realistic way).

Edit 2:

Yes I know i repeated some things. I just preparing something and pasted it here without edit Tongue
Quick follow up on this, as I experimented slightly with values extracted from my WIP Clio Cup mod, see engine torque/power plot from the editor.

As a reminder, LFS currently uses only the max torque (at full throttle), and directly scales it relative to the throttle input: 300N.m at 3000RPM at full throttle will yield 150N.m at 50% throttle, and so on.
In my "first version", as I mentioned in my previous post, I only need a bit more info: idle RPM and redline RPM, and then add some parameters to tweak the model. I currently have a single parameter, which controls the percentage of RPM range (between idle and redline) at which the transition occurs (further scaled by throttle input). The result can be seen in the attached screenshots.

We can observe something that is somewhat similar to BeamNG's 2016 model, it feels to me like I'm mainly missing the curves-bunching-up-toward-100% effect I mentioned previously. My transition parameter is at 50% of the RPM range, and while raising it could get me closer to BeamNG's 2016 model, this is not my goal (since they improved it since, and my 50% value actually works closer to their 2023 model).

I will now experiment with changing the high-RPM linearity, and introducing smoothing at the transition, but right now, my model only performs a few more operations and uses one additional linear interpolation, with an easing curve thrown in the mix, and that's it: I interpolate values from full throttle to input throttle between the transition point and the redline, and the lerp weight follows an easing curve (so we dip faster at the start and flatten out toward the end).

In other words, this is still an incredibly cheap model, and while it remains a fake one (as in not physically-based), that should already show improvements over the current behavior (again, especially when starting to roll at non-full throttle, and out of corners), although I must admit I have no idea how the harsh transition would turn out in the simulation (BeamNG used this model for about 7 years, so it cannot be that bad...).

As a comparison, 1500RPM yields 229N.m at full power on my example engine (from the LFS editor curve). If we try to roll out at 30% throttle, that's about 69N.m (note that on my chart, we actually find 54N.m, because I interpolate from the negative red series at 0% instead; that line in particular is completely arbitrary). With the current state of my model, however, we have the full 229N.m available at that point, which will make it much easier to start rolling without stalling and without having to floor the throttle and burn the clutch at 4000RPM.
Attached images
throttle_engine.png
throttle_torque.png
throttle_power.png
Alright, I think I can call this done as far as proof of concept goes. I now have a parameterized, more realistic (but still fake) model that can somewhat mimic what BeamNG does. Now of course, it cannot be perfect, and adjusting some parameters can throw the entire thing off, which is why I will show the parameters and value ranges that I believe work best.

I use 4 parameters:
  • spacing: controls the spacing linearity between part-throttle curves (0 = linear, 1 draws curves toward 100%)
  • dip power: controls the interpolation after the transition, lower powers result in faster drops
  • RPM transition: controls the RPM range ratio at which the transition occurs: 0 means we don't follow the 100% throttle curve at all, 1 starts the interpolation at a fraction of the range corresponding to the throttle value
  • transition smoothing: controls the amount of smoothing (partial interpolation toward the scaled torque curve), 0 results in no smoothing (sharp transition), higher values smooth the transition more
The parameter ranges that seem to give the best results are 0.5-0.7 Spacing, 0.15-0.25 Dip Power, 0.4-0.6 RPM transition, and 0.1-0.5 Transition Smoothing.

See the attached screenshots for results: "coilcup" gives the complete result for the engine I showed in my previous post, the others show torque and power curves for the engine shown in the BeamNG article, for comparison. At 0.25 dip power, I'm a bit on the high side for low-RPM torque, 0.15 may be more appropriate here, but high-RPM torque might then become a bit too low (which shouldn't really be an issue, as part-throttle, especially 10-30%, can easily be adjusted from pedal input).
For reference, I am also including the shape of my transition smoothing, this is basically a quadratic interpolation away from the transition point, and scaled depending on throttle input and the smoothing parameter - RPM transition can be changed as well to move this interpolation around, and avoid "clipping" at either end of the RPM range.

I would really appreciate if Scawen especially can have a look at these pictures and give his thoughts about this, as I truly believe this should not be a difficult change to make (but would still require proper testing), and it would benefit both realism and driving comfort.
Feedback from everyone else is also appreciated! Smile
Attached images
throttle_coilcup.png
throttle_beamng_torque1.png
throttle_beamng_power1.png
throttle_beamng_torque2.png
throttle_beamng_power2.png
throttle_transition.png
Hello Here how I did it in The Crew, and it should be Niels approoved model Wink

I had a RPM vs Torque curve for Max Throttle, the same you have from dyno or magazines. let's call it MT(RPM)

Then I have a Friction curve RPM vs Torque, wish is not stored but
calculated from Friction = K0 + K1 * ER + K2 * ER², call it FR(RPM)
ER = Engine Rotation in rad/sec.
K0 , K1, K2 should be negative, are they are friciton. No way to calculate or find the, you have to tweak them until it seems realistic.

Now the trick is this.. We calculate the Engine Torque OUTPUT curve, ET(RPM).

We know that

MT(RPM) = ET(RPM) + FR(RPM) at max Throttle.

so ET(RPM) = MT(RPM) - FR(RPM) ( remember FR is mostly negative )

Current Torque Output
And so the CTO(RPM,T) = Linearity(T) * ET(RPM)

T = Throttle position [0,1]
Linearity(T) change the linearity (response curve ) of the Throttle and is between [0,1].

I don't say it's perfect , but it's simple and works nicely.
#6 - gu3st
Quote from versiu :It's loud about this again... I hope LFS devs fix this someday.

It's loud about this everywhere. Pretty much every time a new sim comes out that fails to do it, the same thing ripples through the rest of the sim communities, bringing it up yet again.

This time AC Evo doesn't do it right, despite being "new physics" and here we are again.
Quote from gu3st :It's loud about this everywhere. Pretty much every time a new sim comes out that...

I wouldn't say "every time" just Kunos promised new quality but in the meantime they did the same thing.

IMO fixing flaws in basics are better than adding next simulation elements.
I just can't get why almost everydev koded this the same way. It's unlogical way to simulate engine...
Quote from versiu :I just can't get why almost everydev koded this the same way. It's unlogical way to simulate engine...

That's because...
1) The flawed model is simple to code
2) It is actually 'logical' (although not physical)

I'm interested to try this, even the 'fake' version (making throttle response more realistic without doing a full engine simulation).

My understanding of the physical reason for this is that the diameter of the fully open butterfly valve is chosen to allow sufficient airflow at the engine's maximum power rpm. At low rpm the engine draws in air at a much slower rate so there isn't much resistance and so at low rpm it makes barely any difference whether the butterfly valves are fully open or half open. At low rpm when air flow is low, what makes the difference is whether the valves are a tiny bit open or slightly more open.

These days I'm sure it is more complicated as there is throttle mapping. So there is not a linear mapping between pedal and rotation of the butterfly valves. I don't know yet how the throttle mapping might be varied at different rpm. I'd be interested in that (but it doesn't affect the ability to try a test).

Also to note, not exactly the subject of this thread but even in a traditional engine without throttle mapping, and even at max power rpm, our model is also wrong, because the throttle response is linear, but that doesn't match the characteristic of butterfly valves which produce an S-shaped flow-vs-resistance characteristic. I'm sure that S-shape would be straightened by the throttle mapping (but just to repeat, I know that is not really the topic of this thread).

I do have higher priorities at the moment though, like trying to get to a state where we can do that release. This post is more to acknowledge that I'm interested in this subject, for those who didn't know that already. Smile
Great to know this is on your radar! When you do decide to tackle this, if you feel like trying my implementation (roughly 50-ish useful lines overall), I'm willing to just give it to you, that could make for a first test before you decide to dive into the rabbit hole.

But of course, we're all expecting the new graphics and track updates first Big grin
I wanted to say something here but I don't have any references (yet) apart from 40-odd years of thinking about motorcycles Smile so I'm talking about high performance naturally aspirated engines here ...

Smaller throttle openings at low RPM actually produce MORE torque than full throttle. That is why you don't fit large carburetors if you want midrange driveability. This is because the higher mixture velocity of a smaller venturi allows improved cylinder mixing and more complete combustion.

In recent times we have seen the move to ride-by-wire throttles and selectable engine maps. This is why modern superbikes can have large throttle bodies and make 230bhp and still be rideable in traffic. When you fully rotate the twist grip at say 3000rpm the ECU does not fully open the butterflies - it gives you an opening that gives you the best useable torque. Previously with carbs (which I love) you had to compromise.

(Of course turbo engines are a whole other area and depend on whether you have mechanical or electronic boost control etc etc etc)
Quote from versiu :I wouldn't say "every time" just Kunos promised new quality but in the meantime they did the same thing.

Yeah but in the last like 10~ years, pretty much Kunos has been the only one releasing "new" sims. With ACC and now AC Evo. LMU is just rF2, common bugs and all. iRacing is an eternally evolving product.

And so with every "new" sim, the same throttle model topics arise. Here, in the AC forums as well as the iRacing forums with the same video linked.

I'm not saying it's a bad thing that it gets discussed multiple times and improving it would help the intuition of driving higher powered cars, it's just funny to me that this one topic pops up again and again.
Quote from gu3st :Yeah but in the last like 10~ years, pretty much Kunos has been the only one...

I think it's good people are supportive of such a topic. Simracing does strive to be as realistic as possible, and isn't quite cutting it yet with these throttle physics. Of course, 1:1 realism is impossible and probably never will get achieved, but we can get close.

Edit: I think if LFS implements this, alongside the new physics and graphics, it'll regain some popularity in the sim-market. It already is a great sim although quite old, I still think it gives the best feel of "realism".

Throttle model improvements
(12 posts, started )
FGED GREDG RDFGDR GSFDG