FGear Vehicle Physics (v1.4)

Bug: Acceleration-input broken with UE 5.4.2 in current FGear v1.8.1 in current Example project!

Previously, FGear worked fine with UE 5.3. (still have copy of that too)
Now that FGear v1.8.1 supports UE 5.4, I downloaded current Example project (Dropbox ) from the FGear UE marketplace page.
I opened FGear.uproject with UE 5.4.2 (current version), and tried out “Sandbox2” map (as usual). The acceleration is broken. I can rev the engine with keyboard key and Gamepad trigger as usual, but the car is not moving forward. The rev-debug-display works correctly. All other functions work completely fine.
With “Sandbox” map (the outdated map) the car is moving ever so slightly forward (probably bug), reaching 10 kph after 1min. (I can break, steer, everything else is working fine, only acceleration-input isn’t working).
Something is broking in the current Example project (or the latest FGear plugin), please re-check and fix it. Thanks.
(Windows 11 Pro, Visual Studio 2022, UE 5.4.2, XBoxOne gamepad)

@lazybitgames Ive been trying to find the problem on cornering with no luck, and maybe i found the bug is causing it, i can send you the FGearExample with the car params.

Can you double check the Differential Strenght on rear wheels? seems not work as it should. I checked the FgearAxle.cpp and seems fine, but on driving not gives the same/similar results like in the front wheels does.

If i understood well, when you cornering, the wheel where there is more pressure/load ¿? should add more torque to that wheel, so it makes the car steer better.

I added DiffStrenght to 1.0 , in Front and rear Wheels. In the Front Wheels,you can see left has 1474 and other 6018 torque, due the right one has more load/presure turnig left.

But if you check the rear wheels, in this exact frame, right wheel has less torque even it has lot more load/pressure. Here the screenshot:

But in this frame looks fine. The torque difference between left/right rear wheels is:
Left=1605 || 5487=Right.


This happened just on change gear from 3 to 4, but as higher RPM that difference disappears, only on rear wheels.

Tried with the last FGearExample, and same. On front wheels you can see a clear difference between left and right: 1643/4954. But on rear wheels is 2975/3593.
imagen

This is the Axle config. Front and rear.

Here a more extreme case, load is almost double, but torque near the same. On front wheels seems right, 1616/5022, lot of difference, but on rear is 3273/3343.

EDIT: I checked a 1.62 version i have in UE 5.2 and there the problem is inversed. The front wheels with 1diff strenght happens the same, but rear wheels seems fine.

EDIT2: On 1.7 front wheels works fine, Rear Wheels seems to works well most of the time, but some scenarios gets the same /similar torque.

And now seems on 1.8 rear diffstrenght / torque is just broken most of the time.

I tried to download again the FGearExample and yep, same problem here.

it looks like not a bug but an existing issue is revealed.

with 1.8.1 we added the ability to override clutch input even if auto clutch is on.

apparently an old clutch axis binding was creating incorrect output and we weren’t aware since we were using auto-clutch.

so it is not a throttle issue, the clutch is fully pressed so the vehicle can’t move at all.

if you remove or set zero scale for the input axis below then the issue is gone.

1 Like

first of all you shouldn’t set torque share to 1.0 for both axles, their sum should be 1.0, in your case you get double power from the engine.

when it comes to differentials, locking torque is dependent on sth. called “feedbackTorque” which does not necessarily mean more load will give you more torque. if the wheel has less traction even with high load it might return lower feedbackTorque which results lower torque output.

I haven’t modified locked diff code for a long time so the difference between versions should be about the changes of “feedbackTorque” calculation. it’s quite a tricky concept and may not be physically accurate so you’re welcome to experiment on it’s calculation, see UFGearWheel::updateWheelFriction.

1 Like

That function does not appear in the pawn, where is it?

it is a function of FGearVehicle not pawn, try casting your pawn reference.

nothing, it doesn’t work, deactivate the standard input and nothing, the wheels don’t turn , If possible, make a reference with widget and images to know how, because I already tried everything I could
Ref

Oh I see, well its obvious on different version with differential strenght 1.0 the behaviour changes, so if is due the FeedbackTorque is a good start point to check differences between version to see what changes does that. thanks!

Whats the difference between this ones?:
mVehicle->getSteerDeltaAngle(True)
mVehicle->getSteerDeltaAngle(false)

the name of the parameter should tell the difference.

it returns an angle between the travel direction and the intended direction.

true returns the angle for front axle, false for rear axle.

1 Like

Yeah, thats what i thought, just wanted to be sure.
.

About the torque thing, found that on accel+cornering, torque always have the same value as LngForce, this one: mLongitudinalForce.Size() .

But for some reason, sometimes, the rear wheel(the one receiving the most load) not match that value. In this case is less than it should, like if there is some limitation somewhere¿?

With other setups LngForce is opposite(lower torque share), so no idea what is happening. Trying different mFeedback versions and other combinations.

Tomorrow im gonna try to manipulate the torque myself to do what i want using mVehicle->getSteerDeltaAngle and similar stuff, at least try to know if that really will fix the steering problem.

@lazybitgames is there a way to get trace information from the avoidance information in the FGear autodrive component?

edit:Just checked and saw that the trace is not available in blueprints. Would be nice if we could get the hit results in BP for the next update

Thank you. Can confirm this fixed the issue.

Wanted to change some car behaviour when brake +Accel, due if engine has more force it gearsUP and it not should.

In FGearTranssmision.cpp i added this:
float aBraking = mVehicle->getStandardInput()->getBrakeRawInput(); // Added

Then i changed:
This:
//else if (speedUp > mUpSpeed && mCurGear > 0) // Original
By
else if (speedUp > mUpSpeed && mCurGear > 0 && aBraking == 0.0f) // Added

It works, but wonder if it will be the correct way to do it, since im using a rawInput. Or maybe better the axis, action, wheel… options ¿?

prefer final inputs, that’s the actual value used for braking, call getBrakeFinalInput();

1 Like

@lazybitgames Just following up on the Fgear AI controller. Will it be possible to make the the obstacle traces exposed to BP in the next update?

auto drive component is far from being perfect, it is supposed to give you some ideas about how to roll your own solution so I would build my own solution.

can we expose hit traces, yes but can’t give you a date right now…

Hello, I just got Fgear, love the plugin, but ive but struggling a bit with the way it shifts, my car has a rpm of 9250 and has a hp of 963, but for some weird reason, it gets stuck in the 6th gear at 326kph and will never reach up to the 7th gear, vehicles top speed is 372kph. Ferrari Laferrari specs, And to top it off, the RPM never goes down after gear shifts up, some help would nice, thank you.