Search Unity

Scaled-up physics slowdown

Discussion in 'Physics' started by dibdab, Jul 12, 2019.

  1. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    this is drivin me insane.

    scaled up everything in the scene 4 times the regular size.
    the physics are different with these objects
    but I don't understand why it plays as if timescale was low.

    the speed is
    speed = rigidb.velocity.magnitude * 3.6f;
    upscale0.gif
    it's not the camera
    and its not low fps
    upscale2.jpg

    upscale1.jpg
    has anybody encountered this?

    editd: okay it seems to be the expected behaviour...
    (and the speed reading is correct but little for this scale)
    there's no way around that?
     
    Last edited: Jul 12, 2019
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Well, scaling is not a good thing in physics in Unity, specially in vehicle physics. You may need to keep track of a lot of scaled things, for example:
    • Scale the speed meter by 1/4, so the speed value looks realistic to that size.
    • Scale the time by 4 (Time.timeScale = 4) so the cars move 4x times faster.
    You'll have to deal with similar issues with suspension, engine (it's spinning 4 times slower), and so on. Not to mention the inertias, which are difficult to fine tune correctly and have a direct dependency of the physical dimensions.

    I'm yet to see a valid reason to scale physics in Unity, so I'd really recommend you to use 1:1 scales.
     
  3. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    yeah, it's a tough issue.

    scaling up time didn't work out, but smaller scale 1.5-2 can be fit to alright.
    the speed didn't look right to me (when dividing by 4)*, looked faster, but maybe the slowing down effect was playing tricks with how it felt

    *see the gif. does that vehicle look like going at 25-30, when it shows 100-120?

    I have a feeling something is going on with fixed update / update /. physic loop cycle
    added higher motortorque, higher mass ...

    the reason for me that subjectively the drifting feels better, easier controllable by input than in regular scale

    gamedev is a rollercoaster
    sometimes I feel nailed it, sometimes whole thing goes wack
    now I feel satistied with the result, with a little bit of work on input, brakes can be good
    http://www.mediafire.com/file/xm9fglv6w3iqwbq/RGScene02c.ZIP/file
     
    Last edited: Jul 13, 2019
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    I bet you can get the same effect by using 1:1 scale everywhere, then scaling the rigidbody's inertia.
     
  5. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    thanks for the tip.

    you mean inertiaTensor? because I couldn't find a value that wouldn't throw the car up and down with it.

    anyway I just realized I was using timescale 2 in the demo above,
    so that means other problems elsewhere as well...