B
B
badimint2014-12-24 14:10:34
PHP
badimint, 2014-12-24 14:10:34

How are probabilities calculated in games?

Let's say there is an 80% chance that it will rain today.
In what way in games do they calculate whether he will go?
And is this simple method fair:
ver = random(1, 100);
If ver > 80 then it won't work, if ver<80 then it will. Or does it look like crap?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Grechushnikov, 2014-12-24
@maxyc_webber

add a few conditions
not just by chance, but also by checking for the time since the last rain. so that it often was not and was not for a long time

A
Alexander Aksentiev, 2014-12-24
@Sanasol

Not nonsense. That's pretty much what happens.
From the word Korean random.

S
Sergey Lerg, 2014-12-24
@Lerg

Yes, they do. Only usually operate with numbers less than 1.
raining = random() < 0.8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question