05-08-2025, 09:00 AM
05-10-2025, 04:57 PM
I am leaning really heavily on ChatGPT to analyze the physics, and I have asked it to summarize the engine and fuel function:
This function is called every simulation tick to update the state of the car’s engine based on driver input and internal engine variables. It starts by reading the current position of the driver’s boost knob, converts that into a target RPM using a scaling factor, and then adjusts the engine’s current RPM to move gradually toward that target. The adjustment is clamped so the RPM never changes more than 250 "units" per tick, which keeps the response smooth and avoids sudden jumps.
Next, it computes the engine’s torque output using a custom curve formula based on current RPM and two power parameters. This output is scaled and clipped depending on boost input limits. If the engine is running and there's no fuel, the function shuts the engine down and switches to a fallback boost setting. If there is fuel, it calculates the actual boost applied using a linear interpolation and fixed-point math, then updates internal variables like boost_applied and fallback boost pressure.
Once boost is set, the function estimates how much fuel is being burned, smooths it against past values, and then computes a value that may be used for display or further physics calculations. It also calculates heat load and reduces the engine’s internal water temperature accordingly, simulating cooling over time. Meanwhile, a hidden “durability budget” is depleted every tick based on current RPM and fuel use—this models engine wear from heavy load over time.
If certain thresholds are exceeded—either the RPM climbs too high or the durability budget falls too low—the engine is flagged for failure. At that point, the simulation runs blowup logic, setting status flags and calling engine-failure routines. Finally, the function updates telemetry values and concludes, ready for the next simulation frame. This entire routine is what lets the engine respond realistically to boost control and wear out naturally under extreme driving.
This function is called every simulation tick to update the state of the car’s engine based on driver input and internal engine variables. It starts by reading the current position of the driver’s boost knob, converts that into a target RPM using a scaling factor, and then adjusts the engine’s current RPM to move gradually toward that target. The adjustment is clamped so the RPM never changes more than 250 "units" per tick, which keeps the response smooth and avoids sudden jumps.
Next, it computes the engine’s torque output using a custom curve formula based on current RPM and two power parameters. This output is scaled and clipped depending on boost input limits. If the engine is running and there's no fuel, the function shuts the engine down and switches to a fallback boost setting. If there is fuel, it calculates the actual boost applied using a linear interpolation and fixed-point math, then updates internal variables like boost_applied and fallback boost pressure.
Once boost is set, the function estimates how much fuel is being burned, smooths it against past values, and then computes a value that may be used for display or further physics calculations. It also calculates heat load and reduces the engine’s internal water temperature accordingly, simulating cooling over time. Meanwhile, a hidden “durability budget” is depleted every tick based on current RPM and fuel use—this models engine wear from heavy load over time.
If certain thresholds are exceeded—either the RPM climbs too high or the durability budget falls too low—the engine is flagged for failure. At that point, the simulation runs blowup logic, setting status flags and calling engine-failure routines. Finally, the function updates telemetry values and concludes, ready for the next simulation frame. This entire routine is what lets the engine respond realistically to boost control and wear out naturally under extreme driving.
05-11-2025, 03:18 AM
torque_raw = RPM × (engine_power × RPM)
- RPM × (engine_power2 × RPM)
+ torque_adjustment
then scaled by 17184
engine_power, engine_power2 and torque_adjustment are from the engine lookup table:
According to ChatGPT:
![[Image: attachment.php?aid=2434]](https://www.icr2.net/forum/attachment.php?aid=2434)
Ford:
Mercedes:
Honda:
On road courses and street circuits, Mercedes stands out as the most versatile engine due to its strong low-end torque and a generous baseline torque adjustment. These characteristics provide reliable power delivery out of tight corners and help maintain traction on variable surfaces, which is especially valuable in low-speed sections common to street circuits. The flatter torque curve also makes it easier to modulate throttle mid-corner, reducing the risk of wheelspin or sudden oversteer. Honda, while less potent at low RPMs, performs adequately thanks to its smooth ramp into higher revs, which is useful in fast transitions and sweepers. Ford, in contrast, is more volatile — its aggressive midrange surge can unsettle the car on corner exit, making it less suitable for the tight, technical demands of these environments.
On ovals, the performance priorities shift. Ford shines on short ovals, where its sharp torque spike matches the car's typical RPM band, delivering quick throttle response out of constant-radius corners. Mercedes offers predictability but lacks urgency, while Honda feels laggy in comparison. On superspeedways, however, the tables turn: Honda's low engine_power2 and moderate torque adjustment give it the smoothest high-RPM output, ideal for sustained wide-open throttle and aerodynamic efficiency. Mercedes remains a decent all-rounder here, but Ford's early torque peak causes it to lose steam as speeds climb, making it less competitive over long straights or in draft-heavy racing.
- RPM × (engine_power2 × RPM)
+ torque_adjustment
then scaled by 17184
engine_power, engine_power2 and torque_adjustment are from the engine lookup table:
Code:
+--------+-------------------------------+--------+---------+--------+---------------------------------+
| Offset | Field Purpose | Ford | Mercedes| Honda | Notes |
+--------+-------------------------------+--------+---------+--------+---------------------------------+
| 0x00 | fuel_consumption_rate | 6282 | 6282 | 6282 | Lower = less fuel used |
| 0x04 | rpm_upshift_point | 6500 | 6500 | 6750 | Used for autoshift |
| 0x08 | rpm_downshift_point | 3900 | 3900 | 4100 | Used for autoshift |
| 0x0C | engine_power | 1290 | 1236 | 1180 | Higher value = more power |
| 0x10 | engine_power2 | 8675 | 8308 | 7637 | Lower value = more power |
| 0x14 | torque_adjusment | 0 |2000000 |1000000 | |
| 0x18 | rpm_limit | 6500 | 6500 | 6750 | Slightly lower than engine blow |
| 0x1C | fuel_consumption_unknown | 18 | 18 | 18 | 0x120000 >> 16 |
+--------+-------------------------------+--------+---------+--------+---------------------------------+According to ChatGPT:
Ford:
- Highest engine_power (1290) → strong torque rise with RPM.
- Highest engine_power2 (8675) → steep torque drop-off at high RPM.
- No torque adjustment (0) → no low-end compensation.
- Result: sharp midrange peak, less torque at low RPM, drops fast near redline. Classic "peaky" turbo feel.
Mercedes:
- Moderate engine_power (1236) → slightly less aggressive torque rise than Ford.
- Lower engine_power2 (8308) → softer fall-off at high RPM.
- Large torque adjustment (2,000,000) → lifts the entire torque curve, especially at low RPM.
- Result: broad, flatter torque curve with strong low-end pull and less dramatic peak.
Honda:
- Lowest engine_power (1180) → slowest torque rise with RPM.
- Lowest engine_power2 (7637) → least torque fall-off at high RPM.
- Medium torque adjustment (1,000,000) → some compensation at lower RPM.
- Result: high-RPM biased curve, weaker low-end but smoother power delivery into the redline.
On road courses and street circuits, Mercedes stands out as the most versatile engine due to its strong low-end torque and a generous baseline torque adjustment. These characteristics provide reliable power delivery out of tight corners and help maintain traction on variable surfaces, which is especially valuable in low-speed sections common to street circuits. The flatter torque curve also makes it easier to modulate throttle mid-corner, reducing the risk of wheelspin or sudden oversteer. Honda, while less potent at low RPMs, performs adequately thanks to its smooth ramp into higher revs, which is useful in fast transitions and sweepers. Ford, in contrast, is more volatile — its aggressive midrange surge can unsettle the car on corner exit, making it less suitable for the tight, technical demands of these environments.
On ovals, the performance priorities shift. Ford shines on short ovals, where its sharp torque spike matches the car's typical RPM band, delivering quick throttle response out of constant-radius corners. Mercedes offers predictability but lacks urgency, while Honda feels laggy in comparison. On superspeedways, however, the tables turn: Honda's low engine_power2 and moderate torque adjustment give it the smoothest high-RPM output, ideal for sustained wide-open throttle and aerodynamic efficiency. Mercedes remains a decent all-rounder here, but Ford's early torque peak causes it to lose steam as speeds climb, making it less competitive over long straights or in draft-heavy racing.
05-11-2025, 07:32 PM
That's seriously impressive work! I don't use any AI, maybe I should.
05-11-2025, 07:49 PM
(05-11-2025, 07:32 PM)sharangad Wrote: [ -> ]That's seriously impressive work! I don't use any AI, maybe I should.
Yes - super excited about this too! I just built a new machine for myself (not for dosbox gaming- but just for day to day linux) and AI helped me a ton. I am not nearly as talented as you or SK and AI helps me code little things when I need to. I'm studying the reverse engineering part but I am a mechanical engineer not a computer science engineer so AI is super helpful accelerating the learning.
Anyways - congratulations SK - awesome work!
05-12-2025, 12:55 AM
Nice work.
(05-11-2025, 03:18 AM)checkpoint10 Wrote: [ -> ]torque_raw = RPM × (engine_power × RPM)Is not there a typo in this formula? Because this one should have its maximum or minimum at 0.
- RPM × (engine_power2 × RPM)
+ torque_adjustment
then scaled by 17184
05-12-2025, 12:58 AM
(05-10-2025, 04:57 PM)checkpoint10 Wrote: [ -> ]I am leaning really heavily on ChatGPT to analyze the physics, and I have asked it to summarize the engine and fuel function:
This function is called every simulation tick to update the state of the car’s engine based on driver input and internal engine variables. It starts by reading the current position of the driver’s boost knob, converts that into a target RPM using a scaling factor, and then adjusts the engine’s current RPM to move gradually toward that target. The adjustment is clamped so the RPM never changes more than 250 "units" per tick, which keeps the response smooth and avoids sudden jumps.
This does not make sense from a physics point of view. The RPM is tied to the velocity of the car when in gear, should not be calculated based on boost knob. However, If I replace "RPM" with "actual boost", then it starts to make some sense.
05-12-2025, 02:08 AM
(05-12-2025, 12:58 AM)kakukri Wrote: [ -> ]This does not make sense from a physics point of view. The RPM is tied to the velocity of the car when in gear, should not be calculated based on boost knob. However, If I replace "RPM" with "actual boost", then it starts to make some sense.
I need to look more into what the boost is doing. As I work through the decompiled code, I am naming the different variables based on my best guesses at what they are, but often need to make adjustments as I learn more. All I know for sure is that the "torque_raw" does affect the physics based on the 3 values from the engine lookup table. I also know that ChatGPT can make mistakes especially if I'm also making mistakes while I'm figuring things out, so I am trying to learn to read the code myself and do my own calculations on the side.
05-12-2025, 02:02 PM
Guys - from an actual perspective on how turbochargers work- the game is not really right. I don't think this takes away from the quality of the experience though. The engines in the game perform and "feel" like naturally aspirated engines. I think the boost is just on the screen for show. Sure- if you turn it down, the cars get better mileage and make less power.
If you want to see what I mean- turn on spin correction and spin out. While the game is turning you back around to face the correct direction- hold your foot on the gas. The boost will increase. If you do this you will see that you can reach 45 inches way before the point at which you would normally do- but you don't actually go faster.
Now I want to prefix this statement with a disclaimer- because you never know who you are talking to on the internet. I think I am qualified to speak on this topic because I've been building performance turbo cars for about 20 years now.
Real turbo cars do not work this way. My last car which I sold in 2023 was an Evo 9 that I had modified quite a bit. I increased the displacement from 2.0L to 2.3L, which is very close to the 2.65L our cars in the game have. I also had similar power numbers because when I build the engine I went with a much bigger turbocharger. This is what they did in CART back in the day- they put large turbochargers on little engines. These turbochargers need a lot of heat and flow to spin quickly where they make power- so to get the flow you need engine RPM and a lot of exhaust gas. This isn't so much a problem for champcars because they rev to 13-14K. On my Evo, I was able to rev the engine to 8.5K. Because I had a bigger turbocharger the engine was a dog until it started to hit 3.5K. - at this point the engine would be able to spool the turbo and it was like taking off in a rocket by the time it hit 5k. This is exactly like a CART car would do- however this would happen even higher in the rpm range and they would have had even a bigger turbo than I used on my Evo. The boost setting is just adjusting the point at which the wastegate opens. How does a wastegate work? think of a wastegate as a "trap door" that lets' the exhaust coming out of the engine bypass the turbocharger so it does not continue to try and drive the turbo even faster. This is what the boost knob does. Now in CART- they had a "pop off valve". This is like a door inside the intake of the engine - think about it as a balloon- if the pressure in the intake gets too high- the pop off valve will open and leak out all of the pressure. The turbocharger is what is feeding the pressure in- and the teams did not want the pop off valve to open- so they would set the wastegate to open right below the point at which the pop off valve will open- this is how they controlled the power.
With respect to boost and RPM. The boost should climb very quickly when you have your RPM up high (because there are more pulses or "punches" of exhaust hitting the turbo.) So in a corner (lets imagine turn 1 at elkhart lake for example) where you downshift from 6th to 4th and then get back into it with higher rpm- the boost would climb quickly because you're already at high rpm when you get back on the throttle.
In the game- I think the boost setting works more like how fuel mixture affects power. I don't really let this bother me though. Driving a real turbo car on the track you always would want to get rpm as early as you can when you are in a corner- this is why some guys in real life would trail the brakes and use the throttle at the same time. Years ago when I would do stupid things that could get me killed (Yes I would race on the streets) I used to always ride my brake pedal and spool the turbo so that when I got off the brake the car would take off like a rocket (this was the easiest way to pull away from big v8's). I think that my car was probably very close to the engine dynamics of a CART car. I had similar displacement 2.3 vs 2.65, similar size turbo, ran similar fuel (ethanol vs CART methanol) and similar power- or even more power than the cars from the 80s. It was 700 brake horsepower where I think the 90's cars were closer to 900 according to my "anatomy of the indycar" book from 1993. On my car it was a ballbearing turbo- where I don't think CART had this back in the day (God can only imagine how those cars would perform with today's turbo technology)
If you want to see what I mean- turn on spin correction and spin out. While the game is turning you back around to face the correct direction- hold your foot on the gas. The boost will increase. If you do this you will see that you can reach 45 inches way before the point at which you would normally do- but you don't actually go faster.
Now I want to prefix this statement with a disclaimer- because you never know who you are talking to on the internet. I think I am qualified to speak on this topic because I've been building performance turbo cars for about 20 years now.
Real turbo cars do not work this way. My last car which I sold in 2023 was an Evo 9 that I had modified quite a bit. I increased the displacement from 2.0L to 2.3L, which is very close to the 2.65L our cars in the game have. I also had similar power numbers because when I build the engine I went with a much bigger turbocharger. This is what they did in CART back in the day- they put large turbochargers on little engines. These turbochargers need a lot of heat and flow to spin quickly where they make power- so to get the flow you need engine RPM and a lot of exhaust gas. This isn't so much a problem for champcars because they rev to 13-14K. On my Evo, I was able to rev the engine to 8.5K. Because I had a bigger turbocharger the engine was a dog until it started to hit 3.5K. - at this point the engine would be able to spool the turbo and it was like taking off in a rocket by the time it hit 5k. This is exactly like a CART car would do- however this would happen even higher in the rpm range and they would have had even a bigger turbo than I used on my Evo. The boost setting is just adjusting the point at which the wastegate opens. How does a wastegate work? think of a wastegate as a "trap door" that lets' the exhaust coming out of the engine bypass the turbocharger so it does not continue to try and drive the turbo even faster. This is what the boost knob does. Now in CART- they had a "pop off valve". This is like a door inside the intake of the engine - think about it as a balloon- if the pressure in the intake gets too high- the pop off valve will open and leak out all of the pressure. The turbocharger is what is feeding the pressure in- and the teams did not want the pop off valve to open- so they would set the wastegate to open right below the point at which the pop off valve will open- this is how they controlled the power.
With respect to boost and RPM. The boost should climb very quickly when you have your RPM up high (because there are more pulses or "punches" of exhaust hitting the turbo.) So in a corner (lets imagine turn 1 at elkhart lake for example) where you downshift from 6th to 4th and then get back into it with higher rpm- the boost would climb quickly because you're already at high rpm when you get back on the throttle.
In the game- I think the boost setting works more like how fuel mixture affects power. I don't really let this bother me though. Driving a real turbo car on the track you always would want to get rpm as early as you can when you are in a corner- this is why some guys in real life would trail the brakes and use the throttle at the same time. Years ago when I would do stupid things that could get me killed (Yes I would race on the streets) I used to always ride my brake pedal and spool the turbo so that when I got off the brake the car would take off like a rocket (this was the easiest way to pull away from big v8's). I think that my car was probably very close to the engine dynamics of a CART car. I had similar displacement 2.3 vs 2.65, similar size turbo, ran similar fuel (ethanol vs CART methanol) and similar power- or even more power than the cars from the 80s. It was 700 brake horsepower where I think the 90's cars were closer to 900 according to my "anatomy of the indycar" book from 1993. On my car it was a ballbearing turbo- where I don't think CART had this back in the day (God can only imagine how those cars would perform with today's turbo technology)
05-24-2025, 06:20 AM
(05-05-2025, 03:32 PM)checkpoint10 Wrote: [ -> ]I think chassis parameters are in this block of code, close to the engine parameters. This is at 004f3b8c in Windy.
Code:+-------------+-----------+-----------+-----------+
| Parameter | Chassis 1 | Chassis 2 | Chassis 3 |
+-------------+-----------+-----------+-----------+
| Param 1 | 7500 | 7550 | 7550 |
| Param 2 | 33000 | 33000 | 33000 |
| Param 3 | 28000 | 28000 | 28000 |
| Param 4 | 255 | 255 | 255 |
| Param 5 | 260 | 260 | 260 |
| Param 6 | 43691 | 43691 | 43691 |
+-------------+-----------+-----------+-----------+
If I change the first parameter to 500, the car feels relatively normal from a standing start until around 100 mph when it starts accelerating incredibly fast. It then feels like I have unlimited downforce through the turns even at 250+ mph at Michigan, it is stuck to the ground like an arcade game.
EDIT: Here's something else I found from looking at the code that loads the parameters. The game will load Param 1, and then it will then load Param 2 and Param 4 for non-speedways, or Param 3 and Param 5 for speedways. And then it will load Param 6 in all cases.
I might take another wild guess that the parameters are weight, front downforce, rear downforce and drag. In which order, I am not sure.
I'm back home and had tonight extensive chassis parameters test. My thoughts:
Parameter 1 (7500/7550)
It is engine placement. Lower value - engine moved closer to chassis center (front), rear of the car is stable.
Higher value - engine moved to the rear, more oversteer, hard to control rear of the car.
Parameter 2 (33000)
It's roadcourse chassis downforce. Lower value - less downforce and drag, higher value - more downforce and drag.
Parameter 3 (28000)
It's speedway chassis downforce. Lower value - less downforce and drag, higher value - more downforce and drag.
Parameter 4 (255)
It's roadcourse chassis weight (or maybe downforce) balance. Lower value = more front weight (?more rear downforce), stable car.
Higher value = more rear weight (?less rear downforce), oversteer.
Parameter 5 (260)
It's speedway chassis weight (or maybe downforce) balance. Lower value = more front weight (?more rear downforce), stable car.
Higher value = more rear weight (?less rear downforce), oversteer.
Parameter 6 (43691)
It's chassis weight. Higher value = more weight, car heavy as tank. Lower value - light car, hard to control on high speeds.
I'm not 100% sure my conclusions are spot on. But maybe

Next test will be for engines
