FGear Vehicle Physics (v1.4)

Thank you for resolving this issue, it’s a small detail, but it may bother some players.
Since my game is still in the middle of development, I can probably wait until the next update. Thanks

1 Like

Having some issue doing donuts or drifting around objects, due the car is angled the brakes stops the wheels too sharp.

If i go straight holding brake+accel, the car wheels still goes max at 1st gear, hitting the rpm limiter which is expected.

But on steer, when more angled is the car it losses wheel torque more fast until stops completly.

Thats with ■■■ in both axles no matter Diff Strenght. With Diff Locked works more as expected, speed is reduced but not to 0.

Wonder if the ■■■ implementation is correct or there is some issue with some lateral formula.

Checked the “FGearDifferentialType::DF_■■■” on FGearAxle, and it does a lerp between open-locked using DiffStrenght for time.

But with ■■■, using DiffStrenght to 1.0, not should get the same behaviour as locked?

Edit: LOL, UE censures " L S D" XD

locked diff has one difference then l.s.d with %100 power. we make sure the wheel rotation speeds are the same when the diff is locked, see UFGearAxle::postWheelupdate.

1 Like

Oh! interesting. Im playing Dirt4 and DirtRally2 and on brake in that conditions and based on handling options, or never stops or it does smooth, maybe even adding less friction or a bit more slip to make it less sharp pressing braking for a better management, so the car still goes but seems slips more from rear(or gets more revs there) giving more precision range.

Also i may increase revs and max speed on 1st gear to help a bit more. Already tried tweaking the engine with limiter time/friction torque/inertia but not does a big thing.

I’d also like some way of the power/wheel speed to not decrease when turning, not sure if this is what you are sort of trying to achieve @Davit_Masia but @lazybitgames is this possible?.

Even if was was switchable to totally remove the power/wheel speed dropping when the wheels are turning this would be a massive benefit, I have many vehicle types and to have this functionality would be a massive win.

@PerfsPC In my case im talking about turning with accel+brake or while doing donuts or drift around with already lot car angle.
/

@lazybitgames Tried some fast things but not get working as wanted, lot of understeer.

Doing some tests i will need, on brake+accel, to Front-Rear axles, slider options for:

  1. Min speed on full accel+brake.

  2. L.S.D Checkbox to tell if both wheel keep speed from dominant wheel(As LOCKED does) or DiffStrength based. If Diffstrenght based, example:
    If min speed is 40, that goes for dominant/gripping wheel, the other less, based on DiffStrenght setup in L.S.D.

With something like that, we should be able to configure better the driving in the mentioned scenarios.

1 Like

Alternatively or as extra to point 1, maybe some ratio to customize the decrease of wheel torque by car angle when brake. So it can still goes to 0 if too much angle, but we can manage to avoid the car stops sharps when reach certain angle, and being more permissive / smooth.

Got a first sketch of the braking behaviour i was looking.

In the video i just use the brake to keep the drift and show the car behaviour. No more suddenly car stops / fast rotations when brake in this scenarios.

Atm no lerps, gripping wheels, accel or currentSteer taken in account on formulas for a better smooth/accurate feeling. Just braking and car angle.

Still hard to control, but with previous missing stuff mentioned + feathering/throttle control with Accel on pressure variations should give all control needed.

Here the WIP code that works with my actual setup to give an idea how is made:

1 Like

Looking good there… keep at it!

Now with individual Front/Rear brake and Gripping Wheels support for tweaking.

I will say, better behaviour, more smooth/precise/predictable, now with brake control i can drift around objects more close to them.

New code version:


The actual code is a mess and i dont know if using “setBraking” is a good idea, but seems to work as intended.

@lazybitgames , Btw, wonder if there is any chance to add it properly inside the “FGearArcadeAssits” component as: “DriftAssits: Brake”, maybe as experimental feature?

2 Likes

Really good work @Davit_Masia !

Realized there is some bug in the code with the Wheels due in one side i put all Front and in the other all Rear i may update the code later if i can fix a weird behaviour.

It seems the car behaviour is not the same if turning left or right, using FWD one for my tests. Seems is not problem of my code due it happens even without braking, just it makes more evident. Btw i guess i should add getKMHspeed from wheels to the formula to be sure all wheels gets the desired brake in all scenarios.


Edit: I did some debug and found that if i set Differential Strength to 0 instead of 0.5 the problem is fixed ¿?, now the behaviours turning left/right in all scenarios is the same. But in the moment i set 0.5 again, on turn left the front left-wheel(no gripping wheel) gets to 0 speed, but if i turn right, with the same setup/conditions, the right wheel(no gripping wheel) it stays at max as it should ¿?.

Are there any plans to support 5.5 (when it release) and beyond?

1 Like

I’ve also noticed differences when turning left, when changing some of the Axle setup Locked/L-S-D etc. this also changed it so as you mention must be some bug?

will keep support for newer unreal versions and will fix critical bugs.

2 Likes

I also detected a small difference between left/right steering too but in my case it’s not related to differentials, the tire model has asymmetric inputs(the default attributes for the tire96 and mf61 models generate asymmetric curves) and when I checked “Force Symmetry” option in the tire model the problem was gone.

1 Like

I see, good to know, i remember tried that too in one tire model i have cloned for testing but maybe due the differential strength + other stuff not worked. Im guessing the differential strength may be not the problem but magnifies it due his behaviour.

I will try again all that, because i also found that the FWD which is the one im using for tests , the block primitive used for mass in physics was a bit missplaced to left so i had to add some correction which helped a bit. I mean here:

I had some bad behaviour on turning+braking without accel that makes the non gripping wheels from rear axel block.

Got fixed setting ABS to 60(before 50), which i can understand due ABS avoids locking wheels on brake.

But other thing, no idea why, was setting 20 at: Front Anti-Roll Power.

Checked the FGearVehicle to know what it really does and seems it gets suspension compress ratio, then sets a springCoeff+Modification.

So, what it exactly does that SpringCoeff? and Why it helps to avoid rear wheels lock on braking ¿? Any idea? Because i want if possible let ABS to 50max and without antirollbars, but cant understand why just that one blocks on cornering+braking.

first of all I do not recommend using the standard antirollbar feature, it stiffens/softens the suspensions based on the vehicle’s balance but I didn’t observe much effect on the overall cornering performance of the vehicle. there is a separate antirollbar effect in arcade assists which is more effective but at the end of the day it makes the vehicle more arcade. so if you can get away with not using standard antirollbars then skip it.

1 Like

Ok, removed, increased the front wheels spring from 40 to 50 and seems does the same fix.

If Front/Rear antirolls on Vehicle are not recomended, to avoid future usage i think for next update better remove that 2 sliders.

Still not understand 100% why this fixes the wheel block, my guess is due cornering, the non-grip rear wheel is the one with less contact on asphalt(load), so on braking + friction torque (and other possible stuff) makes it lock.

Then giving more in front makes the car swing less on cornering, producing more load in that specific wheels.