Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,383

Vehicle Development


Josh

9,589 views

 Share

I've made progress with the new vehicle system and it is shaping up nicely. The vehicle wheels consist of a slider joint with a spring (the strut) connected to a pivot, connected to the wheel by a hinge joint (the axle). If the wheel can be steered, an additional pivot is inserted between the strut and axle, with a motorized hinge to control steering. There were two big problems in addition to this that need to be solved in order to make a vehicle that is stable at high speeds.

First, the mass matrix of the tires needs to be spherical. The mass matrix is the distribution of mass across an object. A brick and a 2x4 piece of lumber probably have about the same mass, but have a different mass matrix. Therefore the brick should spin more easily than the lumber. If you don't make the mass matrix for the tires spherical you will get bad wobbling at high speeds, like this video shows:

When the mass matrix is fixed this problem goes away. The vehicle gets up to 90 MPH, and although there are other issues, there is no tire wobble.

The other issue that needs to be solved can be seen in the video above. At high speeds the tire collisions become inaccurate and the vehicle bounces a lot. We need to replace the default collision with a volume raycast coming from the top position the wheel can sit on the shock, going down to the extended position of the strut. This is the part I haven't done yet, but I know it can be done.

I think the new vehicle system will offer a lot of flexibility and possibilities for future features since it is mostly made with the standard physics features.

  • Like 4
  • Upvote 2
 Share

43 Comments


Recommended Comments



At that point, it's better to sacrifice something in favor of other features that are more important, I think that's fine. 

Link to comment

I don't think all hope if lost forever and ever, but I had a finite amount of time to resolve this and I failed to make it work. This is not a problem I can solve right now. It is very rare for something like that to happen, and I am informing you guys of this rather than postpone 4.6 indefinitely.

  • Like 1
  • Thanks 1
Link to comment

Well seems only it is possible to get back to 4.3 if we want to play with cars. Bad news for now but ok. Please Josh let this possibility open to switch on 4.3 ! thx

The options menu and the refraction shader are for my part what I'm going to miss, event though those options could be added to 4.3 without to break the vehicles, am I right ?

Can I do this somehow, by deplacing the files from 4.6 to 4.3 ?? (would be so cool!)

 

Link to comment

I did figure out how to resolve the bouncy springs but there is a lot of other problems. This is going to be an ongoing project.

  • Upvote 2
Link to comment

Will the spring improvements be implemented in 4.6 still? I was playing with them on a non-vehicle mechanic and it just bounced indefinitely.

Link to comment
4 hours ago, reepblue said:

Will the spring improvements be implemented in 4.6 still? I was playing with them on a non-vehicle mechanic and it just bounced indefinitely.

Yes. It's on the beta and in the docs right now. There is a parameter for spring damping.

  • Thanks 1
Link to comment

Josh, are you going to update the vehicles on 4.6 (or make a beta with what you found...) so that we can use slow vehicles ?

(Very cool would be a prefabs of your car from the videos you posted)...

Or upload on open code Project with that car would be great...

Link to comment

Yes, I agree, I agree, too, to include the work in the release with the limitation that it is for vehicles below 25 kilometres per hour, with the limitation made on the vehicle template that does not exceed that speed. 

Link to comment

Incredible, if I agree, for vehicles that do not pass a certain speed looks great, a scooter, a shopping cart and so on.

A question Josh, the forklift looks very good, have you tried if it is possible to lift a pallet that has a concave body assigned to it, that the fork between its holes and lifts them? Also if you can pass over that pallet. In a while I tried but everything flew away. 

Link to comment

The world:Update() command will have a new parameter that allows you to specify the number of substeps the physics simulation will take. This was needed to make my vehicle struts more stable, and I think it will also help with your problem.

  • Like 1
Link to comment

My workshop cars that I tried to optimize for 4.5 don't work with 4.6 anymore, any idea why ? Something must have change thx for any tipp...

Link to comment

Does the "spring" slider joint have any dampening when the wheel is being pushed up? If it doesn't you are going to need to add another slider joint to act as a shock or you are going to have a lot of bounce. Just as in real life if your car had no shocks.

  • Confused 1
Link to comment

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...