LennysLounge / ACC-Race-Control

A live timing app for Assett Corsa Competizione
MIT License
32 stars 5 forks source link

info: broadcasting return accident #17

Closed mdonadel83 closed 1 year ago

mdonadel83 commented 1 year ago

Hi dev, I wrote an app in python where put the information from ACC broadcasting into a db..I only have a question...maybe you can help me... When i read only a broadcast from ACC ,often when will be a contact or incident , broadcast send to me, sometimes 1 record with the car id of the incident and sometimes all 2 records...i don't understand why it happen...how do you resolv ?maybe in java you not had this problem? Thank

LennysLounge commented 1 year ago

I do have that issues. Its a problem with the way accidents are reported by the game.

As far as i know there is no way to fix this. The best you can do is to work around it.

Roughly here is what RaceControl does: 1) It groups accidents that happend around the same time together into one accident. This mostly works, however sometimes the game only reports one car. Sometimes multiple accidents happen at the same time and this will group them all together into one accident. This is especially bad at the start or races. 2) Group cars together by there distance on track. To solve the grouping problem i 1. i try to find the cars that are close at the moment the accident happened. The accident is reported by the game 5 seconds after it happened. I keep a 10 second history of all car data to find the exact moment the accident happened and then group cars by their distance on track. The distance is not always very accurate so this does not produce perfect outputs. 3) Sometimes an accident is not reported at all by the game. This mostly happens in team races with multiple drivers per team. I again analyse the car position and orientation to find out if a car has spun. If a car has spun and a second car was closeby then this is likely an accident. This again is not perfect.

These three things work pretty well together but not perfect. This is sadly a limitation from the game.

For more information how this works you would have to look at the source code. I cant explain it all here.

mdonadel83 commented 1 year ago

Oh yes, wonderful idea!Now i understand why your app works good for the accident ,and my no.The First point i did too, (group the car with the same time)but still sometimes i have a same problem you wrote,when It send only one car,or not send anything... It's very interest for me understand the point 2and3 cause i don't know where i can find the info about the distance between the cars ,i'll try to find into your code and replicate into python for try to report correctly the contact! Maybe ,if i'll find problem, can i ask you suggest? Thanks you

mdonadel83 commented 1 year ago

All Is clear thanks for help!