Is there a way to change the way an engine sounds at very low loads, to mimic the cylinder deactivation found in lots of cars nowadays? (ex. 6 cylinder car only running on 4 cylinders during very light load, then activating the other 2 cylinders when car is pushed harder) I know I can make it so the car is very efficient during very low loads, and call it cylinder deactivation, but it would be really nice if the sound could change as well. Not sure if this would be at all possible, but it would be really handy for making realistic engines tuned for both efficiency and torque. (also would like to know about lowering engine torque during that time. ex. at 10% load the engine is producing 5% of available torque rather than 10%, but when pushed past 20% it switches back to using it's full torque available for the throttle given)
That's RPM based, not load based. I'd like 2 separate sounds that switch between eachother based on how much you push the gas and how much the engine is "struggling"
Maybe offload/coasting engine sound sample could use 4pot sounds and onload sound 6 cylinder sound? Lots of tuning and maybe it could be possible to fake such?
With some LUA coding voodoo you could probably actually simulate it. That Herby mod actually has some crazy code in it that allows it to change its power on the fly... perhaps that same method (without the trust thing that he created for that mod) could be applied to not only change the sound used with the amount of load, but to also change the torque curve being used as well... so that you get that realistic slight delley of pushing in the pedal, to all cylinders activating when the car realizes it needs more (mostly only on the really old systems, but I would imagine the newer ones have this to at least a small degree)
I wasn't aware of that being in the Herbie mod, as I haven't downloaded it. What's it used for in that situation? edit: i've just realized the laziness of my question, and decided to check for myself. Seems like it would be possible to do what I want to do then, I'm just horribly uneducated about .lua coding, as I've only messed with it back in my ROBLOX days (years and years ago)
Try it, it is really cool what it's done as if you crash car torque curve decreases and you have to drive clean for torque curve increase again, also progress is saved so that next time you start game state is same which you left it. There is no sound change though, but torque curve is adjusted on the fly. Very innovative LUA use in that mod! Update: Some of the coolest use of LUA are in Herbie mod, Citybus hybrid powertrain mod and GamerGull's traffic scenario, each you need to test and see really as those go further most other mods have gone. Of course there are other mods too, weapon systems etc. that use advanced LUA, so it is great to see LUA wizards finding game and doing all these experiments. There is huge amount of potential in what you can do, sadly I lack skill and ability, but in future more and more LUA knowledge persons will really open new possibilities.
Well, it doesn't use the power changing code for cylinder deactivation (obviously) but I could definitely see how it "could" be adapted to be used in much the same way... now the real trick would be figuring out how to get torque curves for engines with deactivated cylinders as I think that would honestly be harder to do than actually figure out how to get it coded and working in game
I 100% agree with that. I'm a total engineering nerd and would want to get all of the technical stuff as accurate as possible, BUT...... If nobody knows, including myself, then who's the wiser? They make piggyback systems to disable the switch from V8 into V4 mode in most trucks, too bad they don't make them the other way around (to my knowledge.) Also, as far as I know, most systems are used only for coasting and maintaining speed, and once the accelerator is pushed enough to, well, accelerate, the system is disabled. This makes it much harder to get a torque reading, since it isn't normally combined with any throttle usage whatsoever. I'd like to make it so it is still activated (or rather deactivated?) during low-load acceleration, and I suppose just dividing the torque by the number of cylinders deactivated would yield a believable (though not entirely accurate) result. --- Post updated --- I suppose the possibilities for advanced automotive technologies are theoretically almost limitless? Pretty sure @Arcanox (who made the hybrid Wentward mod) made an effective stop/start system. Also, just the hybrid mod itself is a really amazing feat in my opinion, and I'm happy the creator seems very open about sharing how it works, as if he's eager to share this coveted technology with other modders who've been wanting it for a long time
To make it properly working, you would also need to reduce friction of engine on the fly as my understanding is that modern engine alters valve timing with deactivated cylinders to reduce pumping losses. It is not difficult to get throttle position with LUA, but to make that to change sound is then which I have no idea. I have been saying that we need more dragons to this game and now there is this one that lays golden eggs of information
working on it. really confused about how all of this works, but i'm slowly figuring it out. need some help, how come my ecu isn't showing up in the parts menu? no matter how many times you do these things, the simple mistakes can still happen i guess. also, if someone knowledgeable can help review my .lua, that would be great.
It's definitely possible to control sounds via Lua; I do so in my hybrid bus mod. If you just turned one sound on and one sound off based on throttle position, you could simulate two different engine sounds. It does requires some Lua knowledge to do this, though. If you look here I highlighted the lines of code that control the sounds for the bus.
I wish I knew anything about LUA to help... but unfortunately, I have NO knowledge of how LUA works at all...
Seems like next update might give some more tools to work with: https://www.beamng.com/threads/vehiclecontroller-overhaul.58372/#post-940747 There is engine load which might work quite nicely with cylinder deactivation, combine that with dynamic torque and I guess that might work nicely then?
Engine load is actually already exposed on the engine object, so it'd work in the current version. The update to the vehicle controller just makes it easier to get at in other places.
bet this will be interesting Are you trying to mimic something like the 16 tahoe has for their eco engine?
Yeah, lots of modern engines have it. I believe VW was the first to use it on a 4-cylinder engine, with the EA211 (the 1.4TSI). Mazda uses it now on the Skyactiv-G, and Ford even decided to bring it into use on their 1.0L Ecoboost --- Post updated --- As it stands, the script can recognize when engine load is at 20% or less, but I'm not entirely sure how to create a second torque curve that swaps out with the first one. I've been playing around with Herbie's personality lua, and it uses a really hard-to-read graph (i'm not sure how the computer even reads the graph). Also that's more of a Continuously Variable Torque system, where I'd want to have 2 hard-set torque settings. Maybe this is too big of a project for me to handle.