unorthodox-paradox / omsi_2_csb_ai_enhancements

AI enhancements for CSB vehicles
1 stars 0 forks source link

Improve timing of engine-transmission-handbrake adjustment sequences #84

Closed unorthodox-paradox closed 5 years ago

unorthodox-paradox commented 5 years ago

The probability of the AI engaging the handbrake last as part of their prolonged stop arrival sequence (normally ordered as a) engage handbrake, b) switch transmission mode to N, c) turn off engine), and first as part of their prolonged stop departure sequence (normally ordered as a) turn on engine, b) switch transmission mode to D, c) disengage handbrake) is currently too great. In reality a professional driver would hardly ever act like that, both as the result of their training, and the fact that modern vehicles tend to be equipped with an alarm ringing when the handbrake is disengaged while the engine is not running.

The probability of handbrake adjustment occurring too soon is unintentionally too great because a) the three actions are timed independently of one another, and b) our expectations of random number generation are flawed (see #15 and this update). Until the overarching issue of random number generation gets properly addressed, provide a temp-fix that coordinates the scheduling of all three events based on shared conditional probability, providing a "harder" guarantee that the sequence of actions undertaken by the AI will be "by the book" much more often than not.

Special thanks to Florito for bringing this to our attention, thereby helping shed light on the overarching issue of erroneous random number generation handling.