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

Vehicle Development


Josh

9,585 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



Not sure how many other users came across these problems but I suspect you appreciate their challenges more now.  Glad you're handling this because these issues are definitely beyond my skills.

Link to comment
10 minutes ago, gamecreator said:

Yikes.  Did he break something he shouldn't have?

No, he had a good working system and then two years ago he replaced it with vaporware.

  • I can't use the old code without rolling Newton way back and losing updates we need.
  • His new code is totally broken and not working.
  • My own attempts to implement a vehicle are producing bad results.

I don't know what to do, and everyone just thinks it's a big funny joke.

  • Sad 1
Link to comment

@Josh: Why should/did you expect something about Newton while you can do the vehicles with an own system, that promises to be good ?

Link to comment
5 hours ago, Marcousik said:

@Josh: Why should/did you expect something about Newton while you can do the vehicles with an own system, that promises to be good ?

I tried. The shocks are very bumpy, as you can see above. Collision with the ground is glitchy. And it randomly crashes. I can't release this.

I tried to hire a guy on the Newton forum, and his response was "hehe, I only code for fun!"

  • Sad 1
Link to comment

it sad that newton gone down hill for there stuff

i notice that most of hthe physic engine seem to slow down or stop doing anything

seem silly 

are you thinking of may be move away from newton to another

Link to comment

I've been using Bullet in a lot of projects lately, it's really come a long way in the last couple of years. Very fast, more than accurate enough, fully-featured (unlike Newton), and open source... The documentation is also decent, especially stacked up beside Newtons.

 

If you are planning to switch I'd imagine Bullet would be a pretty quick and painless switch. PhysX is good too but honestly, I prefer Bullet it has more options.

Performance wise it leaves Newton in the dust, the only downside is the rigid body simulations may not be quite as stable but I'm sure they're more than good enough for Leadwerks' needs. Multi-threading physics simulations with Bullet is also very easy and the source code comes with tons of examples.

Link to comment

I think the best thing to do is to leave leadwerks without a vehicle system, to migrate to another physics system at this point, it implies disconnecting all the functions established with Newton, and that implies work and time on Josh's part, something that some at this point think should be invested in the new Turbo Engine. 

And yet it's bad news, but I guess if leadwerks has been a while without a vehicle system, they can do it another time. 

Translated with www.DeepL.com/Translator

Link to comment

I get what you're saying, but the two physics libraries are very similar in how you implement them, switching the system out would be a rather simple process.

Plus I would assume Josh uses some kind of higher level wrapper for the physics APIs that is used in both Turbo and Leadwerks. Changing one would like be nearly as simple as a copy and paste to the other with some minor changes. (That is a guess, I don't know how Turbo's physics were done.)

If Newton does the job I'd say leave it... but it seems like it's causing headaches which with all the robust, free physics APIs out there these days there is no reason to go with a under-featured and under-documented one.

  • Like 1
Link to comment

Vehicles in 4.6 are cancelled. There is no clear path forward at this time. I am not saying never, but there is no clear path forward right now.

I think vehicles are a Newton feature, not a Leadwerks feature, since I cannot implement them. So if you want vehicles you should be talking to the Newton developer, not me.

Link to comment

Josh, can you tell us why another (possibly better) engine is seriously not viable?  I assume it's been a few years since you looked into other engines.

Link to comment
Just now, gamecreator said:

Josh, can you tell us why another (possibly better) engine is seriously not viable?  I assume it's been a few years since you looked into other engines.

Do you have any idea how big a deal that would be? It would take a year just to get back to where we are now.

Link to comment
10 minutes ago, Yue said:

This implies that vehicles are also not viable with joints, right?

Not at speeds over 25 MPH.

  • Sad 1
Link to comment

The drawback is that time and work on Josh's part, time that must be invested in the new Turbo engine, really a shame, but I guess that's the reality. 

So, already said, focus your efforts on Turbo, surely with the experience you have gained over the years the results will be great.  Looking forward with Turbo. ;)

Link to comment
1 minute ago, reepblue said:

¿Aún estará disponible el nuevo parámetro de resorte? Parece que puede tener otros usos.

Yes, the springs are available, but in the case of cars it is for very low speeds, like a baby carriage or something similar. 

Link to comment
22 minutes ago, Josh said:

Do you have any idea how big a deal that would be? It would take a year just to get back to where we are now.

I didn't know.  What more would you need to do other than replace Newton functions with another engine's?  (This assumes, of course, that there are 1 to 1 functions available.)

Link to comment

The other possibility is that leadwerks c++ has a door for the user to use a third party engine.  That implies two things, that some experienced users create a plugin or the same user make the link with another engine of their choice. I think it was the same for the network system. 

Link to comment
1 minute ago, gamecreator said:

I didn't know.  What more would you need to do other than replace Newton functions with another engine's?

Physics engines do not work the same. Once I get into it I'm sure there will be all sorts of issues.

Newton's stability for motorized joints is something no other library matches, which is very important for VR and anything related to robotics.

Newton also has other features like user-defined dynamics collisions (which I use for the vegetation system) and the ability to compile with 64-bit floats that I use or want to expand on in the future.

  • Thanks 1
  • Upvote 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...