Is it possible to implement Steering Assist for Chaos Vehicles?

I am messing around with chaos vehicles and I got it right for the car to drift with just tweaking the Vehicle Movement Component but I would like to implement a steering assist into the vehicle I am using. Basically I want the wheels to point forward when the car is sliding. A similar effect can be seen in games like Assoluto and CarX drift racing.

1 Like

Is this entirely a visual thing, or is this an actual control thing?

If it’s visual, you’ll need to insert yourself between the computed/simulated state, and the rendered state, to render a different mesh than what’s used for computation. Make sure the render mesh is rendering but not colliding, and the computed mesh is colliding but not rendering.

If it’s actual control, then perhaps the best way to do this is to wire this up where the player control is read in the controller.
In the “input axis steer right” event, you could check whether you’re drifting (or, perhaps, even calculate “how much” assist is needed,) and then calculate what you “want” the steering to be, and then calculate some blend of the user input and the desired input, and forward that to the physics component. This would also let you implement a setting in the UI for how much steering assist the player wants; you’d simply use this setting as an input to the function for how much assist to apply in the blend function.

Thanks for the response bud. This is entirely for control, it’s kind of a necessity as the car spins out because I can not react quick enough. Forgive me I am very new to Unreal Engine, have only been using it for a few months. Is it possible to show what you explained in Blueprint form? So that I and anyone else who has this idea can use it in our own projects?

You would need to adjust the direction of the steering programmatically with trigonometry.

From the car forward vector, look at location with B being a point on the spline you are supposed to follow.

Well, ok. Since you are new to it maybe a bit more info is needed.

Cars travel on roads. Roads are made with splines.
Fetching a point on the spline close to the car (or character) is fairly standard.

In this case, I would do it with a cone sweep though.
Because if the player turns opposite it will eventually disable the correction.

So, a cone sweep detects the spline, and calculates the point on the spline at the edge of the cone.

With that point, and actor forward vector, you solve the angle at wich the steering needs to be adjusted.

Then you slowly correct the angle the player is inputting by adding in a fraction of the angle you need and updating the needed angle.

The result should be similar to fake steering where you don’t have to do anything for the car to follow a path, but you can still have some control to alter the path / micro correct.

A cone being tighter at the start than further out, could possibly mean that some drifts will put you in a spot that auto steering cannot work.
You have to try it out and see where collisions happen…

This method seems very limited. I want this to work everywhere, even off road where you drive on a landscape

If the user is driving on an arbitrary landscape, how do you know where they want to go?
And if you don’t know where the user wants to go, how can you “assist” them going anywhere?

Basically I want the car to turn the wheels to correct a slide. Below is a video that shows what I mean. Watch from 3:11 to 6:12

I pledged on his patreon and downloaded the component but the vehicles are physics constraint vehicles and I am using Chaos Vehicles. Also his component is written in C++, something I know nothing about. I want his steering correction feature (or something similar) in blueprint form that works for Chaos vehicles.

Sorry if I did not explain well enough what I meant. If more example footage is needed, let me know.

If you can alter the steering input for the player, then that’s pretty simple.

  1. Get the “right vector” of the car chassis (in world space)
  2. Get the chassis world velocity vector
  3. If the velocity length is smaller than some number, don’t correct anything and stop here
  4. Normalize and dot product the chassis-velocity vector with the chassis-right vector
  5. Multiply the value you get out with some scaling factor (start with 1.0 and tune up/down from there)
  6. Add the result of this multiplication to your steering input axis signal, and clamp the result to the [-1 … 1] range
  7. Use this result as the actual input for “steering” in the car controller / physics

The math result of this is that “the larger the part of the cars velocity is to the side, the more steering correction is applied,” which works great for correcting drifting (four-wheel skidding.)

If you also want to correct two-wheel skidding (fishtailing) then you’ll want to also get the cars rotate velocity around the up axis, multiply by some factor (may be negative, depending on how rotation is measured) and add that, too. This will correct more the faster the car is turning. BUT this will also make the car have more understeer, because the car rotates when just turning, too – just not as much.

@jwatte You sir are a genius. Thank you so very much. This has been bugging me for months. Here it is in blueprint form. :slight_smile:

1 Like

I wouldn’t call this a “steering assist”.
Maybe that’s why you couldn’t find a satisfactory solution up to now…

This is more of a traction control solution - you are literally compensating for the engine simulation by increasing the steering power.

The “correct” solution would be to alter the actual physics that are calculating the slide in the first place.

Not sure how far the engine has gotten with implementing chaos vehicles - will check on it in the coming week actually.
The point being, it should be possible to alter the values to achieve a controlled traction (more grip) similar to what you are doing by adding into the steering…

Hi,

I need something similar. I like the ChaosVehicleComponent. Easy to set up and get going, if your aim isn’t arcade racing.
As I’m creating something like Split Second: Velocity, I need to maintain most of the speed while cornering. And just like you, I also need to easily be able to get into a drift, keep it going and controlable.

This is the logical solution to it https://youtu.be/n_A0RqeGado?t=1133 .
Thing is, I have no trouble finding logical solutions, but on how to actually implement it… . So many tutorials on the basic stuff you even find in the documentation, but not the parts you actually need help in. I’m still new to game-development and Blueprints. Although Blueprints make it a lot easier, it’s still something I need guidance in, without getting to technical. (I’m not a hardcore programmer or mathematician. I come from a background of webdesign and databases).

I’m generally also not keen on copy/pasting code, as that way, I won’t learn anything. Can anyone point me to good tutorials on this subject (or racing games), preferably in unreal.

I was also looking into disabling the Mechanical Simulation in the Chaos Vehicle Component and drive it through with a sphere (for drifty arcade control), but I’m having trouble with it when trying to rotate the sphere left or right.

Chaos Vehicle Component also has an ‘Arcade Control’ section. I figured out the ‘Stabilize Control’, but can’t figure out the ‘Torque Control’ and ‘Target Rotation Control’. I have a feeling they are there to do exactly what is described in this thread, but have no clue on how to adjust those settings, what is what for and such. There is no documentation on it.

Cheers