Home Forums Programming The Physics of Racing

Viewing 9 reply threads
  • Author
    Posts
    • #6258
      Anonymous
      Inactive
    • #39847
      Anonymous
      Inactive

      http://phors.locost7.info/contents.htm%5B/quote:95ac5074f9%5D

      Good link. I’m doing a lot of work in this area myself at the moment so it’s sure to come in handy. :)

      Here’s another good page I found on the subject for anyone who’s interested:

      http://regedit.gamedev.pl/pub/Linked/Car%20Physics%20for%20Games.html

      It’s explained very well, but what I like about it most is that it looks at the bigger picture and explains how all the forces and phenomena relate to each other to form the complete simulation. Also, it’s specifically written with gaming implementations in mind, so thats a big plus also.

    • #39849
      Anonymous
      Inactive

      Have you seen this Darragh?

      http://www.racer.nl/

      There is another similar link I have in work that be of interest to you.

    • #39885
      Anonymous
      Inactive
    • #39897
      Anonymous
      Inactive

      Thanks for the links Kyotokid. Had a go at Racer after- handles pretty realistically ! :)

      Making some encouraging progress now with the car physics, these articles are certainly proving useful ! I’ve more or less got straight line racing nailed, just need some proper cornering forces and then it’s sorted. :)

    • #39951
      Anonymous
      Inactive

      Cool.. The cornering forces seem to be working out well now. The car exhibits oversteer (it’s a rear wheel drive) when braking harshly during cornering, which is nice. I’ll be putting the source to this project up on my website at some stage later on for anyone who is interested in implementing this themselves.

      Just one problem remains now, and that is in the collision response. I’m using PhysX as the physics library for the project and it sometimes throws the car around rather erractically when hitting the guard rails at high speed. I’ve tried lowering the center of gravity to make the car more stable, but it only improves the situation marginally.

      This banked corner in particular is where the problem is at it’s worst:

    • #39956
      Anonymous
      Inactive

      Games looking pretty nice, reminds me of an early prototype of SEGA Rally. As for your collosion problem, it probably is your collosion mesh. Ideally, what you want to do is build a more accurate collision mesh. These can be complicated tools to write, not sure if theres anything out there open source. But i think you want to build as many smaller shapes as possible to cover the maximum volume, obviously this might impede you performance. Does PhysX not provide examples for something similar (sorry not familar with this lib). As for one recommendation to perhaps help the car(now could be talking out my ass, as im not a physics programmer), but have you tried to increase the weight of the car (i know its not realistic but its a game) as your speed increases, thus when you impact at high speed you should see less erractic movement.

      But all in all it looks like your progressing well. Definately a good "demo" for a job like at the racing studio.. :)

      Cool.. The cornering forces seem to be working out well now. The car exhibits oversteer (it’s a rear wheel drive) when braking harshly during cornering, which is nice. I’ll be putting the source to this project up on my website at some stage later on for anyone who is interested in implementing this themselves.

      Just one problem remains now, and that is in the collision response. I’m using PhysX as the physics library for the project and it sometimes throws the car around rather erractically when hitting the guard rails at high speed. I’ve tried lowering the center of gravity to make the car more stable, but it only improves the situation marginally.

      This banked corner in particular is where the problem is at it’s worst:

      [/quote:4d55ff7ee4]

    • #40007
      Anonymous
      Inactive

      Games looking pretty nice, reminds me of an early prototype of SEGA Rally. [/quote:4a4fe46bb3]

      Cheers for the kind comments Pete.

      Seems to behaving itself pretty well now thankfully, you were definitely on the money with the collision shape suggestion but it turns out that the problem was actually a combination of three issues- not just the one.. :)

      Firstly, one timing constant in the game class was set to something it shouldn’t have been and as a result PhysX was fooled into thinking time was passing far faster than it actually was- causing some overly active collision response from the engine.

      Then there was a coefficient of friction which was set too high on the guard rails. I was trying to prevent the car from just coasting along the rails and not following the track correctly, so I set it a little higher than it probably should have been. I believe this was actually putting energy back into the system when the intention was to take it away.. doh! I’ve gone and implemented friction manually against the rails now instead rather than just setting a PhysX friction value and it works much better.

      Then the collision shape.. I think the sphere shapes for the wheels were actually helping the car to ‘climb’ up the rails after a collision. Also because a sphere was being used (there’s no cylinder shape in PhysX!), they extended slightly beyond the bounding box used for the cars body. I think most of the times when the car was hitting the rails the spheres were only touching it and not the bounding box. Then eventually, once the force is great enough, the bounding box came into contact also which resulted in a nasty jerk from only smooth spheres making contact to a very hard edged box being in contact- causing some very unpleasant collision response.

      Ideally, what you want to do is build a more accurate collision mesh. These can be complicated tools to write, not sure if theres anything out there open source. But i think you want to build as many smaller shapes as possible to cover the maximum volume, obviously this might impede you performance[/quote:4a4fe46bb3]

      It would be good to have that alright, though I think the box is a pretty decent approximation all the same. I’d say if you were doing that you’d nearly want to split the volume of the collision mesh into separate convex shapes to try and keep the performance up, rather than just throw any old mesh at the engine. There’s probably tools out there already for this sort of thing, must have a look and see..

      Does PhysX not provide examples for something similar (sorry not familar with this lib).[/quote:4a4fe46bb3]

      Yeah there’s a few examples of vehicles with the SDK, though to be honest they’re not the best.

      As for one recommendation to perhaps help the car(now could be talking out my ass, as im not a physics programmer), but have you tried to increase the weight of the car (i know its not realistic but its a game) as your speed increases, thus when you impact at high speed you should see less erractic movement. [/quote:4a4fe46bb3]

      Doesn’t help it unfortunately. Increasing the mass will affect the momentum loss alright but if the car’s travelling at the same speed (but with a higher mass) then the change in velocity will not be affected since the increased mometum loss (and the extra velocity loss it causes) will be factored out by the increased mass of the car. Sort of a similar situation to gravity; the mass of an object does not affect how fast it falls, no matter how heavy it is.

    • #40008
      Anonymous
      Inactive

      Hi Darragh,

      Just on the peter_b’s recommendation for a better collision mesh.

      I’m working with 3DS Max and the PhysX viewer at the moment on creating a "best-fit" collision hull for a vehicle.

      http://sourceforge.net/projects/physxplugin/

      and

      http://www.feelingsoftware.com/content/view/72/89/lang,en/

      I think the feeling software version is a bit easier to use when specifying joints constraints and so forth.

      Let me know if this helps.

      B.

    • #40021
      Anonymous
      Inactive

      Hi Darragh,

      Just on the peter_b’s recommendation for a better collision mesh.

      I’m working with 3DS Max and the PhysX viewer at the moment on creating a "best-fit" collision hull for a vehicle.

      http://sourceforge.net/projects/physxplugin/

      and

      http://www.feelingsoftware.com/content/view/72/89/lang,en/

      I think the feeling software version is a bit easier to use when specifying joints constraints and so forth.

      Let me know if this helps.

      B.[/quote:8da3d8bfc5]

      Thanks for the link Jediboy. These plugins look pretty damm handy!

Viewing 9 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.