Skip to content

BeamNG.drive The Future of Simulation: Throttle Modelling

BeamNG.drive The Future of Simulation: Throttle Modelling

BeamNG.drive is that simulation title that does things very different, but oh so well, check out the modelling on the throttle curves.

If there was ever a time where you needed information and assistance on a simulation title, BeamNG.drive nails it with the latest throttle modelling. Check out the latest dev blog, its bloody marvelous.

An accurately modeled torque curve has a significant impact on a vehicle’s handling characteristics and defines how the throttle inputs of the driver get translated into actual engine power and, as a result, offers players far more granular control over their vehicle. For instance, it assists players with handling of vehicles with very powerful engines when accelerating out of corners and delivers a more realistic response during low-speed maneuvers (leaving pit area, parking, etc.).

As most of you already know, the pursuit of realism is at the core of our development principles and we constantly work on implementing more advanced methods for calculating different aspects of the simulation. Back in 2016 we were able to achieve a model that better mimics the behavior of real-world engines, and we wanted to share our journey with everyone while we work on polishing this model. Our upcoming improvements were inspired by Niels Heusinkveld’s research into the topic, which he discussed in the following videos. We would like to thank Niels for his comprehensive investigation and valuable suggestions!

In essence, there are several approaches that videogames utilize for these calculations. Each method has its benefits and drawbacks. We’ll try to explain how they differ from one another and which ones we considered and ultimately chose to use. The goal of this article is to present a technical overview of how BeamNG models the torque response to partial throttle inputs and the expected outcomes of our methodology.

Pre-defined Method

Let’s start with the pre-defined approach. Within this method, game engine utilizes manually defined or precalculated LUTs (or look-up-tables) that map certain inputs to outputs instead of calculating the values in real-time. This can be used on various aspects of the game to perform required transformations on the data. In this article, we will explore how game developers apply this concept to implement torque curves and their correlation to throttle input.

In real-world situations, it is possible to collect empirical data of any given vehicle through dyno testing, road tests, or obtain it directly from the vehicle manufacturers or race engineering teams. Once this data has been gathered, it can be used to produce a LUT that will be used by the game’s powertrain subsystem to accurately replicate the performance of the corresponding vehicle. An important additional benefit of this method is that since the values are pre-computed and not calculated in real-time, it may result in faster and less resource-intensive outcomes, while being easier to implement on the programming side.

However, from the production perspective, this can be a very expensive and time consuming effort, as every table has to be hand-crafted and optimized for every vehicle, engine type, input value, and any interaction that may be present in a given simulation. Consequently, this strategy is not suitable for all games, not to mention that for some types of vehicles it is impossible to obtain such data. As we do not license real-life brands for our vehicle lineup, this would not be ideal for BeamNG either. We do, however, utilize empirical data and LUTs to model the fundamentals of our torque calculations, which we will discuss later.

Physics-based Modeling

In an ideal scenario, the game engine could be developed with an unlimited level of complexity, and the simulation of the vehicle engine would be intricately comprehensive, including not only basic attributes but also other elements such as engine specifications, fluid/air flow dynamics, aerodynamics, temperatures, and so on.

An interesting example of this sort of simulation is covered in AngeTheGreat’s video here:

In comparison to the previously discussed pre-defined methods, this provides for a far greater level of detail and flexibility, resulting in a more accurate and realistic driving experience. In such simulation the performance of the vehicle is no longer defined by static curves but rather takes into account the complex and dynamic interactions of real-world engine behavior.

Regrettably, we do not yet live in a post-scarcity society where everyone has the luxury of infinite hardware resources, so we must be mindful of how each aspect of the simulation will impact the game’s performance, and make compromises when appropriate.

Hybrid Approach

While we initially considered utilizing basic input LUTs in the early stages of BeamNG’s prototyping, and are still on the look-out for an optimal physics-based model, we ultimately decided on a hybrid approach.

As we mentioned earlier, at the fundamental level our torque curves are hardcoded into each vehicle’s data. If you take a look at a vehicle engine’s jbeam file, you can see for yourself the LUT that is used to determine the relationship between torque and RPM values at full throttle.

During the development phase of the vehicle, we utilize some publicly available empirical data as a reference for these values, although we do not have direct collaboration with vehicle manufacturers.

As a starting point, we use this data and, like many other components of our simulation, we opted to model the resulting part-throttle torque curves for different throttle inputs as a real-time mathematical model. This allows us to balance the accuracy of the pre-defined method with the flexibility of a physics-based approach. On top of those calculations, we’ll then add various physically based calculations (such as turbo behavior, if present, or damage and wear based loss of torque, loss of power at altitude in mountain roads, and so on).

Evolution of the Model

Our initial model, developed back in 2013, was rather simplistic, and produced results that don’t really correlate with real-life vehicle performance. The model was basic in nature and consisted of merely scaling the entire torque curve by the throttle value.

BeamNG.drive Simulation Throttle Modelling

In practice, this means that the vehicle is difficult to operate because of its unpredictable behavior. A driver may need to apply excessive throttle inputs to achieve a specific torque output, which in some cases may even result in the vehicle remaining still at very low throttle input values.

In 2016 we developed a new model that we call “constant power” model. The main objective of this approach was to allow the throttle pedal to scale the output of power rather than torque, with the aim of creating a more realistic part-throttle torque curve.

 

 

Within this method, the equation’s fundamental inputs are the maximum overall power of the engine, the max torque value at the current RPM, current RPM itself, and of course the throttle input value. The throttle controller then utilizes these values to maintain a steady power output, which improves the overall driveability by providing a more consistent and controlled acceleration. We should emphasize that the power output in this model is not exactly constant but rather a general approximation that will still vary, especially at higher throttle inputs, to keep the math performant enough.

In the upcoming version of BeamNG several more tweaks were implemented in this model which should improve the consistency and reduce sudden changes in engine behavior.

 

 

As a result of the transition to the new model in 2016 we were able to considerably improve the maximum attainable torque for a given throttle input. In real-world scenarios, the max torque curve is not linear and instead varies with the throttle input. Our 2013 model produced only a straight, linear curve in this context. The new model generates far more realistic results as well as an increased level of detail. This nuanced variation in torque output influences the vehicle’s behavior and performance, allowing the driver to carefully control its acceleration and overall speed.

 

BeamNG.drive Simulation Throttle Modelling
BeamNG.drive Simulation Throttle Modelling

We are continuously refining the simulation, and eagerly working towards polishing the model further to optimize the shape of the part-throttle curves and improve engine braking behavior. While we are making progress, it is important to note that we are taking a cautious approach and at this time, we cannot provide a specific timeline for these improvements. Stay tuned for further updates!

 

Leave a Reply

Your email address will not be published. Required fields are marked *