[Guide] Vehicle Handling Stats Explored

Started by GangstaRas, Aug 01, 2017, 10:10 PM

Previous topic - Next topic

GangstaRas

Quote from: vitosca1 on Oct 09, 2017, 11:30 PMIs it possible to make car unmoveable/unrotable by Ped/player pushing via vehicle handling? (with no scripts)

Yes it is possible, just set your vehicle dimensions high enough. Whether 30 or 60 FPS, it won't budge (I trialed with around 20 m each axis, 99% unmovable so I'm guessing 30 m onwards should do the trick 100%).

The reason why a mass change wouldn't work is because pressure is also a factor to work by. To keep it simple, basically when you apply a force to an object, the object won't move unless that force is being applied to a considerable amount of the object's surface area, say at least 20% for argument's sake.

With normal vehicle sizes, the player's surface area is lower but not exponentially lower than the vehicle's external surface area. It's probably in that 20% mark if not slightly more. So with enough force, no matter the mass, it will move.

In contrast, if there's an exponential difference in the surface area of the force being applied against the entire surface area of the exterior of the vehicle, that's when it's impossible to move. That's essentially why needles and knifes pierce through objects rather than move them. The force is great but its acting on just a small point, so therefore that point will rupture but the entirety of the object remains still. That's why higher dimension stats of the vehicle is the way to go.

Once you do that however, you'll want to use my trial ratios I gave previously to get the vehicle back to practical speeds when driving:

  • 4 : 3 or 1.333 : 1 - acceleration : dimension
  • 1.465 : 1 - top speed : dimension


GangstaRas

#16
Part 3 - Perfect Ratios

Sorry for the huge delay in this one. Been busy for those who were waiting but now I'll get into it.

Now previously, I had a trial ratio for acceleration and top speed for when you make changes to dimensions. For nothing, this effectively worked out well, except now your handling is still screwed. Upon my revisit to this I had a hard time getting the numbers accurate for extreme dimensional changes. I even ran into a new error which is noted below.

[spoiler=DIMENSION SIZE NOTE]
The game has a limit of 20 m per axis for vehicle dimensions. In my advice to vito, I expressed that I ran a quick test at this 20 m limit and that 30 m may give a better result. It doesn't appear to be that way due to this limitation.

The higher you go beyond the 20 m limit, the more physics flaws the game will introduce with the vehicle. Working off memory, the vehicle was able to be pushed with higher than 20 m dimensions and was becoming very impossible to drive. I didn't test it for long but the end result is your vehicle will fly erratically in the air if you go too high above the 20, in my case I went straight to 100 m.
[/spoiler]

There was also a huge limitation that forced me to go into another direction. After a certain point in dimensional size increases, it will be impossible to regain cornering statistics as the vehicle is too large to make any original sharp angled corners. It's size is going to always make it cover a large distance to make any turn, leaving the vehicle in a hopeless truck feeling state.

So my new solution was simply to work on the mass of the vehicle.

Recall in Part 1 that with increased mass, the vehicle becomes a lot faster and inversely, with decreased mass, the vehicle becomes slower. We can exploit this madness in VC physics to our benefit. So:

  • For higher dimensions, you INCREASE the mass of the vehicle
  • For smaller dimensions, you DECREASE THE mass of the vehicle

Since with smaller dimensions you gain more speed and acceleration, you decrease the mass which has a slowdown property, negating the speed gain. Inversely, since increasing the mass gets you closer to the speed of light, we use this to negate the increase in dimension which slows you down.

But by how much? Squared; ( n x n ) : n ==> mass : dimension

So if you increase the dimensions 2x, you're going to need to increase the mass 4x, 2 x 2 or 2 squared.
If you decrease the dimensions 0.5x, you're going to need to decrease the mass 0.25x, 0.5 x 0.5 or 0.5 squared.

The ratio isn't perfect but for convenience sake, this was within 5% error for me.

There's only one more thing to change and your performance should be near identical, centre of mass. This one is easy however, all you have to do is calculate the percentage of the dimension of the centre of mass against the vehicle's dimension per axis, and then apply accordingly to your size change.

So example, if you set your vehicle dimension from 2 m to 4 m on the x axis, and the centre of mass for the x axis was 0.1 m, then:


0.1 m / 2 m = 0.05 or 5%

0.05 or 5% in 4 m = 0.2 m


That's it, and you're done. Your vehicle should feel pretty close to original specifications with just these settings.

Hope this helps you out guys.