FFB core file(s)

Discussion in 'Programming' started by NOCARGO, May 8, 2019.

  1. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hi,

    Does anyone happen to know (someone does apparently :p) where the very basic code that makes
    the force feedback in BeamNG work sits ? I've been looking around (also in the game engine zip)
    but I don't really see the start of an initial command that says : I am text and from here I am becoming action...

    What I want do to is finally for once and for all (at least as far as I my self am concerned and maybe
    someone might agree with me on this one) make force feedback work as it really should. I mean, overall
    it's never too bad in any high end game(sim) from last 1.5 decade BUT.. if I drive a real life vehicle it takes
    NO effort at all to gently ( I mean a thumb or a pinky finger even will do) push the steering wheel into left or
    right direction AND if I release that same steering wheel then, if the vehicle is moving, it WILL without a doubt BY ITSELF find it's way back to the center. In other words : rolling relaxed and smoothly..

    My idea is to tell the force feedback settings to be lower when I steer IN and higher on return. This MUST
    be possible if only I can find the 'FFB engine'. I have tried and tried tweaking settings over and over again
    it never seems to really be able to behave like that. Best sim so far, by my knowledge, to handle this is
    City Car Driving by Forward Development. They come pretty close to that. But as most on this forum
    know : BeamNG IS the most awesome vehicle simulator to play around with. :) Now I want to learn how
    force feedback really works and how one can alter or improve it to one's own desire. I know for sure that
    this is possible regarding the way it already works (for years).

    PS I know the wheel centers itself on higher speeds with force feedback set on higher values but there
    comes the irrational action of yanking the steer of modern vehicle like it's a 1950's heavy duty truck just
    to steer it into a turn.

    Thx for reading :)

    NC
     
  2. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    Have you tried installing power steering and increasing caster? Cars don't come with power steering by default in BeamNG, but if you install it (and increase caster a bit for some cars) they drive exactly like you describe. Also, there isn't really a FFB controller, the game just takes the torque being applied to the steering shaft of your car ingame, filters it a bit and outputs it to your wheel.
     
    • Informative Informative x 1
  3. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Thank you so much for this valuable information. :) Yes I am aware of the power steering in BeamNG and I tested that. Even tweaked
    their values in the JBEAM for better results. I did not tried adjusting caster yet, does it really makes alot of difference ? I'll try soon.
    But another thing is even without power steering a moving vehicle has to steer gentle and return to center directly right ?
    Very interesting to read that the the wheel receives actual game torque data to work. I didn't know that. I run a Fanatec PWTS wheel
    since about five years or so but took it off the shelf earlier this week after two years or something :) Before that I ran Logitech G25.
    So if your explanation is correct (meaning it will work as I described) it just leaves me with caster adjustment? Strange very strange..
    Too tired now but I will check soon. Thanks again for informing :)
     
  4. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    Yes, suspension adjustment is the best way to get results, alignment can be questionable on stock vehicles. One of BeamNGs claims to fame is its completely emergent FFB, you don't tune FFB by editing numbers in a spreadsheet, you do it by adjusting suspension geometry (which is technically also a spreadsheet of node positions, but I digress). Also American land barges/utility vehicles don't have the strongest self-centering to begin with, but the sportier cars should have stronger steering feel, and you can probably also take dynamic electric steering from the ETKs and use that to increase self centering too.

    For steering tuning I'm not your guy, it's a lot more than just changing caster. Ask @fufsgfen for that, he has far to much free time and has been sim racing likely longer than I've been alive.
     
    • Like Like x 1
  5. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Ackerman is what makes that easy to turn in to happen I believe, inner and outer wheel have different toe, some vehicles are better than others in that, but in games FFB usually lot simpler and wheels are designed for playstation and fake effects mostly, which is not helping in re-creation real behavior.

    I doubt that in slow speeds one could get completely real feeling.
     
    • Like Like x 1
  6. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,662
    To get a wheel to center more by itself you increse toe-in and adjust the caster angle so that the top of the strut/shock (if McPherson suspension) tilts towards the back of the car. This will also make the upper part of the wheel tilt outwards when steering which gives you a tighter turn radius, used in for example drifting so that you can drift at a higher angle and still recover the car.
    Toe-in gives better stability and higher self centering, toe-out gives a better turn in and is not uncommon in drifting, can make the car feel twitchy though.
    When adjusting caster you dont want to go to high, you can cause a high point at almost lock where the wheel basicly shifts from running on the tire thread to the tire sides. This can be felt as a bump in the sterring and it gets heavier to recover that last bit of angle when steering due to you needing tilt/lift the wheel instead of turning it (if that makes sense). I think the 200BX drift setup has a slight amount of this by default if im not remembering wrong.

    I was also wanting more auto center a while ago but didnt get the result i was looking for when udjusting the suspension, my wheel turned out to be the problem. It didnt auto center at all/correctly with certain settings in Beamng. I dont have a external program for my wheel but i assume you probably have a more expensive wheel than me so i guess you got your head wrapped around that part anyway.

    As ive understood it in Beamng, we're getting a very accurate input from the ffb but its depending on the input the game/cars ingame give the FFB. One example is the latest changes in sway bar and steering arms getting Torsionbar settings (not sure what they mean by steering arm but i guess they mean inner and outer tie rods). This tightened up it all for me, remove a sluggish feeling and i constantly had a wobble on the straight if i didnt go crazy toe-in. Not sure if the actual uniball-part of the outer tie rods is simulated to give a slight movement sideways before moving the hubs or if its simulated as a direct link. Id prefer a direct link to improve the feeling of the steering. I btw love the damn FFB ingame now, its been a culprit for me before since the game itslef is awesome but now it so much more fun getting technical on/off roads/tracks, taking tighter corners and what not.
     
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  7. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Steering arm I believe is from lower ball joint to outer tie rod end distance, that distance defines how strong or weak FFB is when FFB multiplier is 1, so FFB multiplier is then adjusted to make FFB to sensible level.

    Steering rack is pretty much same as tie rods it comes to FFB, at least that is my understanding. Tie rods are kinda adjustable in length making steering rack function, while steering rack is stationary.

    So hub from it's pivot to edge of hub is what is steering arm as that is lower ball joint to outer tie rod end in the game.

    Also another thing at least with ETK-I is that caster adjustment is not moving upper end of strut, it is moving lower ball joint instead. Top of strut is perfectly stationary when making any adjustments, bottom of hub node, that is lower ball joint is one that is always moving.

    For Toe I can't remember if it was hub node too that was moving, I think was, but my memory is having too many lapses right now.

    So when adjusting caster, you are also slightly altering wheelbase, when adjusting camber, track width is slightly changing too.
     
    • Like Like x 1
    • Informative Informative x 1
  8. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    It wouldn't make physical sense to implement what you suggest, since the idea of a "center" is just a concept. There is an imagined center where the wheel is in the middle of its travel, but that is not where it should try to return to in reality. Instead there is a steering position where forces will reach equilibrium, that is changing every moment based on everything happening with the car. The game doesn't "know" what that position is until it reaches it. Its an emergent behavior coming from the whole system working together.

    The suggestions so far will increase the steering effort but cause faster return. Reducing the smoothing value as much as you can live with will help the self-steering speed, and so will using the full range of force of the wheel. G27s are not very strong, and belt driven wheels have a lot of internal friction, both get in the way of fast self-steering.
     
    #8 Goosah, May 8, 2019
    Last edited: May 8, 2019
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  9. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,662
    Some very intresting information, thank you, im not enough read up on the suspension jbeam as i want to be, thats for sure. Wish i had more time on my hands for in depth Beamng'ing but the little time i get of work, kids, dogs is basicly spent in the shed working on cars.

    If i understand it right then the whole steering isnt simulated as on a real car? A static steering rack, steering rack arms/ends pushing or pulling the inner tie rod ends that are connected to the outer tie rod ends, which in their turn rotate the hub around the lower ball joint.
    As long as the hub is effected just as a hub is in real life then i guess it makes sense to not overengineer the jbeam structure.
    The ETK-I sounds like it has multi-link suspension? Tensionrod arms/traction arms/radius arms pushing on the lower control arm much like my old Skylines, sucks to dial in but is great when its on point. Could also adjust caster by adjusting the upper control arm to hub connecting point. Same on my old 350z (and current Stagea).

    Sounds like your on point when it comes to the effects of caster and camber. Another intresting thing is bump steer but im way to tired to get into that lol.
     
    • Like Like x 1
  10. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    It is like real car at least up to a point needed to be.

    My understanding is that ffb is coming from the hub, tie rods and steering rack itself are probably not so much part of that.

    As steering arm is part of hub that is where simulation gets all forces, those forces would then be just relayed to steering rack IRL and from there to steering wheel, but for simulation purposes I think same can be achieved from the hubs and if anything it is more direct.

    ETK-I has McPherson front struts from my memory, rear I can't even remember right now, but I remember when modding bit too much caster, front wheels were not at center of wheel wells anymore because bottom of hub was one moved and not top of strut :D

    Would need to open up to remember all steering bits of it properly it is some time I did play with it more.

    Anyway ETK-I is one of the cars to try when dialing in FFB.

    My crappy wheel (T150 Thrustmaster) is kinda annoying to adjust as it has very narrow range of feedback that does not go to much of strength either, so that is worth to remember when reading, wish I could test better ones to find out more about FFB setting, but santa claus has desided I have not been nice enough for last 20 years or so :D
     
    • Like Like x 1
  11. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    No, the forces come from the rack. There is a beam which extends and compresses to slide the rack from one end of the travel to the other, and we measure the force in that. The rotary equivalent for steering boxes is the same. So, you get the sum of both wheels forces as fed through the tie rods into the rack/steering box. So the geometry of the tie rod, steering arms, and all that is contributing to what you feel.

    Beyond that you would only have the steering shaft and wheel, which isn't contributing a lot, some friction and steering wheel inertia, which the force feedback controller already has plenty of.
     
    • Informative Informative x 2
    • Like Like x 1
  12. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,662
    Then it sounds like the improvement making such a noticeable impact/difference on steering for this update was the Torsionbar for the steering arms? Did this make everything 'tighter' (rigid i remember reading from the blog post)?
    I need to emphasize that your work is incredible, its a dream to use a ffb wheel now, its way past the glory days of LFS and RBR in my opinion. Might need to recheck my smoothing value, if that has been impacted too, which i assume.
     
    • Like Like x 1
    • Agree Agree x 1
  13. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    Ah right, yes the torsionBars in the hub are a similar thing to the torsionHydro used for steering boxes. Though in this case they act to rigidify the connection between the wheels axle and steering arm.
     
    • Informative Informative x 3
  14. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,662
    Sorry, forgot to ask; the torsionbar changes for sway bars and steering arms, do they automaticly apply to old mods or do these have to be updated?
    Basicly, will pre-0.16 mods have sloppier steering than the vanilla cars has now?
     
  15. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    Torsion beams are a new type of beam, any old mod will still use old style sway bars. It's usually only a few lines to replace them though, it's not very difficult if you really want to.
     
  16. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Well.... these are all extremely informative extrapolations (is this the right word?), gentlemen.
    May I conclude that an efficient self centering by FFB still needs a bit evolution ? After all it still so much (hours of) work
    already just to make a vehicle's FFB behave as desired and then if hopping to another vehicle restarts the same process. :/
    Aggressive driving always works fine, I mean, this already for years imo but when it comes to smooth nuanceing and even also
    driving fast if the self centering is too late I loose path (and then the wheel sudden pulls to left or right a bit) and hit something.
    Would it be possible to let a small external program of whatever kind control this 'few inches' or even less and tell the wheel to tighten around it's center or something ? Does the optional curve in the game's FFB menu (how's it called again?) can contribute to this in some sort of way maybe ? Yesterday I read in this other thread that something is not right when that line is plane straight ? Mine is in fact. Then I also catched
    some discussion on this wheel.csv file being used to alter settings and removing it afterwards ? But in the wiki I cannot define where
    to find this file to begin with or how to create it ?

    Edit: Oh, @Brother_Dave, yes I should check the advanced wheel settings from my wheel program first too,
    I guess. I'm going to do this know :)
     
  17. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    There is a simulate G-forces option for FFB which will pull the wheel proportional to the estimated G-force on the driver, in order to simulate the forces the driver feels. It will probably help recreate the effect you want.
     
  18. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hmm interesting.. I did read mention of this also somewhere yesterday. I'm going to look into this, thx :)
    (in fact, my personal base car (mod) has an acceleration meter sitting in the dash)

    But guys, I am getting this feeling again.. A solution is laying somewhere out there to be picked up. As I just did some driving and testing again my unconscious instincts about this matter that I had before are becoming more clear. There is more into this. I come to realize that yes, FFB is great as it is but it lacks factors, NO doubt about it. As a born driver (few generations) and a professional one too I DO know what happens behind a steering wheel. FFB is very good in giving responding forces of a vehicle but there is more.
    These forces are certainly not always as strong as they are represented in the 'standard FFB model'. BeamNG (finally a rig is out there)
    is awesome and as I stated in OP I am going after this NOW to fix it.

    For example, look to how a gamepad or keyboad acts on the car : let go the button and the wheels flip RIGHT into their neutral position.
    A gamepad has a spring into it's mechanism. Release it slower and the wheels return... slower. Only the tiny knob is too difficult to control.

    Now, let's look at a real vehicle. Yes, a vehicle responds to momentum and the way the mechanics are constructed, meaning that wheels
    pick a certain direction when control is partly or totally lost. But I can assure one after many many many real life miles, including some
    (I confess) 'playful' behavior behind the wheel, that a power steering equipped vehicle is way less heavy to counter steer then what
    FFB makes out of this. (It's easier to counter steer but the car still under or over steers) Rome wasn't build in a day so no offend of course :)

    So, what am I going to do next to fix this ? Don't know yet, that's why I'm writing it out here (chuckle chuckle), but I'm getting closer.

    Anybody follows ? Real life car : power steering pump. Gamepad : spring driven. Wheels of BeamNG vehicle : listen to controller !

    Also, please note that at higher speed the wheels DO center immediately. Only force feedback takes a leap with the true center of
    the wheels, yanking the wheel shortly afterwards to get one out of control. In my opinion the solution is to apply (at least) a somewhat
    slighter FFB force combined with a factor that isn't there yet but slowly arising from my expansions on the subject. No spooky action from a
    distance (Einstein) here, a real life car is also depending on it's 'controller'. This whole FFB tweaking from vehicle to vehicle and still
    have no real life result shouldn't be necessary anymore :)

    PS @Capkirk I checked Fanatec settings menu there's only two settings to adjust : force feedback 0-100 and dampening strength 0-100 :)
    --- Post updated ---
    I think I just designed a next gen steering wheel controller :

    Add a low strength spring to it so that it finds it's center by itself :D
    --- Post updated ---
    But to be serious : look at the coordinates of a steering wheel settings menu. They are SO precise !
    That no one came up to the idea so far to make the darn (sorry) wheel center purely firmware based ? Uh...
     
    #18 NOCARGO, May 9, 2019
    Last edited: May 9, 2019
  19. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    The simulate G forces option is in BeamNG, it's called side accel feedback.
     
  20. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    But to be serious : look at the coordinates of a steering wheel settings menu. They are SO precise !
    That no one came up to the idea so far to make the darn (sorry) wheel center ?
    I know, Captain, but it doesn't work. At least not according to the thread's concept :/
    --- Post updated ---
    maybe it's tweakable outside of the ui like in a core file or something ?
    --- Post updated ---
    I've got it set fully maximum
     
  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