godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.19k stars 21.21k forks source link

Vehiclebody3D sliding down slope when parked #88998

Open Griiimon opened 8 months ago

Griiimon commented 8 months ago

Tested versions

System information

Windows 10 - Godot 4.2.1 stable - compatibility

Issue description

A Vehiclebody3D parked sideways on a slope will slide down. Depending on gravity, friction, roll influence and spring settings it will slide more or less but it will never stand still unless the gravity is 0. It's even possible with the right combination of settings to make the vehicle slide up the slope. This is without any engine force or steering applied!

slope demo

Steps to reproduce

Run the demo project

Minimal reproduction project (MRP)

VehicleBody Slope.zip

BaconLord commented 8 months ago

Hello, I'm a computer engineering college student and would like to take up the fixing of this bug. Would that be alright and is there any more convenient way I can keep in contact if questions come up?

Griiimon commented 8 months ago

Hello, I'm a computer engineering college student and would like to take up the fixing of this bug. Would that be alright and is there any more convenient way I can keep in contact if questions come up?

You are very welcome to fix this bug and post your progress or potential issues in this thread. But a fair warning: the physics side of Godot isn't well maintained and you will probably be more or less on your own with this. I think I read somewhere that the Vehiclebody was originally ported from the Bullet Physics source code..

BaconLord commented 7 months ago

Hello, I'm a computer engineering college student and would like to take up the fixing of this bug. Would that be alright and is there any more convenient way I can keep in contact if questions come up?

You are very welcome to fix this bug and post your progress or potential issues in this thread. But a fair warning: the physics side of Godot isn't well maintained and you will probably be more or less on your own with this. I think I read somewhere that the Vehiclebody was originally ported from the Bullet Physics source code..

Sorry for the delay on my response. First of all thank you very much for the opportunity of working on this bug. Second of all I had a few questions regarding the expected result and standards of the godot engine:

Thank you for your time

Griiimon commented 7 months ago

So I don't think I'm really qualified to answer that all. I have never contributed to the engine and don't know much about how it works internally or is supposed to worked. I just filed that bug report..

  • Is the vehicle supposed to also not slide down when moving forward on a slope? Or is it only when parked?

I think, from an end-user perspective, I don't want it to slide unless the friction of the surface is low. Like on ice, for example.

  • Is there supposed to be a difference between a vehicle being still and a being parked or is it considered the same on the engine?

I have no idea, but I think for all intents and purposes this can be handled the same.

  • Is there any moment where it should be sliding (low friction floor for example) and should the traction of the vehicle be calculated with the vehicle as a whole or taking into account each tire it has?

See above and I think it already does per wheel, but I might be wrong.

Deltt commented 1 month ago

Would love to see this fixed some day, seems to be gettings worse over time (tested on 4.4 dev)

dgsdestinygamestudios commented 1 month ago

Not just sideways. If you're on a slope, vehicle will slide down, regardless of your angle. Engine is not calculating the gravity by checking the normal of the floor, therefore vehicle has to be on a perfectly flat ground to stand still.

BaconLord commented 3 weeks ago

Just so this doesn't get picked up again, I have the unfortunate news that I was not able to fix this bug after a lot of different attempts. As I have ran out of ideas, I will have to drop this bug fix, sorry for the time I took in attempting to make it work and without response. If anyone wants to pick this up, I will gladly share notes of what I found that could perhaps help.