FGear Vehicle Physics (v1.4)

Hi, sorry for my explanation.

Due im using typical cars was enough, but yeah changed to axel numbers.


About the other question:

Let say we have 2axels, 4 wheels. In this case i talk about mLateralSlip.

On drifting, each wheel have “different values”, based on position, torque,etc…

So, for LatSlip it may show this:
0L: 6.0
0R: 4.0
1L: 2.0
1R: 1.0

My question is, how can i get the value difference between the front wheels and rear wheels?
In this particular, case, the values to return will be:
0L: 4.0
0R: 3.0
1L: 4.0
1R: 3.0

So, with this values, if needed, i can compensate if the difference goes to high to avoid certain scenarios.

It looks i can store the values in the right way, due i debug and they are fine for each axle.
But if i try to do someting like: mFrontW-mRearW, it just return the same as originals as shown in the telemetry values.

What will be the correct way/logic to achieve that? As said, inside FGearWheel.cpp.

I still do not understand what “mFrontW” stands for, is it the average lat slip of left & right wheels of the front axle?

anyway if you need to activate some sort of behavior based on this data you should do it just before or just after the wheels updates, not during the updates. so the correct spot would be in AFGearVehicle::myFixedUpdate function, right before or right after the loop of wheels updates.

Good morning everyone,
So currently I am using FGear Plugin to control my truck and it’s work well with steering system that I am using but here is the issue I don’t know how to create a widget for it so that the user can map the control on its own, its kinda confusing to simplify it, I tried using Simple Controller plugin and the issue is that Simple controller use float values to map things but FGear use Names and float values from standard input and enhance input so can anyone suggest me a better mapping option that I can use to create my widget?
I am using wheel.

Does anyone know how to create a UI Control panel for steering wheel using FGear because I am not able to get my values by using remapping function of ue5 can anyone please suggest me a way to do it please, I tried controlling with my keyboard it’s working fine and the values and assign keys are changing but it doesn’t show something like this for steering wheel

Hello @lazybitgames I want to rotate the wheels with the wheel slider widget but it doesn’t work, any blueprint reference on how to achieve this?

why wouldn’t it work?

go to FGearAssets/UI/MobileUI in sample project.
open up “ApplyInputs” macro, this is where inputs are set.
put a slider on the gui and instead of reading from the “Steering” variable, set the “Steer” input with the output of the slider. the value should be between -1(left) and 1(right).

What I mean is doing it without having the input of the vehicle, this is more to create scenarios with the vehicle as a photo mode

the above solution should work in any case.

if you disable the standard input component then you can call Vehicle.setSteering function.

addition:
I checked the level Blueprint. It looked fine and like the previous one. As FGear v1.8.1 now moved to Enhanced input I guess something is broken in this regard, my first guess is you forgot to ship one of the Input files (/Game/FGearAssets/Inputs) with the Example project.

I can now re-produce the issue:
It works fine, when using only the cursur up key. As soon as I start using the XboxOne Series Gamepad, it stops working from this very moment on, even when I use the keyboard again, it doesn’t work anymore.

Previously, with FGear <= 1.7 and UE 5 (< 5.4) the same XboxOne worked fine. So it seems there is still a bug related to Enhanced input in either FGears 1.8.1 and/or current Example project. Please have a look. Thanks.

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)