Skip to content

12. Probabilities

sergiodinapoli edited this page Sep 11, 2021 · 1 revision

I have little information and experience for this mechanism, but I'll show here what I know.
Let's consider this again:

<li>r_logentry->I hate mechanoids!</li>
<li>r_logentry->I think I know what technical failure doomed our ship.</li>
<li>r_logentry->I think cooperation is the key for success here!</li>
<li>r_logentry->I really enjoy waking up early in the morning.</li>

As you know by now, each line has the same chance of being selected, since they all are unconditioned.
Of course, you could alter this by using conditions. But what if you just want to directly favor (or hinder) chances for a specific line?
Consider this:

<li>r_logentry(p=0.5)->I hate mechanoids!</li>
<li>r_logentry(p=2)->I think I know what technical failure doomed our ship.</li>
<li>r_logentry->I think cooperation is the key for success here!</li>
<li>r_logentry->I really enjoy waking up early in the morning.</li>

This way, the first line will be selected with half of the default chance, whereas the second line will be selected with double chance.
In other words, it is as if the second line were written twice, so it has double chance of being selected.
As for the first line, it's trickier: you must make some abstraction and imagine it as if it were written "a half" times.

Wrapping it up in an easy and generic way: higher "p" means higher chances of being selected.

I understand that the default is p=1 and all other numbers are relative to this.

You may want to use this mechanism so that a more "pressing" or "commonplace" sentence has a higher probability of showing up. A case of extreme emergency, for instance, needs to be spoken more often than a normal sentence - so we could use the "p" mechanism for it.