Unsolved is there uneven power delivery?

Discussion in 'Mod Support' started by fillman86, Sep 7, 2022.

  1. fillman86

    fillman86
    Expand Collapse

    Joined:
    Apr 18, 2020
    Messages:
    191
    I'm trying to make a mod that has a non uniform power delivery, like a slow revving 1 cylinder, or even a lot of motorbike v-twins.

    Is there a way to implement this into a vehicle? Maybe with the combustionEngine.lua file? I'm not savvy enough to figure this out on my own :/
     
    • Like Like x 1
  2. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,712
    By "uneven" I am assuming you don't mean a lumpy torque curve, but rather have a lumpy power delivery since there are so few power strokes?

    If there is an actual way to do this I am unaware of it currently unfortunately, however, unless your going for like an old hit and miss engine, even a normal motorcycle single cylinder at anything above 2,000 rpm's is smooth enough to not really notice much of a difference. Granted we can get into the point of big bang firing cycles for motorcycle racing and traction advantages and what not all day long, but that is a topic for a different day.

    My best guess is if something like this were to be implemented, it would have to be done through some LUA code at the moment... I don't know if there is actually a standard way to add something like this currently in the stock game, and if this feature does exist, then I have totally missed it somehow.
     
  3. fillman86

    fillman86
    Expand Collapse

    Joined:
    Apr 18, 2020
    Messages:
    191
    I'd guess that it'd be in the vehicle controller somehow, where it says the equivalent of throttleposition=poweroutput but you could interject a float based on time, and have that time be calculated from rpm.... I think this has helped me maybe figure it out myself.... but I still don't know lua :(
     
    • Like Like x 1
  4. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,712
    I unfortunately don’t understand LUA virtually at all, however, I do know that beam definitely tracks the rotation of the engine. If you take a look at any of the engine models in standard beam vehicles you can see that the pulleys spin with engine RPM. Now this isn’t just some random silly animation, but that animation is actually linked to the engine RPM, and thus, it’s literal rotation.

    So… in theory… if you could find a way to use that rpm, you could then multiply the throttle output by 0.5*sine((RPM*time)/2)+0.5 which… in theory… would give you a number that oscillates between 0 and 1 once every 2 revolutions of the engine. Is it perfect? No. This will give you only 50% of the power that your torque curve “should” have assuming it works at all… it also is a smooth curve as opposed to what an actual power/exhaust/intake/compression stroke would normally give. Normally 3 of those 4 strokes would actually give negative torque while what we have here will always give positive torque. If this actually ends up working though, I could help you come up with an equation that would match an actual 4 stroke power cycle much more closely.
     
  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