High speed vehicle - grip, cornering #168
-
I'd been working on more of an arcade style GoKart setup with the Wheeled controller. For realistic world simulation, most of the default behavior (following) seems accurate. I'd noticed even on the Jolt example on the official repo that the car wheels tend to overspin a lot on startup (although I know it is at 100% throttle, so this may be peeling out?) #Acceleration As a proper startup, for the acceleration of the vehicle would I need to code a dynamic throttle off the tires surface slip? I'd like a more "press A for gas", given the current is actually more like a real world gas pedal, 0-1 analog. #cornering/drift At too high of an sideways friction, the car will just stick like glue to the ground when attempting to slide that direction, until the car inertia breaks the friction and it jumps off the ground and stutters sideways in bunny hops, although not giving more driving control. To hit the higher speeds, like boosting, I just keyed a button to scale up the max torque when pressed. I had my little cart run the perimeter of my track ( border of the entire map to give enough turn-radius time) at 140 mph with excess friction settings, so it at least is at a starting point for racing, just poor control. For a GoKart, to get a "high-speed-energy feeling" without sliding around, thus some kind of grip and cornering, my current brainstorm thoughts are:
I've looked into vehicle settings, but may have missed an obvious solution. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
I ended up using a character virtual for our go karts. The dynamic behavior was just too hard to control and edge cases were breaking stuff. I'm pretty sure Mario go-karts are also kinematic controllers. Its not very realistic, but for arcade go karts? Its perfect. |
Beta Was this translation helpful? Give feedback.
-
This is indeed a hard problem to get right. The engine simulation is complex and makes some simplifications during its solve loop that probably make it different from a real engine. When working on this, my conclusion was that the main reason for the spinning wheels was that in a real car you don't release the clutch in 0.3 seconds (you would use much longer times at lower gears) and you also don't push the gas pedal to 100% instantly. You can hack your vehicle by giving it the ability to apply more impulse to the road like the sample does: (note currently not exposed to JS). Maybe this is something you can use to fix your other problems as well? Tweaking cars is incredibly hard due to the number of tweakable variables. |
Beta Was this translation helpful? Give feedback.
-
I think the cornering is just making sure the Center-of-Mass is closest to ground-level ... tweaking that, and the traction and grip equations seems to fix a lot of my issues. I will need to code something to feed the values based on current acceleration/rate to make it more natural, but this seems to solve the high-speed. 2024-05-30-jolt-car-steering-high-speed.mp4 |
Beta Was this translation helpful? Give feedback.
-
B.t.w. I added official support for the max tire impulse callback here: efecad1 |
Beta Was this translation helpful? Give feedback.
This is indeed a hard problem to get right. The engine simulation is complex and makes some simplifications during its solve loop that probably make it different from a real engine. When working on this, my conclusion was that the main reason for the spinning wheels was that in a real car you don't release the clutch in 0.3 seconds (you would use much longer times at lower gears) and you also don't push the gas pedal to 100% instantly.
You can hack your vehicle by giving it the ability to apply more impulse …