FGear Vehicle Physics (v1.4)

I tested in the EnterExitDemo map and unfortunately, the issue occurs there too.

The issue primarily happens when there is a sharp incline in the vehicle’s collision

To demonstrate, I added a cube to the sedan and it also started jumping around like the tank.

Naturally, I can’t just have a simple box as the vehicle collision for my project so upon testing, I realized that the sharper the angle of these boxes is, the more chances of it getting affected. So at 90 degrees, it’s completely affected, at 45 degree it’s hardly affected.

If this can be fixed code-side, then great, otherwise, I’ll have to rework all of my vehicle collisions to be rounder instead of boxy

yes, as I have said it does happen in unreal 4.27 but not in 5.6 in the context of this test map.
fgear does nothing special with the physics body, we calculate the forces and apply them nothing more.

Right, so for 4.26, I guess I gotta use my work around.

@lazybitgames Have some question related to ABS, which actually uses deltaV scaler,
In big update, Is gonna be improved/re-implemented too?

I mean, via BrakeTorque modulation / pulsing, per wheel?
For shorter stop distances + reach peak slipRatio without mLngSlipOverride hack.

Trying to avoid hacks, so disabled ABS (set to 0) and implemented my own EBD system.
Reduces BrakeTorque per wheel/axle to keep stability + avoids wheel lock (via SlipRatio/Angle)

For optimal slipratio im using the actual hack due this ABS pulsing system can be tricky.

i’ll try to improve it but if my attempts fail then i’ll have no choice but to keep using the deltaV trick.

Also for big update, if possible, in transmission:
Able to set different “change time” for upshift/downshift and enable/disable revmatching individually.

For rallycross cars setup, downshift is usually near double slow and upshift no need revmatching.

hi @lazybitgames, I’m making an AI system , I needed the car to toggle physics on/off based on distance , just like we can do on chaos vehicles (calling set simulate physics on the mesh) , but this doesn’t work on fgear , do you think it’s possible to do that on the car body mesh?

also is it possible to change a skeletal mesh in runtime and still have functional wheels? cuz i’m calling set skeletal mesh asset and the wheels dont have collision anymore(same skeleton names) @lazybitgames

hi @lazybitgames , maybe I am missing something here.

The engine RPM seems off to me, as the calculation is clamping the feedback rpm between mIdleRpm and mLimitRpm (if the engine is running), the sign will be 0 and will cause the delta rpmVel2 to be 0 as well.
This will make the mRpm value be equal to mIdleRpm as long as the feedback rpm is below mIdleRpm.

If mLimitRpm is 9000 and mIdleRpm is 6000, even if one is throttling and the vehicle is movng, the rpm is not changing and still equal to mIdleRpm. Only if the feedback rpm is greater than mIdleRpm will the rpm raise.

Should it not be that mIdleRpm is the start and any throttling will add up on this values / make it raise?

only calling set simulate physics wouldn’t work for any game unless it’s too basic.
I had implemented this in a game project a couple of years ago.
you need additional steps like sleep/wake, hide/show, enable/disable collision, enable/disable ticks etc. you may also want to reset the physics state like resetting the linear & angular velocities.

you mean swapping the vehicle mesh, I don’t think it’s possible out of the box.
you would need to rerun some of the steps in vehicle beginplay to make it work.

if the idle rpm is positive the vehicle can not come to a stop without stalling the engine or the clutch should be disengaged.
for instance the RC car has zero idle rpm so it can stop and the engine also stops.
a vehicle with 6000 idle rpm could go like 50kmh with the initial throttle, anything below that would stall the engine.
if you disable auto clutch the vehicle will try to go with the idle speed unless you operate the clutch yourself.
stall assist can fight with this behavior and prevent a stall by partially disengaging the clutch.

hi, thanks for the response.

Maybe I have written the question a bit confusing with the example values.

What I actualy meant was: If I do throttle I do expect the rpm to increase, but it does not, only after the feedback rpm is greater than the mIdleRpm does it increase.

The question was if this is intented behavior?

thx for always answering us till this day , i’m swapping the mesh on the construction script (it worked)

it is the correct behavior when engine stalling is off, normally the rpm could go below idle and may stall the engine. to stall the engine auto clutch should also be off.

btw this behavior of the engine & clutch is reimplemented in my r&d branch, the rpm clamping will be optional.

Any teasers or videos of upcoming features or updates?

unfortunately the development is all over the place and I can’t say what will or will not make it.
and it’s hard to tell how long it would take since I’m not working full time on it.

@lazybitgames Due i was in need of a proper anti-rollbar i tried to improve the actual one in ArcadeAssits.
Here the final code: // === NEW VERSION ===void UFGearArcadeAssists::updateAntiRollBars(){ / - Pastebin.com

I was thinking to add some damping too, but original not had, maybe due this is applied before comp/relax dampers so not needed?.

Btw, just sharing in case it helps, also anybody can test easy, just disable the original code and paste this one to test how car reacts and if works better for their project, if not, just remove and enable the old again.

EDIT: Now trying using torque.X , from overturning applied to chassis that seems it should be the physical correct way.

@lazybitgames For the big update, the new drivetrain, a torque vectoring system is planned?

Actual L-S-D (Front/Rear) are based on mFeedbackTorque (Slip>Passive).

A torque vectoring(TV) system (Pro-Active) is based on steering/yaw rate, car/wheel speed, Throttle, etc…

I did some fast tests and feels good, it fixes my problem of lack “push/rotation” on 90-180º cornering in desired scenarios.

But seems the correct way is both working together, first should act TV, then L-S-D front/rear = final wheel torque.

how to change input system to enhanced input system in cpp?

i try to some base car actor implement to cpp.

actor inherit AFGearVehicle and get standardinput using getStandardInput() function.

but, i can’t find set input type function or like in standardinput.

there is only exist get, and i try to find some set function in FGearStandardInput.h and FGearStandardInput.cpp but i can’t.

how can i change?

i’m using UE5.6.

best regards.