eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Automatic Export - Lap counter is 0 for many AI drivers in Practice and Quali #66

Open viper4gh opened 8 years ago

viper4gh commented 8 years ago

Lap counter is 0, but they have a fastest lap. Results.zip

Is it a API problem or a ds-liveview problem?

The difference to recent tests is, that I drive the current sessions and the sessions finished during driving. In the recent tests the sessions ended if I was in the box.

Next step: record a session when driving and check the API data on session ending.

viper4gh commented 8 years ago

Problem is the DS API. CurrentLap is set to zero if the session time is over. But at this moment the session is not over, because the SessionStage stays until the result screen timer in game reaches zero. In this time the AI drives all cars in background and if a car drives over the Start/Finish line the CurrentLap ist set to the value before the session time was over. In a lap race all cars which reach the Start/Finish line before the end timer reaches zero have one lap more, because the lap is also counting.

A solution could be checking the driver State and the SessionTimeDuration/SessionTimeElapsed values: timed session(Practice/Qualifying) - if SessionTimeElapsed reaches SessionTimeDuration all CurenntLap values are set to zero. save the values at this moment. lap session (lapped Race) - if the driver state switches from "Racing" to "Finished" save the CurrentLap values from the Racing State.