Single precision coordination system

Discussion in 'General Discussion' started by Havner, Jan 2, 2022.

  1. Havner

    Havner Registered

    Joined:
    Jul 14, 2020
    Messages:
    361
    Likes Received:
    359
    I just had a funny realization. rFactor 2 has the same issue Assetto Corsa had (until recent versions of CSP). On a big map (I recently tried Targa Florio) the car is shaking without any apparent reason. The coordination system based on floats has too low precision to handle such big maps properly :)

    Fortunately the issue is less pronounced than it was AC. In here the whole model is shaking, in AC it looked like every single vertex was shaking independently of others.

    Not a major issue by any means, but probably worth addressing at some point if we ever get to such a point :)
     
  2. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    956
    Likes Received:
    2,191
  3. Havner

    Havner Registered

    Joined:
    Jul 14, 2020
    Messages:
    361
    Likes Received:
    359
  4. Mitch9

    Mitch9 Registered

    Joined:
    Jul 26, 2020
    Messages:
    256
    Likes Received:
    219
    Jeez... Consider maybe he doesn't have the nords?

    Anyways, I wouldn't hold my breath for this to be addressed. The nords is the biggest track that makes sense to make as oficial dlc and the shaking is not a huge deal there
     
  5. Havner

    Havner Registered

    Joined:
    Jul 14, 2020
    Messages:
    361
    Likes Received:
    359
    I did. He either has it and can check it for himself or he doesn't and in that case why does it matter for him?

    This was all gravitating towards: Nords is the biggest official track, there is no issue there so there is no issue whatsoever. And that's simply not true. Last time I checked rF2 was officially supporting mods.

    About it being addressed of course, I wouldn't hold my breath as well. Truth told I stopped holding my breath for simply anything to be addressed in rF2. So I am at peace. Fortunately this issue manifests itself in much lighter form than it did in AC. I just shared my observation.
     
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    I presume this is only graphical?

    I don't have the plugin interface in front of me but pretty much everything there is Double.
     
  7. Havner

    Havner Registered

    Joined:
    Jul 14, 2020
    Messages:
    361
    Likes Received:
    359
    Out of curiosity. I did check. It is 100% reproducible on Nordshleife. And funny thing is you don't even need a Nordshleife, Nurburgring is enough. I would assume that the coordinates center is inside Nurburgring to limit the issue on short tracks but apparently no. Just go to the Dunlop, stop, turn off engine and hold brakes. The shaking is there. Less than on Targa Florio but it's clearly there. More visible on side monitors (if you have triples), but still visible on center. Tested on "24H" and "24H support".

    Not reproducible e.g. on Spa and Monza.

    You don't see it while driving, especially with a camera settings that don't hold the cockpit stable. So it's not really a serious issue as I said previously.

    I honestly wouldn't know. If the coordination system have something to do with physical calculations it might, but I wouldn't be able to notice it without some very precise tests. Definitely nothing strange happens with normal driving but I'm not the best person to test it.

    Code:
    struct TelemVect3
    {
      double x, y, z;
    (...)
    };
    
    And you would be right, but honestly it might not mean a lot as this structure is not only used for position but for many other things, some of which might indeed be double, but maybe not all? And it would be simpler to represent it using one struct.

    Code:
    TelemVect3 mPos;               // world position in meters
    TelemVect3 mLocalVel;          // velocity (meters/sec) in local vehicle coordinates
    TelemVect3 mLocalAccel;        // acceleration (meters/sec^2) in local vehicle coordinates
    TelemVect3 mOri[3];            // rows of orientation matrix (use TelemQuat conversions if desired), also converts local
    TelemVect3 mLocalRot;          // rotation (radians/sec) in local vehicle coordinates
    TelemVect3 mLocalRotAccel;     // rotational acceleration (radians/sec^2) in local vehicle coordinates
    TelemVect3 mLastImpactPos;     // location of last impact
    TelemVect3 mCamPos;            // camera position
    TelemVect3 mCamOri[3];         // rows of orientation matrix (use TelemQuat conversions if desired), also converts local
    TelemVect3 mWind;                // wind speed
    TelemVect3 forwardVector = { -info.mOri[0].z, -info.mOri[1].z, -info.mOri[2].z };
    TelemVect3    leftVector = { info.mOri[0].x,  info.mOri[1].x,  info.mOri[2].x };
    

    EDIT:
    Also they might've opted for double in the plugin interface for it to be extensible in the future without ABI breakage. Doesn't really mean what precision the inside calculations are made on.
     
    Last edited: Jan 2, 2022

Share This Page