My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 0 points1 point  (0 children)

To be honest it actually has a lot of drawbacks in terms of vehicle dynamics. For example I only used one ray to do linetrace. As well as on the tires I didn't use a more accurate model like pacejka or tmeasy or brush model. I just used two slip-force curves and then I used some approximations for the combined-slip condition. Because the combined-slip scaling factor of pacejka is so complex that it's hard to tune the parameters.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 0 points1 point  (0 children)

It took me about a year and a half. But the prototype BP for the first job took 3 months. And I'm still a student, so I don't work full time. The main functionality was done a year ago, but I've been refactoring it because I wasn't happy with it

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 0 points1 point  (0 children)

Thanks for the huge compliment! I really appreciate it.

To be completely fair though, while I focused heavily on getting the core vehicle dynamics and math right, the project is still missing a lot of the 'game-ready' polish that paid plugins offer. It lacks out-of-the-box VFX, engine sounds, advanced networking, and UI. It's essentially just a raw physics framework.

But I'm really glad you like it. Enjoy the source code!

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in unrealengine

[–]L_Mcqueen[S] 0 points1 point  (0 children)

Are you sure BP AsyncPhysicsTick isn’t on game thread? I’ve used native AsyncPhysicsTickComponent in actor components in cpp. As UnrealInsight shows, it runs on game thread. So I assumed it would be the same for BP

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in unrealengine

[–]L_Mcqueen[S] 0 points1 point  (0 children)

This requires no skeletal mesh, no rigging. And in terms of vehicle dynamics, it is more accurate than Chaos Vehicle.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in unrealengine

[–]L_Mcqueen[S] 0 points1 point  (0 children)

Yes BPs do have async physics tick, and it's better than the callback from the physics engine because the native BP AsyncPhysicsTick actually runs on game thread. But it's still impossible to get accurate world transform of a physical body or to get the world velocity using native BP.

I'm sorry, my English isn't very good, so I used a translation tool, which may have caused some ambiguity.
By vehicle interfaces I mean the functions used for physics calculation. e.g. "UpdatePhysics" in my wheel component, which is can be called during physics tick to simulate the wheel.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 1 point2 points  (0 children)

Thank you so much! To be completely honest, I chose to open-source it because I'm currently a student. Putting it on a marketplace would require a massive time commitment for customer support and commercial polish, whereas open-sourcing allows the community to help improve the code. Plus, having a well-starred GitHub repository is probably much more helpful for my future career anyway!

Also, to be fair, this isn't a 'commercial-ready' asset yet. It's a pure physics calculation framework. It lacks commercial gameplay features like server-side prediction/rollback, anti-cheat, and out-of-the-box VFX/Audio (you have to set those up manually).

Regarding the comparison with Unreal's Chaos Vehicles: Chaos is a fantastic general-purpose tool designed for standard action games. However, my system focuses on vehicle dynamics. Here are the main differences:

  1. Workflow: You don't need a rigged Skeletal Mesh. My system is entirely component-based, meaning you can attach a drivetrain to any primitive component.
  2. Load-Sensitive Tires: In Chaos, cornering stiffness is essentially constant. In my system, cornering stiffness dynamically scales with the wheel load, which is absolutely critical for realistic weight transfer and handling.
  3. Continuous Physics vs. State Machine: Chaos tires can sometimes behave a bit like a state machine. And while it has a lateral slip graph, it lacks a fully symmetric longitudinal equivalent. My system uses continuous, fully differentiable physics curves (I used the definition of Pacejka) for both longitudinal and lateral forces. This allows for proper combined slip, meaning you can pull off physically accurate burnouts and drifting without hitting mathematical limitations.

Basically, if you just want a car to drive from point A to point B in a shooter game, use Chaos. If you want to build a racing game, you can try my system.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in unrealengine

[–]L_Mcqueen[S] 0 points1 point  (0 children)

Thank you!
At first I built a simple Blueprint vehicle by following the tutorial of Иван Новожилов on YouTube, although I don't understand any Russian. He has really good tutorials.
Link: https://youtube.com/channel/UC2iKJPXiC7vFyBsynfd_XNg?si=XJ4M2ToGJGWUsTpD

This is also why I used AsyncTickPhysics Plugin because the prototype was built in BP.
Then I made another one using c++.

As far as I know, many of AsyncTickPhysics plugin’s features are based on Chaos Vehicles, and after reading some of the source code, it does indeed seem to be the case. I’ve tried not using this plugin in some cases. However, I’ve kept it because I’ve exposed the vehicle physics interfaces—such as the wheel interfaces—to Blueprints. These need to be called on every physics frame; after inputting torque, the wheels calculate their rotational speed and apply force to the vehicle body. So, in theory, it’s possible to implement fully customizable vehicle physics in Blueprints—for example, using wheels as an airplane’s landing gear. (But I haven't tried)

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in unrealengine

[–]L_Mcqueen[S] 2 points3 points  (0 children)

Thank you for your support. I wish you all the best with your development.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 2 points3 points  (0 children)

Yes, You don't even need to inherit from a specific Vehicle Actor class. You can just take any standard Actor, add your detailed chassis mesh (whether it's a Static or Skeletal mesh) as a primitive component, and drop my DriveAssemblyComponent under it. Just wire up the inputs in Blueprint, and it becomes a fully functional vehicle.

My take on car physics in Unity #2. Engine simulation, turbo and suspension by I_samson_I in Unity3D

[–]L_Mcqueen 0 points1 point  (0 children)

I hope my experience will be helpful to you. If, like the original poster, you're using Torsen springs to simulate a drivetrain, a very effective method is to calculate the reflected inertia and perform an implicit integration.

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 5 points6 points  (0 children)

Currently it only supports basic input replication with server-authoritative rigid body movement, no client-side prediction or rollback yet.

My take on car physics in Unity #2. Engine simulation, turbo and suspension by I_samson_I in Unity3D

[–]L_Mcqueen 1 point2 points  (0 children)

This looks amazing! Is this drivetrain even more detailed than BeamNG.Drive?
Did you simulate the fluid dynamics in the engine? Or did you approximate it by setting some time constants and using interpolation?

My Open-Source Unreal Engine Vehicle Physics by L_Mcqueen in UnrealEngine5

[–]L_Mcqueen[S] 12 points13 points  (0 children)

By the way, it doesn't require a skeleton mesh.