Code Monkey home page Code Monkey logo

Comments (2)

Alayan-stk-2 avatar Alayan-stk-2 commented on September 4, 2024

After investigation, this has two main causes.

First, when crossing a lapline, it can happen that the replay recorder saves a distance that doesn't account for the crossed lap. This is the first cause.

138.641663 -105.644043 6.146392 67.657158 -0.005352 0.935016 0.020872 0.353949 26.120684 1.000000 0.252395 0.251139 0.246714 0.248570 1 0 0.000000 4 4 0 5224.465820 0 0 200 0 0
138.733337 -104.367973 6.179694 65.620842 0.000447 0.924822 0.003547 0.380384 26.427118 1.000000 0.243190 0.246226 0.248869 0.254281 1 0 0.000000 4 4 0 2613.485352 0 0 200 0 0
138.833328 -102.906494 6.185417 63.410870 0.003801 0.912611 -0.004915 0.408782 26.691500 1.000000 0.260125 0.260078 0.253631 0.258309 1 0 0.000000 4 4 0 5229.619141 0 0 200 0 0

The second issue is in how getTimeForDistance handles a ghost kart having been at a given distance multiple times. It starts its search for the relevant replay frame from the current replay frame (that is, from the position the ghost kart is at when racing against it), so if a ghost kart has been at a given distance multiple times, which of those times get used for the comparison depends on how quickly the other kart is driving.

Taking the earliest time the distance has been reached by the ghost would seem like a logical solution, but on the other hand it is clearly weird if the ghost kart is visibly behind and it is displayed ahead. It is rather good behavior that, if the ghost kart goes backwards and the kart it's compared to is now ahead on the track, its time is compared to the next time the ghost kart reaches this distance rather than the first one it did.

from stk-code.

Alayan-stk-2 avatar Alayan-stk-2 commented on September 4, 2024

First, when crossing a lapline, it can happen that the replay recorder saves a distance that doesn't account for the crossed lap. This is the first cause.

On testing, this happens on most laps in any kind of race. m_overall_distance gets updated accounting for the new position on track but before the new lap is validated, and is therefore wrong for one frame.

EDIT : New lap updates distances again, however, and further testing indicates that the replay recorder is only recording data afterwards. But it is a hard fact that the replay files contain the incorrect distance... Something is amiss.

from stk-code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.