FGear Vehicle Physics (v1.4)

Any idea if this is due FGear or a 5.2 bug?

imagen1

It happens only on FGear cars. In 5.1 is fine but in 5.2, if you set TAA, EPIC or CInematic, you get cars with poor AA. But same car as static mesh (turquoise car above) have correct AA.

Due im using 5.1 on a 5.2 dont know, if is due FGEAR 5.1 plugin have some issue on 5.2 regardin AA or is a UE bug?

Just checked on mine


Set on Epic

And for some reason if i deactivate substepping, TAA works fine in all modes: Low/Medium/High/Epic/Cinematic, but cars behaviour is not the same.

In DefaultEngine.ini : bSubstepping=True. True TAA=BAD on Epic/Cinematic. with false, TAA works fine. Same if changing on project settings.

Maybe is due the bug about substepping in previous posts that will be fixed in 5.2?

In 5.1 it my case i have that bug either, in 4.27 it was fine, i guess it is UE’s AA bug

vehicles have small vibrations as a result of the simulation so if the AA system can not handle that then you need to find a workaround.

But why with Low/Medium/High AA is fine, but not in Epic/CInematic? Or why disabling substepping AA is fine on Epic/Cinematic? Also as said this problem is only on 5.2 afaik.

Btw, atm using AA on High instead of Epic that seems to give same results a Epic in previous versions so no much problem.

@lazybitgames Speaking on the small vibrations. Is there any way physics or tick could be disabled when vehicle actors are far away from the player? Currently, I am activating collision in static mesh wheels to keep the vehicles from sinking into the ground but I haven’t seen anything in the plug-in to do this.

there is no such built-in feature.

Hello @lazybitgames , is there a way to make the vehicle come to a complete stop? , when I do a respawn it moves a bit, that is, is there a way for it to be with a permanent handbrake until I decide that it can move? what function should i use?

Check in fgear functions for Start Grid Mode, there are several ways you can do this also as you state via handbrake etc. Also you can disable engine and set brakes on in a few ways.

1 Like

In addition to what @PerfsPC said. The customization map has a function where the handbrake is activated when you navigate the ui. But off the engine node there is a Boolean to set running. You can set the handbrake and engine nodes off the unpossesed event.

1 Like

Maybe im missing something, but, if you use AutoChange but disable AutoReverse, when car stops, how you trigger reverse then?

Because shifter Sequential and Manual are disabled with “AutoChange” enabled. ¿?

So trying to get this brake/reverse behaviour:

1.- If you press brake with more than 0 speed or car in motion it will decrease until 0 and will stop the car.

2.- Only if you press brake when the car speed is at 0 & motion 0 = activate reverse.

Now with autoReverse if you are in a corner or do a 180Âș and get some 0 or negative speed value, if you press brake it activates reverse when you really want to continue braking.

Im looking in FGearTransmission & FGearStandardInput.

Tried some stuff but nothing is working as wanted.

The problem is how to detect the braking is pressed after car is stopped and not already pressed.

Or maybe enable sequential gear if autoreverse is off, so you can set just the R. On accel then it goes to autochange again Âż?.

EDIT: Im trying to enable sequential working with Autochange to enable reverse with AutoReverse disabled. Gears works always that are in gear ratio donw/up but it not changes always that is pressed like without autochange but can figure how.

Well, i got something working.

	// ADDED ***********************
	// Using Sequential to set R in AutoChange mode without AutoReverse
	
	if (mShifterType == FGearShifterType::SEQUENTIAL)
	{
		// Set R
		if (mGearboxInput < 0) mVehicle->getTransmission()->gearDown(true);

		//invertVertical	
		if (mVehicle->getTransmission()->getCurGear() < 0)
		{
		float tmp = mEngineInput;
		mEngineInput = mBrakeInput;
		mBrakeInput = tmp;
		}
	}
    // ADDED ********************************************

Now i can have AutoChange and set reverse when needed.

The optimal thing will be set autoreverse only when the car have some X angle+negative speed values / motion. To avoid autoreverse in the scenarios mentioned like 180Âș corners,etc
 but still allow when you want to do a 360Âș or similar.

This sounds really useful, thanks @Davit_Masia - Will also test this out.

In FGearStandardInput.cpp , search for “bool invertVertical”

	// ADDED ****************
	//invert engine/brake inputs in reverse(auto)

	// Added "getSteerDeltaAngle" to use only on wanted situations

	bool invertVertical = mVehicle->getTransmission()->isAutoChange()   &&
						  mVehicle->getTransmission()->isAutoReverse()  &&
						  mVehicle->getTransmission()->getCurGear() < 0 &&
						  FMath::Abs(mVehicle->getSteerDeltaAngle(true)) > 89.99f ;
						  
	// ************************************

Still testing but seems this can fix some of that issue. Trying to find the correct getValue. At least the problem not happens as much as before.

Which cpp was this? FGearTransmission.cpp?

Both FGearStandardInput.cpp . On transmission im trying some stuff too but at the moment no changes were made there, just tests that are all disabled.

2 Likes

Ah ok

CHANGELOG v1.6.2
Unreal5.2 support
Improvements and bug fixes

Warning:
-To use the example project with Unreal5 copy the FGearPlugin folder in Unreal5\Engine\Plugins to FGearExample\Plugins folder.

Additional Notes:
-Ensure fails are eliminated for non-substep mode.
-Overall refactor to use physics transform instead of actor transform for vehicle calculations.
This fixes some hidden issues and makes the plugin more stable in Unreal5.
-A landscape is added to sandbox map.
-Added an option to override CollisionTrace for custom collision in order to fix Unreal5 issues.
-Fixed a minor issue with the Constraint map.
-Engine power calculation wasn’t taking friction torque into account, this is fixed now.
-Added ability to set bone name of wheels.
-Convex casting meshes no longer generate overlap events with the world.
-Wheel.setRadius function is updated to work with convex casting.
-Convex casting options are extended and moved to vehicle class.
-A custom cylinder mesh asset is included in the plugin folder which works fine against the landscape in Unreal5.
-Cleared all deprecated warnings.

4 Likes

Top work as always, thank you for the update, will check this out soon as I can.