Chapter 3. Using RNG with C++ Data Types

In Chapter 1, An Introduction to Procedural Generation, we learned the fact that pseudorandom number generation is at the heart of random procedural generation. Remember, a procedural system is not random by nature, we need to induce randomness. To start our journey, we're going to look at a range of different C++ data types, and use Random Number Generator (RNG) to give them random values at runtime. This ability to use core C++ data types in a random, yet still controlled, way will be the basis for all our future systems.

In this chapter we'll cover the following topics:

  • Setting the game seed
  • Enumerators
  • Setting Boolean values randomly
  • Accessing random elements in an array
  • Generating random strings
  • Random number ...

Get Procedural Content Generation for C++ Game Development 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.