I'm experimenting with something that involves interacting directly with the turbocharger if there's one present on the vehicle. It seems like the Lua code for the turbocharger device uses file-local variables everywhere instead of storing state data on the device itself, which is making it impossible for me to accomplish what I'd like to. I'd like to see the turbo device become more like other devices where the state is stored as properties on the device table instead of inaccessible file locals. I can continue with my experimentation by modifying the turbocharger.lua file a little bit, but obviously can't ship anything that would rely on that.
I also found that the turbo simulation is not very realistic. Wastegate IRL is trying to maintain a constant boost pressure above the existing manifold pressure. Thus if you're at sea level and the boost is 1.5bar, the manifold pressure is 2.5bar. When you're at high elevation where the atmospheric pressure is 0.5bar, the manifold pressure would be 2.0bar, the engine only losts 20%power.Where an NA losts it's 50%power. However in BeamNG both turbo and NA engine lost the same 50% power if the atmospheric pressure is 0.5bar. The pictures above show that both turbocharged and N/A engine lose the same amount(about one third) torque at 2470 meters above sea level
I wish it was possible / easier to have the powertrain devices work more like the turbo, but due to how they are creates, they are alle exposed. Having it not exposed is better for performance so if anything the powertrain stuff should change
I wouldn't think it would make a big difference in terms of performance if there's only one instance of the device. I would hate to see the values become less accessible; it makes it much harder to mod things. I'm thinking right now that since there's a field in the engine jBeam for "turbochargerLuaFileName", I could potentially ship a modified copy of the turbo that includes the minor changes I made, but it seems less-than-ideal to do that instead of having a way to access those values in the stock turbo. To give a little peek into what I'm doing, I'm playing around with attaching an electric motor onto the turbo on the Hybrid Bus so that it can pre-spool the turbo with the hybrid battery, as well as use excess turbo speed to regenerate a small bit of power in some cases (this is already something that happens in real life on Formula 1 cars ). I need a way to access and change the turbo's "curTurboAV" variable, plus data such as the turbo's inertia and maximum AV.
That's what this is intended for, yes As long as possible, it also won't break things as it's meant for that kind of usage, only if I ever need to change large parts of the turbo/engine interface this would probably end up breaking. No worries, the powertrain structure is like that for good reasons and there's no plan to change that. In general: Nice idea, however, the turbo is so messed up, I don't plan to spend any meaningful amounts of time there... Sorry
Ok; I'll just go with the solution of shipping a modified version and I'll make sure to keep an eye on any major changes to the stock version so I can keep mine in sync as best possible