kaiusl / KLPlugins.DynLeaderboards

ACC leaderboard plugin for SimHub
https://kaiusl.github.io/KLPlugins.DynLeaderboards/
MIT License
13 stars 1 forks source link

Add mandatory pit info #17

Closed kaiusl closed 1 year ago

kaiusl commented 1 year ago

Split from #14.

Add mandatory pit requirement & completion per driver (i.e. DataCorePlugin.GameRawData.Graphics.missingMandatoryPits & DataCorePlugin.GameRawData.Graphics.MandatoryPitDone).

kaiusl commented 1 year ago

Some notes on this.

We only have MandatoryPitDone info for the player car but not for everyone else, thus we would need to figure out if a car served mandatory pit ourselves, eg we need to figure out what a car did in the pits.

There are three aspects of mandatory pitstops: pit window, driver change and tyre change. But we don't actually have any information about which of these are required at a given session. Now assuming that we would have that data there are still some issues. I think we can figure out first two parts of the mandatory pit requirements. We do have pit window time and length from the shared memory data, so we can figure that part out. Similarly we do know which driver is in the car. However if the car actually changed the tyres is more tricky.

We do know if the car is in the pitlane and if it served a penalty (to be more precise we receive a message if the penalty was cleared). From the car's speed we can figure out when it's stopped, but we don't know if it is actually stopped in it's pitbox or not (this info is only available for the player car), which is another issue. We also know that a tyre change takes 30s, so if the pitstop is shorter than than, we know there couldn't have been a tyre change but we if a car did some repairs it can have a pitstop longer than 30s without changing tyres and thus we cannot be certain.

So in summary I think this would become feasible if we get some extra data from ACC, either directly the number of served (or left to be served) mandatory pitstops or which components are required and what the car actually did in the pits.