Best Way For Creating Vehicles - Ackermann Steering

Currently, I’m trying to create a vehicle that is smooth when driving along terrains.

My vehicle is able to designed by players, as it is a sandbox vehicle building game. This means that the wheels must support 4 wheel driving, 6 wheel driving, 8 wheel driving, etc, in any width, length, weight and any other properties. Therefore, I hope to make the vehicle fully reliant on PGS, without forces if possible, to have realistic physics.

https://gyazo.com/389012647c2744dd847d06038af947d7
This is an example of the vehicle creating system, that I have created so far

https://gyazo.com/112290a4cf08151d851d2b6a0662ea51
In this example, I’ve used HingeConstraints for the motors, and motor6d for the steering. However, the torque on the motors is too high, while the friction on the wheels are lower. If the friction is higher on the wheels, and the torque on the wheels are lower, the vehicle is unable to move when steering.

I have some experience in the past with vehicles using only Hinge Constraints, but I had to set the vehicle chassis weight(density) to almost nothing. The place down below is the place with the vehicle I have created in the past.
https://www.roblox.com/games/1228739893/Inverse-Kinectics-Test

I understand that vehicles in Jailbreak and Madcity use different forces instead of hinges, but I’m not quite sure how to apply that to here, since the wheels are not just going to be 4 wheels.

Regards,
PenguinDevs

#vehicle #Ackermann #AckermannSteering #PerfectSteering #Steering #VehicleSteering

8 Likes

Very cool game idea!
For most vehicles, developers use a center of rotation calculation and control the steering wheels accordingly. (This will eliminate your friction issue.)
image
If you would want to implement this system on your vehicle building game, I would recommend first determining the center of the vehicle, then (per wheel) determine what the distance to the center is on both axes and set the angles accordingly. Also, do not forget the speed, it is different per wheel since the circumference of the track also differs per wheel.
The formulas for these calculations can be easily found online or calculated with some simple trigonometry

Since you enable players to have up to 8 wheel driving, you would have to use your own variant on the standard 4-wheel center of rotation system. The center of rotation in conventional systems is on the same axis as the driving (stationary) wheels, but would be different if you have more than 2 of these.
(You could maybe neglect this effect by also differentiating the speed of the driving wheels.)

If you a looking for a more tank-like behaviour, take a look at differental steering. This will also enable you to have a ‘pivot point’. That enables the vehicle to spin around its own axis:
image

As for working with PGS vehicles, some tips I can give you from experience:
If you want a good suspension, you can set the wheel density really high, to like 5. They will then be able to take hits better. For the friction, I would always put it somewhere between 0.5-1.0.

13 Likes

@XandertjeKnal Could you possibly provide a link to the formula for the speed of the different wheels please? This solution was very much helpful! Tysm! :slight_smile:

1 Like

@XandertjeKnal Mind also telling me where you got the image for the center of rotation from please? The quality seems a little unclear, thanks.

The publication (where I got the first image from) contains all sorts of formula’s and explanation you can use.

You would basically have to visualize a circle per wheel around the center of rotation. Then you see that the outer wheel has the largest circle, therefore has to move a greater distance per second, therefore has a greater speed.
A way you could do this is to calculate for each wheel radius of the turning circle, determine which one is the biggest, and give this wheel the max speed. Then slow down all the other wheels depending on their turning circle radius. (Actually their circumference, but when calculating the ratio between them, this does not matter.) WheelSpeed = WheelTurningRadius/BiggestWheelTurningRadius

Ideally you would get a ratio/fraction per wheel. Then all that is left is multiply that by a MaxSpeed variable. MotorSpeed = WheelSpeed * MaxSpeed

5 Likes