FGear Vehicle Physics (v1.4)

what do you mean by being killed?

when standard input is disabled it does not interfere with any vehicle input anymore so if you disable ai component and standard input is also disabled then the vehicle will continue to use the last input from ai, so this can be considered as a bug, we will fix it. if this is not what you meant please elaborate.

Yes, the AI part seems to use the last received input and doesn’t automatically set throttle and steering to 0.

But it affects the player input as well. When a vehicle is killed/blown up (car combat game), or the ignition is set to ON or OFF, it sets 2 bools: IsDead? and/or IsOn?. So what’s happening is when a vehicle is killed, or the player turns the vehicle off, the Vertical Axis is still driving the vehicle forward, even though it shouldn’t be. I can turn the ‘ignition’ to ‘on’, put the car into gear, drive forward, turn the ‘ignition’ to ‘off’, and the vehicle still accelerates forward by pressing the Throttle. If I re-enable StandardInput to change the Axis values to ‘none’, then disable it, the throttle doesn’t work at all, in any situation. So disabling it doesn’t seem to have any real affect.

This is my throttle controls. ‘AI_Throttle’ is being called from tick and is only being used by AI vehicles. When IsDead? is set to TRUE, it kills the AI throttle and steering input, but the car still drives on the last received input.

This is what it looks like in-game (player controlled), with the ignition set to ‘off’. The vehicle moves forward in this situation, even with StandardInput disabled (vertical axis set to Forward).

This is with the ignition set to ‘on’. This works fine if the vertical axis is set to Forward (even though StandardInput is disabled). If the Forward Axis is set to ‘none’ but StandardInput is still disabled, the graph looks exactly the same, but the vehicle will not move at all.

I hope that makes sense. Please let me know if it doesn’t. Thank you.
EDIT: Having a built-in ignition on/off switch would be awesome!

@xetura

i thought you were using the FGearAutoDrive component so you are using your own AI solution.
in this case there is no bug involved, i think you are just making a logical error just like your previous problem.
while car is active call setThrottle every tick and update your “ThrottleAxis” properly.
no need to enable/disable StandardInput, it is out of the equation, leave it disabled.
when your car is dead you need to manually zero out all inputs and stop injecting inputs.

I’m already doing this as indicated in my graph. But the problem isn’t just the AI, it’s the player input as well.

I guess I’m not sure why there is an option to disable StandardInput if it doesn’t disable it. When I disable it, it should be disabled.

This works fine for the AI, but it doesn’t for the player. The car accelerates when I press the throttle no matter what.

I decided to run a test by deleting InputAxisForward, since it doesn’t seem to do anything and I was right. It does absolutely nothing. The car still moves forward without it even being in the BP. So how does that work if StandardInput is disabled?

no you do not, according to your graph if IsOn is false and IsDead is true then setThrottle is not called so the car will be stuck using its last value.

it disables it, no need to question that, the vehicle class stores the latest input data it does not matter if StandardInput is enabled or not.

assuming “InputAxis Forward” is player input then if IsOn is true the car will accelerate when you press throttle.

i checked the source code, StandardInput is enabled automatically when the pawn is possesed and disabled automatically when unpossessed.
this may be causing problems, you can check telemetry option for input to see if StandardtInput is really disabled or not.

IsOn is always set to True for AI vehicles. The top part of the graph doesn’t apply to the player, only AI. And the AI_Throttle event is hooked to Tick.

Setting the ‘ThrottleHack’ to tick fixes the AI problem, but the player input is still an issue.

Telemetry says it’s enabled, even though I have it set to be disabled.

So it isn’t being disabled for some reason.

it is reenabled, we will make this(auto enable/disable thing) optional.

for the time being try calling Vehicle.getStandardInput().setEnabled(false) after possesing the car or just call it every tick.

Ok, thank you.

I have that node setup already and it doesn’t seem to work on BeginPlay. I just tried putting a delay of 1 second before the node, and it seems to disable it now. Putting it on tick also seems to work. Not sure why it needs a delay to work.

I’m running into an issue when getting the ‘max power’ float. Telemetry shows a different value than the BP node and I’m not sure why.

fgear_max_power_01.JPG

This is from my ui.

fgear_max_power_03.JPG

This is the bp.


The more power an engine has, the larger the discrepancy.

CalculateMaxPower returns in kW(kilowatts), to get the hp value you need to multiply with a constant around 1.34

Awesome, thank you!

https://www.unrealengine.com/marketp…ehicle-physics does client-predicted, server-authoritative networking.

4.25 binaries are now available for v1.2

@Supline
i have seen that high speed self steering can be caused by the (Mx)Overturn Moment Scale parameter which is only used with the MF6.1 tire model, make it zero and let me know if it makes a difference.

have also seen another type of self steering issue with lower speeds, it happens when the steering comes back to zero after a turn, the vehicle does not go straight but keep on steering slowly to one side. this only happens with certain setups and i could solve the issue by resetting some tire model settings, specifically the “Combined Lateral” parameters.

is this an answer to my previous post or an advertisement?

i have checked the forum page of that plugin and it says:

if it has a proper smooth client prediction then it is good news for us because it means it is possible to do it without modifying the engine source and we will eventually implement that feature.

That plugin is also abandoned and stuck on 4.21. As someone who used that plugin, FGear is far superior.

Agree Fgear is very superior.

the latest sandbox demo is available here.
this one includes a motorcycle sample and a moving platform.

The sandbox demo looks great. Is there a demo project for the sandbox?
I would like to see the settings of each vehicle.
The only folder I get with the plugin (when I enable engine and plugin content) is the sedan.
Thank you in advance.