1. Thread posting restricted: Only the BeamNG team members can post new threads in this sub-forum in order to prevent spam. Posting is available on unlocked threads.

Driving Modes: Brainstorming

Discussion in 'Microblogs' started by Diamondback, Mar 5, 2019.

  1. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Hey guys,

    I've started to think about implementing some form of "Driving Modes" logic in beam and since this is an entirely new system I'd like to get some early feedback & ideas.

    Here's what I currently roughed out so far:
    • Each Driving Mode is going to serve a purpose as some sort of "top level" vehicle adjustment, affecting other subsystems from a central point.
    • Here's a few potential subsystem that I came up with:
      • ESC/TC: Just select one of the existing ESC modes in a given Driving Mode
      • Gearbox: Could select one of the gearbox modes automatically ( ie D,S or M)
      • Engine: Maybe some sort of throttle map change?
      • Exhaust: IRL these systems control exhaust valves, so maybe something like this?
      • Suspension: Different damp rates or something? Potentially height adjustment?
      • Active aero: Could switch between different usage profiles?
      • UI: Could change the contents of an in-car display
      • Custom subsystem adapter: Something to cover other uses that are not supported out of the box, useful for modders
    • Each driving mode would define its own settings for any number of the subsystems which then get applied whenever you change into that mode
    Please note: Mentioning stuff like active suspension, adjustable throttle maps or even exhaust valves does not mean that these are things are being worked on or will ever exist. I just want to think ahead and support as many things as possible upfront.

    Here's what I have so far when it comes to the jbeam setup:


    I'm trying to avoid errors that I made when creating the ESC jbeam setup, for example not using proper keys for the modes (which is why there is no "Default ESC mode" btw), so I hope to finalize the jbeam as much as possible before starting any of the implementation work.

    Now for your part, what do you think about this? What other subsystems could be affected? What crazy contraptions can you think of that could make use of it?
    As always, I want as broad of a support for weird stuff as I can do within the limits of this project, so let me know what you might want to use it for.
     
    • Like Like x 34
  2. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    That's a nice feature that can be very useful

    I have a few:
    Tire pressure
    Color :D
    Steering/FFB (like city steering mode or so) or just hydro's in general
    Diff/transfercase etc
     
    • Agree Agree x 8
  3. Javiersp98

    Javiersp98
    Expand Collapse

    Joined:
    Dec 23, 2015
    Messages:
    31
    I heard that in some modern cars interior lighting changes of color when using Sport Modes (Like for example changing the gauges lighting from white to red). It may be interesting to see in moder cars.

    Other cars can also display turbo boost pressure and other performance statistics while in Sport/Track mode.


    In this Peugeot 308GTI you can see both features (Change of mode happens at 0:17)



    Talking about driving modes, an Eco mode, Offroad mode and Track mode would be cool. And maybe an Individual mode (In wich each subsystem can be adjusted individually, but that seems very difficult to program ;))
     
    • Like Like x 3
    • Agree Agree x 1
  4. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710


    So essentially we are talking about implementing something along the lines of this?

    I think this would be a great idea! implementation might be a little difficult not only from a coding standpoint (I feel like you guys can handle ourselves on that front) but in a JBeam implementation standpoint... so I am going to make a suggestion as to how I would do it. Will it work? Who knows.

    Anyways, right now most of the JBeams make use of variables that have the ability to be adjusted (spring rate, damping, so on and so forth) and then have their standard base values defined somewhere else in the JBeam (usually in the same file... but technically it doesn't have to be I guess... or maybe it does... I don't know) Well... using what you have set up there.

    Code:
    "driveModes": {
         "modes": {
              "comfort": {
                   "name": "Comfort",
                   "order: 1,
                   "settings": [
                        ["type"],
                        ["esc", {"mode": "Regular"}],
                        ["exhaust", {"name": "mainEngine", "mufflingOffset": 0}],
                        ["gearbox", {"name": "gearbox", "mode": "D"}],
                        ["suspension", {"mode": "soft"}],
                        ["ui", {"mode": "Comfort"}],
                   ]
              },
              "sport": {
                   "name": "Sport",
                   "order: 2,
                   "settings": [
                        ["type"],
                        ["esc", {"mode": "Sport"}],
                        ["exhaust", {"name": "mainEngine", "mufflingOffset": -0.2}],
                        ["gearbox", {"name": "gearbox", "mode": "S"}],
                        ["suspension", {"mode": "hard"}],
                        ["ui", {"mode": "Sport"}],
                   ]
              },
    
    I propose that we actually have the settings for suspension right in this area using a variable name or something (shoddy made up code incoming)

    Code:
    "driveModes": {
         "modes": {
              "comfort": {
                   "name": "Comfort",
                   "order: 1,
                   "settings": [
                        ["type"],
                        ["esc", {"mode": "Regular"}],
                        ["exhaust", {"name": "mainEngine", "mufflingOffset": 0}],
                        ["gearbox", {"name": "gearbox", "mode": "D"}],
                        ["suspension", {"mode": "soft", "springRate":670000, "shockDamp":12000}],
                        ["ui", {"mode": "Comfort"}],
                   ]
              },
              "sport": {
                   "name": "Sport",
                   "order: 2,
                   "settings": [
                        ["type"],
                        ["esc", {"mode": "Sport"}],
                        ["exhaust", {"name": "mainEngine", "mufflingOffset": -0.2}],
                        ["gearbox", {"name": "gearbox", "mode": "S"}],
                        ["suspension", {"mode": "hard", "springRate":952500, "shockDamp":18000}],
                        ["ui", {"mode": "Sport"}],
                   ]
              },
    
    This way, rather than making multiple suspension setups (I don't know if that's actually how this would work, but that's what it sounded like in my head) when we switch drive modes, all it does is grab a different value for the same variable.

    OR

    lets say we stick with just ["suspension", {"mode": "hard"}], then I guess we could define a section in the suspension JBeam that would work similar to this... like we define "modes" here, so in the suspension (or respective) JBeams we could have something short per section like...

    Code:
    "driveModes": {
         "modes": {
              "soft": {
                   "name": "Soft",
                   "settings": [
                        ["type"],
                        ["suspension", {"springRate":670000, "shockDamp":12000}],
                   ]
              },
              "hard": {
                   "name": "Hard",
                   "order: 2,
                   "settings": [
                        ["type"],
                        ["suspension", {"springRate":952500, "shockDamp":18000}],
                   ]
              },
    
    And this snippet would show up in the suspension only... which would then be read by the code in the ESC that controls everything. Then you could just call to that from the master "drive mode" code and select whichever you wish.
     
    • Like Like x 6
    • Informative Informative x 2
  5. MilanKD

    MilanKD
    Expand Collapse

    Joined:
    Jul 23, 2016
    Messages:
    941
    Perhaps for the more sporty cars a "wet mode" with less stiff suspension and a slight lift?
     
  6. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Color?!
    Tire pressure is interesting, I'm not sure if our tires properly change their behavior with lower pressure though.

    Yea, that would go under the "UI" category. :)

    Please note, the driving modes thing would only be some sort of supervisor to other controllers/subsystems, so actual active suspension logic would be implemented in a dedicated module. The Driving Mode would then only be a way to control that.
     
    • Like Like x 5
    • Agree Agree x 1
  7. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    This is a bit off topic, but I think throttle maps should be avalible for all vehicles. That way we can have stuff like secondaries for carburetors, so if you have the four barrel equipped on the barstow, you suddenly gain more power past 50% throttle when the secondaries open.
     
    • Agree Agree x 11
    • Like Like x 2
  8. Dr. Death

    Dr. Death
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    1,962
    i usually stick out of the spam of replies of the developer mini showcase forum but i dont get this one. Is this a "group" of options that incluide exhaust noise, engine power, ECS, ride height, and so on to change in-game?

    I do like the idea, i guess, but i find it somewhat redundant. As nice as it is as a discovery project for the ingame options, nobody is gonna want less power, or a less noisy exhaust, or a softer suspension (unless they need it to spin out less). IRL the reasoning behind these is improved fuel mileage, less engine wear, that your ass feels the car roll and the G forces and playing beamng you dont, and that IRL you cannot change the volume of your computer on the fly.
     
    • Like Like x 1
  9. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    Yes, we all know that red cars are faster.
    So (powerglow) cars should change colors to reflect their driving mode :)
     
    • Agree Agree x 10
    • Like Like x 3
  10. ByteGuy

    ByteGuy
    Expand Collapse

    Joined:
    May 2, 2016
    Messages:
    418
    Does launch control count as a driving mode. If not nevermind. But if so that would be a cool driving feature for race or sport mode. However if the car was a single clutch setup clutch wear with launch control would be cool. e.g. Ferrari Enzo needs a new clutch ever couple launch control runs.
     
  11. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Yes kind of, "engine power" is usually not really affected by this IRL, it's mostly how the pedal input maps to the actual engine throttle. The idea (in-game as IRL) is that instead of having to change a dozen different settings of the car, you get sort of "presets". IRL it's a matter of not confusing the customer too much with options and buttons and in the game we additionally have the issue with very limited inputs...

    I think i'll leave that to modders then.... :D
     
  12. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Dunno, I think usually the launch control is either just locked out of certain "normal" modes or simply unaffected by drive modes. Not sure if that makes sense in the game... But yea, technically this could be one of the affected things.
     
  13. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,779
    It will be interesting to see if it can be done and added into the game, it could work, who knows
     
  14. NGAP NSO Shotgun Chuck

    NGAP NSO Shotgun Chuck
    Expand Collapse

    Joined:
    Mar 6, 2015
    Messages:
    1,410
    Most vehicles lack the ability to change tire pressure on the fly, however some military vehicles can... probably worth having around anyway.

    Throttle mapping? Does this mean ridiculous DBW throttle lag will finally be simulated? Because I for one just love it when I step on the gas and the car takes ages to actually go!
     
    • Like Like x 4
    • Agree Agree x 1
  15. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    No, throttle mapping describes the relation of pedal travel vs what actually ends up happening at the engine. NA engines are usually fairly linear, turbo engine by design have a much different curve and on top of that OEMs often change how the thing works in different driving modes.
    With BMWs for example you can feel how the engine actually is commanded much more throttle at the same pedal position when switching from "Comfort" to "Sport". This makes the car feel more aggressive I guess.
     
    • Informative Informative x 3
  16. aljowen

    aljowen
    Expand Collapse

    Joined:
    Oct 21, 2012
    Messages:
    1,677
    I have been pretty quiet about the dashboard that I am developing for the sports car that I am working on. I wasn't planning on showing it until all of the apps were functional, but it's kinda relevant so I will show it here. To my knowledge its the most advanced one in the game, but I would love to be proven wrong :p





    Video shows:
    • Throttle maps (constant throttle applied on the controller, you can see how changing drive modes affects the engine output based on the throttle maps [numerically in bottom left of screen])
    • Different drive modes
    • Drive modes can select tcs/esc profiles (and throttle map)
    • App selection
    • Changing app settings (zoom level on map)
    • Timer running in background
    To be clear, everything in the above video is proprietary Lua to the dashboard cluster. Its not a slot based system as proposed above.

    Long story short, I wanted to chime in to say that a lot is already possible. Throttle maps can already be done, and they are quite easy to implement as long as you know some basic Lua. I haven't looked into adjustable suspension (beyond using hydro's to adjust ride height [which totally works]), so I don't fully understand what is currently possible, being able to set spring and damp values on the fly would be really great.

    So this new system could be really cool (and is probably for the best), but I am also a little concerned about it adding another spiders web of weird syntax to jbeam files.
     
    • Like Like x 14
  17. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,779
    I guess for the system described it could work for the electric cars if any are coming which I know theres an SBR4E model coming out, so I could see it implemented there
     
  18. aljowen

    aljowen
    Expand Collapse

    Joined:
    Oct 21, 2012
    Messages:
    1,677
    That is already possible. Its a great idea too, so I might be tempted to add it to the above car.

    Essentially you would do the same thing as the dashboard, except make it only 1 pixel in size (or more if you want to animate the lighting). Then the Lua can fire off a JS function to change the colour of that Pixel. Then map that texture to anywhere you want to light up.
     
    • Like Like x 2
  19. Ai'Torror

    Ai'Torror
    Expand Collapse
    BeamNG Team

    Joined:
    Aug 29, 2015
    Messages:
    1,547
    One thing would I think suit modern cars with their fancy drive modes a lot, that is different engine sounds playing from the speakers along with the car's engine, especially noticeable on the new Renault Espace, I really do suggest you to do a test drive in one, as it is an extreme case of fooling you that you actually hear the engine. If you set it in comfort mode, you basically don't hear anything, but the moment you kick it into sport mode it suddenly becomes quite loud (on the inside), as it uses the same system as the Clio RS, you just can't choose which engine sound do you want to hear (at least if I remember correctly).
    --- Post updated ---
    Another thing that has been suggested already is different behavior of power steering (a lot of fords have a sport mode for the power steering) It makes it a bit more precise and decreases the amount of power steering assist if I recall correctly.

    And to be honest, I'm looking forward to offroad modes more than anything else, active differential, offroad traction controll mode, more ground clearance in offroad mode and so on. Sport mode is all fine, but I feel like Comfort Normal and Sport modes are the minimum if we're talking about a modern car, sometimes you also have an ability to set your own custom setup or you have multiple in between presets.
     
    • Agree Agree x 1
  20. ast5515

    ast5515
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    220
    Since the game also supports force feedback, why not make it more difficult to turn the wheel?
    Active exhausts would also be nice, maybe even implement a "sound generator" for those 4 cylinder eco turbos?
    Another idea is to make it so the car only backfires or pops and bangs on upshifts in sport mode. This is something that's done in real life as well.
     
  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