FGear Vehicle Physics (v1.13 Released)

4013215--346582--fgearS.png
Introducing F-Gear Vehicle Physics

FGear is a custom vehicle physics solution for unity that helps you build arcade or semi-arcade style racing games. The package consists of a core module and some extra features that were used for making the demo scenes. It is mostly focused on 4 wheel cars but multi axle setups are also possible.

Asset Store : http://u3d.as/1pAg

Warning : Some of the content in these demos are not included in the package!
https://www.youtube.com/watch?v=FnQKj3SSMGo
Available Demos:

*Controls for Pc Demos: Arrow keys + Space for handbrake + R for reset + B for lookback.

Documentation: Available here

Core features:

  • Desktop or mobile.

  • Single script component for a driveable vehicle.

  • Full source code.

  • Adjustable integration steps.

  • Simplified pacejka, pacejka96 and MF6.1 tire model options.

  • 3D wheel support(multiple raycasts or sphere/convex cast).

  • Simple engine model with a torque curve.

  • Configurable auto/sequential/manual(h-pattern) transmissions.

  • Open, locked or lsd differentials.

  • Ackerman steering, toe and camber.

  • Adjustable torque and brake distribution of axles.

  • Simple spring/damper suspensions with preload option.

  • AeroDynamics component for drag and downforce effects.

  • Standard input manager with keyboard,joystick and wheel+shifter support.

  • Driving aids like abs, asr, esp and anti roll bars.

  • Detailed telemetry ui.

  • Basic save/load system for fast prototyping.

  • Various sample setups and demos.

Extras:

  • 3rd person camera script.

  • Basic AI driver.

  • Sample visual&sound effects like engine, skid and muzzle effects.

  • Forcefeedback script using logitech gaming sdk.

  • Joystick vibration sample script with XInput.

  • Minimap and gauge UI samples.

  • Mobile input demo.

  • Bezier spline tool.

  • Runtime vehicle creation/modification demo.

  • Arcade style driving assists script.

  • BikeHelper script for fake motorcycle setups.

  • Multiplayer sample with Pun2.

  • Rewind and replay sample.

Some Screens:

4013215--350194--s8.jpg


Check the 0-OverView.pdf file in Documentation folder for the change log and detailed notes.

Please share your thoughts, suggestions, any feedback is welcome.

2 Likes

Looks interesting, tried the Touring car demo and drift demo with an Xbox controller and they both turn right with no steering, joystick works fine on other driving games in Unity.

interesting, i also have a xbox controller and it works fine, i assume it works ok with keyboard.
hmm how many controllers are connected to your system, may be another controller is interfering?
and which xbox controller do you have, is it wireless/cabled, xbox360 or xboxOne, thank you.

Just one controller, as I say works fine with all other Unity vehicle systems and games. I think it needs a bigger dead zone as the little black steering mark is clearly offset to the right showing steering input.

@SpookyCat thanks for the help.

it seems that some xbox controllers axis values are not always zero even if you do not touch them.
FGear uses Input.GetAxisRaw method and you can configure sensivity/deadzones etc. for each vehicle but i will add an option to just use Input.GetAxis method.

i increased the controller dead zones and reuploaded the pc demos.

before the release i added a save/load mechanism for fast prototyping.
simply the component properties are dumped to a json file and read back when needed.
i also made a quickstart tutorial video:

FGear is available on asset store : http://u3d.as/1pAg

I’m working on a F1 style game, the example is really great and I like how the tires spin out in low gears. I don’t know a ton about engines but I’m assuming that’s because there’s more power being supplied to the wheels on low gear. In high gears it doesn’t spin out too much, if I wanted to make it a little more challenging and have the potential to spin out when exiting corners with too much throttle, what would I need to do?

this might be tricky to achieve here are some ideas:

-your vehicle should have enough torque at wheels to loose longitudinal grip(high slip ratio) even in second and third gears. so higher engine torque and lower gear ratios are needed.
-engine should be more aggressive with lower inertia.
-tire forces generated by the pacejka96 formula(lateral and longitudinal) are not just summed up but they are combined so that wheels loose lateral grip when longitudinal slip occurs so you need to tweak the combined force parameters of your tire model. this part will be hard to make right since those parameters have no real physical meaning but you can see the resulting curves and you can find basic explanation of the tire parameters in the documentation.

so i recommend you to create a new tire model, try to understand how those resulting curves effect tire friction and start experimenting.

good luck.

Thanks for the info, I still need to learn a lot, I’ll give it a shot

How do I set variables during runtime? I tried this as a test but its not working.

 WheelOptions wheelOptions;

    // Use this for initialization
    void Start ()
    {
        wheelOptions = new WheelOptions();
       
       

    }
   
    // Update is called once per frame
    void Update ()
    {
        wheelOptions.setLateralFriction(1f);
    }

please check RuntimeSample.cs
you need to have an existing vehicle say mVehicle then you can set like:

mVehicle.getAxle(0).getWheelOptions().setLateralFriction(1.0f);
mVehicle.getAxle(0).applyWheelOptions();

I’ve got using FGear at the top as well

Thanks I appreciate it.

I would like to try and get a little more sharper steering. From my understanding of the documentation I would change that with the Steering Sensitivity Curve. If I just click on the box without changing anything it automatically changes my steering to where the back wheels lock up and prevent lateral movement.

you mean the property field for the curve? if you click on it it will open the curve editor.

sorry i didnt understand this, a short video would be helpfull to understand the problem.

Here is Formula Sample with default settings

https://www.youtube.com/watch?v=1u38ZUkTCVs

Opening Steering Sensitivity Curve without making changes causes back wheels to brake when turning

https://www.youtube.com/watch?v=C0rUS48elrQ

it has nothing to do with that curve, it seems that when you steer the car also handbrakes. it is not visible in the video but your axis settings are probably not proper. if you create a new project you need to setup axis inputs from unitys input manager(edit->project settings->input) or copy/paste the sample settings file that i mentioned a couple of times in the documentation : Dropbox

I see, I would never have thought to do that because the controls worked right out of the box plus I never made any changes. Thanks for the help.

no problem.

normally you may not get any problems because the default values in fgear are same as the default axis values in unity but if the vehicle prefab contains a different axis input like “Handbrake” and if that axis is not present in inputmanager then the system assigns the first available axis which is “Horizontal” and then your vehicle handbrakes when you steer :slight_smile:

1 Like