Hi guys, I`m back to question DP algorithms yet again. The target for today is the so-called random speech chance mentioned in >>3382
Judging by the code
, DP random speech is implemented as a series of bernoulli trials
being run on each timer tick (i.e. each 40 milliserconds
). The delay duration is thus geometrically distributed
, since producing a random speech delay of N msec is equivalent to failing (N / 40) consecutive Bernoulli trials.
Let`s take, for example, 50% random speech chance. This is how the delay probability looks like
in that case: X = milliseconds since the previous speech cooldown expired, Y(X) = probability in % that the delay would span X msec.
As can be seen, at the 200 msec mark the probability drops to 3%, which means that of 100 random speech instances only 3 can possibly be delayed for more than one fifth of a second, and the other 97 are to be displayed even earlier.
The DP animation base in its current state contains 1911 unique behaviours, of which only 20 have a minimal duration of less that 200 msec. Of all behaviours only the 20/1911th part (~1%) have a 3% theoretical
probability of the random speech not being shown when the corresponding option is at 50%.
That`s certainly not how it was meant to be.
I propose to decide whether and when a random speech is to be shown at the behaviour switching event, the 'whether' governed by the random speech chance and the 'when' normally distributed by the time span of the current behaviour.