FGear Vehicle Physics (v1.4)

Hello @lazybitgames when i change the material physical the another particles dissapear to bad , what happen here? solution please?

when you change the template of a particle component the older particles die.
there is a single particle component per wheel right now.

option 1: you could put 2 particle components and pause the older and activate the new surface particle.

option 2: use the same particle but modify a color or similar property based on the surface.

How can I change the color? “fgear effects” won’t let me touch any of the particle settings.

you can call effectscomponent.getchildcomponent… but
even if you access them the code in the effects component will interfere and you won’t be able to do what you want.
as I have mentioned many times the effects component in for prototyping, you should either roll your own or improve it.

Okay, I’m already programming the external effects. Now, the problem is this: on asphalt, the effects activate when you’re already skidding or the wheel is spinning without traction. So these visual effects are activated, but what value is needed for this effect to activate? The image explains it better. If possible, please use images; this would allow those who bought your product to choose the effects they want.

well it is open source so you can just look at the code(UFGearEffects::effectUpdate) and implement the same, here:

float lngSlip = FMath::Abs(w->getSlipRatio()) * FMath::Min(1.0f, FMath::Abs(w->getLongitudinalSlip()));
float latSlip = FMath::Abs(w->getSlipAngle()) * FMath::Min(1.0f, FMath::Abs(w->getLateralSlip()));

Okay… now what? I don’t see any changes. I want access from the BP editor to be able to access them. I added the code, but I don’t see any updates or changes.

you aren’t supposed to add any code to anywhere, that code shows how to calculate the values to be compared with lat/long slip thresholds.
I’m saying if you are going to implement it in blueprint you can copy the logic from the UFGearEffects::effectUpdate function.

I copied the code, okay, but when I paste it, nothing shows up in the backend. Is there a tutorial to fix this?

where are you pasting the code to?
when I said copy I meant recreating the logic in BP, you can’t paste C++ code to BP.

“FMath::Abs” where is this found in the BP to replicate then? From the wheel? I’ve searched for something related and nothing appears

You can use an AI, such as Gemini, to “translate” the code to BP.

  1. Longitudinal Slip (lngSlip)

    Get the Slip Ratio value and plug it into an Abs node.
    Get the Longitudinal Slip value and plug it into another Abs node.
    Use a Min (float) node to compare that second Abs result with a constant of 1.0.
    Multiply (float * float) the first Abs result by the output of the Min node.

  2. Lateral Slip (latSlip)

    Get the Slip Angle value and plug it into an Abs node.
    Get the Lateral Slip value and plug it into another Abs node.
    Use a Min (float) node to compare that second Abs result with a constant of 1.0.
    Multiply (float * float) the first Abs result by the output of the Min node.

1 Like

there are mathematical nodes in BP, abs is one of them.
yes, the AI seems helpful for this task.

@lazybitgames I started to play with the UFGearAutoDrive and is better than expected.
It needs some time to get an idea about how each param changes the car behaviour but worth.

I was able to create a challenging AI, in the limit to drift, because if does is a mess but is ok, DR2 cars in rallycross always avoid drifting as possible.

Wonder if this extra is something that can be improved in next update/version?

Case 1 : Reverse
Sometimes it gets stucked due accel+steer, when just reverse and steer will fix easy and fast.

Case 2 : Difference between cars & obstacles.
I realized sometimes there is a trace the car can follow to surpass if push another car but trying to avoid it collides against the wall.

Rallycross is a more contact sport where there can be lots of collisions without penalty.

So in this cases it should avoid collision against the wall not the car.

Case 3 : Slipstream behaviour

Somehow, to the car behind, between a range distance, make faster, maybe reducing/removing the aerodynamics drags.

Because after some time, with same car speeds, they just follow the line concatenated one after other without fight.

thank you.
anything can be improved but AI has lower priority compared to physics features.
honestly I don’t want to focus on non-physics features much, once you add a feature most of the time people expect it to be usable for production but vehicle AI has its own territory and it could be a separate product. someone else could ask for traffic AI and another one may require sth. else so I prefer keeping the scope minimal.

Understood, another thing,

Seems for the collision UE can use simple or complex collision.

If you add anything to FGearCustomCollisions no matter, UE will use their own simple collision.

Checking the collider mesh i found “Use complex Collision as simple”, but then on start game it gets freezed like 5s and goes normal, but the cars collision not works, they clip.

So, if i want to use exactly the custom collider i did for the car, what i should do?

Because even with default sportscar, which has is own custom collision it happens too.

And checked UEvehicle and Moto but they do the opposite, uses simple as complex.

Whats the proper way then? How to use the exact collider i want for the car? Or FGearCustomCollision is gonna be deprecated and there is another way to do this Âż?.

“Use complex Collision as simple” is not supported for moving objects(read the tooltip in your screenshot), it was the case for unreal4 & physx and I guess it is the same for chaos.
you need to do your best with compound colliders, meaning combination of convexes and primitives.

@lazybitgames the gear ratios array variable doesnt clear when you set a lower gear , for example in the picture i have array length of 7 , if i drive a silvia that has 6 gears it works and i can reverse , but if drive a 5 gear car ,even tho im setting gear count to 5+1 and all correct gear ratios I can upshift to 6 and the sixth gear is actually the reverse and the actual reverse gear crashes unreal

You need to add the “Refresh Parameters”(Transmission) node at the end to apply the changes.

1 Like

thanks it worked