FGear Vehicle Physics (v1.4)

@lazybitgames Is there any bug with the car chassis movement / suspension?

I realized that maybe the suspension or car chassis not moves / rotates in sync with the car inertia + cornering.

Here some video about the problem im talking about:

When you go to right, the load increases on left, and when you go left, the load goes on right.

But at some moments, it looks locked and it goes to one side with the chassis still rotated in the wrong way and not feels correct.

I exagerated the suspension, spring and other values to make the bad behaviour more evident.

suspension settings can result unrealistic behavior so you need to be careful with them.

check Relaxation Damper & Suspension Relaxation Downforce options.

excessive damper values can also break the overall behavior.

After some debug i found the problem is ā€œSteer Input Gravityā€.

This is the car chassis behaviour difference between 1 and 6, just that change.

This is with Steer Input Gravity:1

The movement is smooth/sync with the car, all as expected.

This is what happens with Steer Input Gravity:6

I feel the car chassis movement / suspensions is wrong/erratic.

Tried with suspension default values and other and cant get that car chassis smooth swing.

I know the car direction / steer changes fast, but suspension/car chassis should adapt and be smooth, but instead is like gets locked/paused and changes like if hits some limit/clamp Āæ?.

Will continue tweaking values like the ones you mentioned, if other let me know.

it looks ok to me, with high steering gravity you can swing the steering angle very quickly but the body can not respond that fast due to its inertia, if you lower the overall inertia then it would respond fast but itā€™ll be quite unrealistic and feel like a toy car.

I need to do more tests and pass all values from lst version, but on FGear 1.6 and steer gravity 9 the feeling is much better than on 1.82 and steer gravity 5. The suspension and car swing not gets paused and on counter steer it does the swing from load to lef/right wheels more smooth. I will update when complete all tests.

1 Like

Appreciate all the tests your doing Davit, Iā€™m sure the gems you are finding will contribute to @lazybitgames performing some updates if possible for 5.5 if he deems them to be needed.

1 Like

FGear 1.6 with Steer Input Gravity 10, so smooth:

Was unable to add exactly the same params due in 1.6 some are missing, also this is 1.6 in 5.2.1, got some warning to ā€œbuild anyway for 5.2ā€ and still worked.

If you compare you can see how the chasis this time moves/swing smooth without pauses between counter steer and reacts better to what is happening. So i wonder if the problem may be the new suspensions or some new feature/params added not works as expected.

i donā€™t think there is any change that can effect body roll between 1.6 and 1.8
iā€™ll take a look when I get the time.

Well, looking 1.6, it not had even line/sphere/convex options. Im may try later other versions to see if i can catch where the suspensions got weird. Also im gonna try in last version set default values in some params that are not in 1.6 to see if maybe one of them is messing with suspension/chassis.

line & sphere cast has existed from the beginning and convex was added in 1.5

also make sure you do your tests with the same unreal version, there might be differences in chaos too.

All tests are on 5.2.1.

The problem on 1.6, The ā€œFGear Vehicleā€ category is missing Āæ?
Which includes the tracing, mass, Update Rate, gravity, telemetry, etcā€¦

The version 1.62 works fine in 5.2.1, but 1.6 have this problem. Any idea why this is caused?

I had reorganized those fields at some point but it shouldnā€™t be hidden.
by the way 1.6 was pretty broken(chaos issues)ā€¦

Im still doing test but i will say is all about pararms, the problem is on 1.6 that ones are missing so no idea what i had there. I may install later the 4.27 version to see if they show there to confirm some stuff.

But i reduced the possible params too:
Inertia Scale Z
Center Mass
Tracing
Spring Rate + Compresion Damper

And seems how mLatFrictionForce is managed may have some impact too.

Have some questions about this:
//additional factors : direct friction coeff, lng/lat friction coeff, 2x magic
mLatFrictionForce *= mFrictionFactor * mLatFriction * 2.0f;

1.- Are you using mLatFrictionForce from wheels, in some way, for the chasis movement?
2.- In that case, is correctly implemented? Or is some workaround?

No idea, just asking, if is correct then i will need to tweak my values and add some fix on counterSteer to get as i want.

If not, wonder if due this is more an arcade plugin, you will leave as it or may be improved in future?

Got the movement i was looking for, changing the mLatFrictionForce formula.

This is FGear 1.8.1 in 5.2.1:

No matter speed(tested until 210 KMH), the car chassis keeps always the smooth movement.

Later will try if i can use it only when needed(like countersteer) and adapt to my drift behaviour.

Hello what is the best way to detect impact/collision/crash with fgear vehicles multiplayer game if thats relevant. I would want to be able to detect the crash and also how strong of a crash it was too apply different types of damage for a big crash compared to a minor bump

You can bind to the on component hit result of the mesh

Is there any event that informs that the car stalls? I wanted to cut the engine when using the manual transmission, either when not accelerating with the clutch lifted or when not being able to climb a very steep hill.

it could be detected in a couple of ways, for ex:

float kmhSpeed = mVehicle->getMaxWheelKMHSpeed(true, true);
float wheelRpm = kmhSpeed / mVehicle->getMaxWheelRPMToKMH();
float targetRpm = wheelRpm * mVehicle->getTransmission()->getTransmissionRatio();

so if targetRpm is below engine.idlerpm then the engine may stall.

note: the code is not checked for errors but can give you an idea.

Unfortunately I can only program in blueprint, what I tried was basically: (if RPM < IdleRPM then SetRunning false), but the RPM never drops below the Idle limit, even when it reaches the point where the wheels stop spinning with maximum acceleration.