Vehicle wheels problem

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
dweeb
Posts: 14
Joined: Tue Jul 15, 2008 11:17 pm

Vehicle wheels problem

Post by dweeb »

Hi Norbo

Its been a few years since I last used Bepu and much have change in very positive ways. Now its open source and even more easy to use.

I'm working on a Windows Phone game and need to get a decent Vehicle simulation in place.

I started to use the Vehicle Input sample but I didn't get the right feel with it and had some problems like wheels falling off if you jump etc.

Now I used SuspensionCarDemo.cs as a base instead which gives me exactly what I want a need.

But I do have some problems with the wheels. If I turn sharply then one of the front wheel tend to turn in the wrong direction for a short while every once and a while.

The back wheels also act strange a times where they seem to turn.

Do you have any suggestions what I can do to fix these issues?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Vehicle wheels problem

Post by Norbo »

Constraint-based vehicles are quite a bit heavier in terms of simulation. The wheels are very heavy and can act a bit like flywheels which can fight against the constraints, for example. This effect can be reduced by tuning the constraints and entities involved, by increasing the update rate (reducing time step duration and updating more frequently), and sometimes by increasing the space.Solver.IterationLimit.

Constraint tuning can take the form of weakening or strengthening various connections. They all have spring settings; if the steering or angular wheel constraints are too weak, try increasing the steering spring stiffness and damping constants (multiply both by some factor). If the wheels are too heavy to be controlled easily, try decreasing their mass. Be careful with this- heavy objects dependent on light objects can cause instability in the solver. Additionally, overly-rigid constraints can also make it difficult to solve.

There are a lot of tuning factors to handle in a constraint-based vehicle. Unless there is a specific need for truly physical wheels, it will likely take more time to get to where it needs to be than if you use the Vehicle class.
I didn't get the right feel with it and had some problems like wheels falling off if you jump etc.
If you have a particular behavior in mind, I could probably help pick out the needed configuration to achieve it. "Wheels falling off" sounds like the suspension lengths were too long, so when the car left the ground, the wheels would be visibly far from the body.
Post Reply