Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
196 stars 9 forks source link

CharacterController vehicles sliding on slopes #2900

Closed H3BO3 closed 2 years ago

H3BO3 commented 3 years ago

Describe the bug?

My vehicles slide down shallow slopes, even when no forces are being applied except the default gravity.

Relevant issues

I didn't find any.

To Reproduce

Spawn my dropship from my public folder neosrec:///U-H3BO3/R-42a040ff-ddef-498d-b097-1a415e63210e

/H3BO3's FlightPlatform/Example Ships/Dropship

Place the vehicle above a gentle slope, I used a tilted box collider.

Get in the vehicle, but don't start it - Gravity will engage and the vehicle will land on the hill and start sliding down.

Expected behavior

I had previously mitigated this issue by setting the TractionForce to 1000 - However this no longer seems to work. The vehicle used to land on the slope and not slide. It was to mitigate the gentle slopes of mesh terrain causing ships to slide down it like ice.

Log Files

No response

Screenshots

A picture of my CharacterController settings:

2021-08-30 00 14 10

How often does it happen?

Always

Does the bug persist after restarting Neos?

Yes

Neos Version Number

2021.8.29.1240

What Platforms does this occur on?

Windows

Link to Reproduction Item/World

No response

Did this work before?

Yes

If it worked before, on which build?

Before 2021.8.25.1127

Additional context

Even if the CharacterController can't be changed to respect TractionForce like it did before, knowing what settings to change to mitigate it would be helpful.

Reporters

H3BO3#7957

Frooxius commented 3 years ago

This sounds like it's not getting any traction. Can you enable the debug visuals and show what it looks like?

Earthmark commented 3 years ago

This may be related to #2896 as that was the side effect the user of the flight system experienced

H3BO3 commented 3 years ago

https://user-images.githubusercontent.com/62123804/131443429-70dd290e-91ea-4bd8-8522-cd9905e3ccc3.mp4

The offset of the arrows isn't a concern, the capsule collider is a bit behind the seat.

Frooxius commented 3 years ago

Thanks. It looks like it simply doesn't have any traction at all (that's when the arrows are orange). Not sure why that would be.

Does updating the traction slope help? Is there anything being applied to the character controller at all? Any forces, even if really small (e.g. something like 1e-5)?

H3BO3 commented 3 years ago

Sorry, I was mistaken in my original post, the Apply Character Force node is being pulsed. During this time it is running its drag and aerodynamics calculations so it's likely applying a small force.

Updating the MaximumTractionSlope value didn't change anything.

H3BO3 commented 3 years ago

Did some write checks, the forces it's applying are reaching up into 1-2 magnitude.

What I noticed with the legacy behavior - Whenever the ship was touching the ground, a friction or stopping force correlated with the TractionForce was applied - However this doesn't seem to be the case anymore.

Frooxius commented 3 years ago

It's because it thinks it doesn't have any traction - it requires to consider the ground to be a traction support in order to apply the traction force.

CharacterControllers are always friction-less though, they instead use specialized constraints to be held in place.

When you say 1-2 magnitude, what exactly does that mean? Can you give me actual numbers? If there's any force higher than 1e-6 currently, the traction force will be overriden to "unglue" the character controller, I might need to tweak that behavior, but I need specific data.

H3BO3 commented 3 years ago

Yes, a varying force of -1.3 on X and Z axes is definitely higher than 1e-6.

That's only covering the test slope I used, those numbers get higher with speed and would change based on the directions I'm dealing with.

I don't think there's tweaks that can be done to support this, all I know is that it worked before. I can change some behaviors on my end and release a patch, so unless there's an easy toggle that can be added to enable friction/stopping forces on any ground contact, I don't know if it's worth pursuing further. #2898 is significantly more breaking.

Frooxius commented 3 years ago

I made some changes in 2021.9.9.1144, can you check if this improves things?

H3BO3 commented 2 years ago

It didn't improve since the forces I was applying were too great, but I've since reworked my logix to fix this. Thanks for the help understanding what was going on