Exploring randomness

Now one strange thing to keep in mind is that there is no such thing as a completely random system, especially in gaming and computing. You can get close with some really complex mathematical systems but nothing is truly random. The best we can do is make it random enough to fool the player, making them believe it is random.

The reason for this is simple: computers are not random and don't think in random terms. When they generate a random number, they are using a seed (a unique number to base their random generation on) to work out what number to give you. But every time you generate a number based on that same seed, it will always be the same sequence; this is known as pseudo-random.

Most basic systems try to balance this ...

Get Mastering Unity 2D Game Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.