"""Cylinder Deactivation"""

Discussion in 'Content Creation' started by SebastianJDM, Oct 8, 2018.

  1. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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)
     
  2. Cheekqo

    Cheekqo
    Expand Collapse
    Banned

    Joined:
    Feb 6, 2016
    Messages:
    1,457
    Answer: VTEC yo
     
    • Informative Informative x 1
  3. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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"
     
  4. Ytrewq

    Ytrewq
    Expand Collapse

    Joined:
    Dec 6, 2014
    Messages:
    2,270
    Vtec has nothing to do with cylinder on demand.
     
  5. Cheekqo

    Cheekqo
    Expand Collapse
    Banned

    Joined:
    Feb 6, 2016
    Messages:
    1,457
    VTEC yo is always the answer
     
    • Informative Informative x 1
  6. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    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?
     
  7. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    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)
     
    • Agree Agree x 1
    • Informative Informative x 1
  8. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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)
     
  9. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    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.
     
    • Agree Agree x 1
  10. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    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 :oops:
     
  11. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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? :rolleyes:

    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 :)
     
    • Agree Agree x 1
  12. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    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 :)
     
    • Agree Agree x 1
  13. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Someone put their thinking cap on... I like it... ;)
     
  14. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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.
     

    Attached Files:

    #14 SebastianJDM, Oct 9, 2018
    Last edited: Oct 9, 2018
  15. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    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.
     
    • Like Like x 1
    • Informative Informative x 1
  16. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    I wish I knew anything about LUA to help... but unfortunately, I have NO knowledge of how LUA works at all...
     
    • Agree Agree x 1
  17. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
  18. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    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.
     
    • Informative Informative x 2
  19. The Raccoon

    The Raccoon
    Expand Collapse

    Joined:
    Jul 19, 2016
    Messages:
    429
    bet this will be interesting
    Are you trying to mimic something like the 16 tahoe has for their eco engine?
     
  20. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice