FGear Vehicle Physics (v1.4)

I not understood this, Afaik, release opensource is upload like on GitHub or similar and free access to everybody, what you mean the opensource will be more expensive?

About release date, from what you said guess is not expected this year.

So still no idea if a final big update, V2 or what? Not even a minor update with bugfixes or small features already well tested? Or the previous was the last one and everything from there will be hold until you know the future of the plugin?

opensource doesn’t mean free. currently you get the source code when you purchase the plugin, when it’s closed source you’ll only get the compiled binaries (dlls).

release date really depends on the game project, there is a game project we’re planning right now so if we start this project the release will be delayed for a long time. if we give up about the game then I will focus on the plugin itself and a release can be expected this year.

in its current state small fixes won’t bring much value, there are structural barriers to bring the plugin to a new level, that’s why most of the code is rewritten in v2.0 and there are also major feature additions. there is no new feature plans for v1.x branch, I will only fix reported game braking bugs and adapt the plugin to new unreal versions.

1 Like

@lazybitgames what options can I tinker with to make vehicles more optimized when:

  • When they are actively being controlled?

  • When they are idle/sleeping?

I’m trying to set my vehicles in sleep mode at begin but the Sleep function doesn’t seem to be doing anything. I set the sleep threshold to a very high value in the default settings of the vehicle and it checked using the “get is sleeping” function and it seems to be flip flopping around alot.

Edit: I just stumbled upon the fact that vehicle sleeps if it’s in the air aka not touching the ground, and only found this out because the linear and angular thresholds were set to the biggest float value so it just froze in mid air. However, when I overlapped/hit it, it unfroze again and while in air, froze again, but if hit by ground it stopped freezing/sleeping.

How can I utilize this to make them sleep on the ground?

Edit 2: The sleep function seems to be a bit random, I took the vehicle quite some distance away and then exited it and it went to sleep immediately, disregarding the ground now, this was a 4 wheeled truck though, so no hit between the body and ground could be a reason unlike the bike. Would appreciate more insight on this. I also noticed that the vehicle defaults to sleep if it spawns far from my character, but spawns awake if near my character, despite spawning in mid air, not touching the character. I’m having a hard time trying to find out what things cause the vehicle to prevent sleeping. I am trying multiple asset combinations near the vehicle and the vehicle seems to sleep well in isolated tests but then I put it in the actual level with all things combined and it stops sleeping.

Edit 3: Okay so I found out what asset was causing the vehicles to not sleep, but the problem is that the asset has two sphere collisions used to spawn NPCs and vehicles when the player is close, and one is set to NoCollision while the other is set to ignore everything except “Pawn”. My vehicles have meshes that are all either “Vehicle” or “Vehicle Chassis” so in theory, they shouldn’t even be overlapping, let alone colliding. I also checked overlapping with my character’s overlap spheres and it seems that if the vehicle spawns while overlapping an overlap collision even, it does not sleep, this is why the vehicle spawns awake near my character because I have a large overlap collision around my character too.

These are the collision settings for the large asset that spawns NPCs and vehicles

TLDR: The vehicle stops sleeping completely if it is left idle/spawned inside any overlap collision despite collision settings. However, in order to awaken the vehicle again, a hit is required, not just overlap.

Also, how can I have the handbrake be constantly applied to vehicles at begin play? I tried Set Inputs function with Hb Checked at begin play but vehicle still rolls off slopes

sorry for the late reply, I was on vacation.

due to some issues with the physics engine we had to force the vehicle to wake up when there is a dynamic object in proximity, this is done with an overlap check. without this the vehicle sometimes stays asleep even when it collides with another vehicle.

the bike assist applies continuous force on the vehicle so I don’t think it would sleep easily. you need to modify the source or port the bike assist code to BP and then make sure it pauses the stability force when asleep.

the example project has a map that showcases the sleeping feature.
also check Sedan_BP (red car) in the example project, it shows how you can override the inputs and set HB on by default.

1 Like

Hope you had a good vacation!

The bike assist does not affect sleeping in my case. It was a very large sphere collision that spawned NPCs and vehicles when the player was inside it. The vehicles refused to sleep even when both were set to ignore each other. I had to modify my sphere collision’s functionality to complete turn off its collision and only check for the player by distance. That solved the vehicle sleeping issue.

I will look into the handbrake example in sedan_BP though as of now, since the vehicles spawn while sleeping, I have achieved the same effect. Although touching the vehicle does make it wake.

Thank you!

Hi, I bought the plugin but the car is spinning too much or I can’t start drifting. I need a good drift setup, like the one in the demo project.

you could use any setup from the example project as a base, learn to tune the vehicle and make adjustments for your needs.

Hi @lazybitgames for some reason my car always tries to stabilize upwards , even though i dont have any fgear assist component inside my pawn , neither understeer or oversteer assist , is this the default fgear behavior? can i disable it?

it looks like your center of gravity is quite low, that could cause this kind of behavior.

CoM is in the middle though. still persists any other idea? something wrong on my physics body maybe?

the shape of the collider and the inertia scale can also affect that behavior.
for instance if the Z scale of inertia is too low it might behave like this.
check your physics asset and inertia scale parameter.

Almost there I figured out the simulation generate hit events flag causes this behavior if i turn it off it works perfecly but i still need this turned ON cuz i have hit event logic on my game , what can I do? do this flag causes the same behvaior for you too?

the vehicles in the example project have that setting on and they don’t behave like that.

NotifyHit is processed in the vehicle for the physics blending feature of replication and also waking up a sleeping vehicle but it shouldn’t be effecting anything in your case.

can you check for any self collisions that might be happening somehow, you can log the OnComponentHit event of the root mesh in your vehicle blueprint.

i found out what it was @lazybitgames , that was my angular damping value set to 2.0 , i switched to 0.5 and works perfectly

1 Like

v1.8.5 is now available

  • Unreal 5.8 support
  • Improvements and bug fixes

Notes

  • Dropped 5.5 support.
  • Cascade particles are replaced with niagara particles.
  • Finar gear ratio parameter will be set per axle now. This solves the stability issues when different axles have different wheel radius.
  • Suspension force is scaled down with hit normal angle to prevent high angle issues (disabled for bikes).
  • Engine brake definition changed from zero throttle to negative torque.
  • Refactored wheel rolling friction code.
  • Vehicle.getMinWheelKMHSpeed function is fixed to return a signed speed which solves a rare gear change issue (going backward at 1st gear then pressing back will brake instead of changing to R).
  • Updated default drivetrain friction value.
  • Removed suspension constraint component.
2 Likes

Is the update already live? It not appears the orange exclamation or the buttons as “update” as always. I did in other assests i had without problems. Checked and last is 1.8.4 in plugins/marketplace in case there was some auto-update.

Maybe i should remove from installed plugins in 5.7.4 and install again to get the new 1.8.5?

it should be live because the 5.8 support is there, idk why it fails to show it in the launcher.
you can install it for 5.8 and either copy in your folder manually or let the engine fetch from plugins folder.

Fixed, If someone is having the same problem, just remove from launcher in 5.7 and install again, to get 1.8.5 , checked the final gear ratio and is there on each axle so is fine now, no idea why launcher not detected the update this time.

Where are this changes? Car not seems to drive as it should and wonder if maybe some of this changes are doing something new or maybe some of my core changes are causing any interference with them and need to change or find a workaround. So need to check with/without to confirm.

drop a mail and i’ll send you the diffs.

1 Like