[ASSETS] [OPEN SOURCE] Tanks, tracks and N-wheeled vehicles

New update is out on GitHub.
Added automatic sleep mod:
The idea is to put vehicle’s rigid bodies to sleep if it’s not doing anything. PhysX will do that for you automatically and wake-it-up as soon as some force is applied, like collision. Unfortunately that doesn’t work in our case because suspension keeps pushing main body on every tick. I’ve added a small routine where current velocity of the vehicle is compared to some minimal allowed velocity. If current velocity is lower than body goes into sleep and the whole vehicle update graph is ignored. It will wake-up if something collides with it or when player tries to steer vehicle or accelerate/bake.

  • vehicles inherited from ATracked_Vehicle got a new variables SleepVelocity and SleepTimerSeconds
  • SleepVelocity is a minimal velocity under which vehicle will go to sleep. Value of 10 is enough for M113 to not slide sideways on 5 degree sloped surface
  • SleepTimerSeconds is amount of seconds between sleep check. It’s necessary for it to be at least more than 1 second otherwise vehicle can perpetually hang in air or not wakeup when you try to steer it.
  • to see if vehicle is sleeping, posses it and enable debug mode [shift+alt+d] it will wakeup because of this, but later will go into sleep

This doesn’t solve the problem of friction either being not enough or not being simulate properly, so while on 5 degree slope M113 will fall asleep it won’t fall asleep on 10 degree slope as there is not enough friction force applied. One could go with higher than 10 values of SleepVelocity, but at about 50 Ripsaw can just stuck in the air while swinging on it’s bouncy suspension. So be aware of this, I don’t know if 10 units is good (10cm/s?) it seams to work well enough. Let me know if I need to make it smaller by default.