O'Reilly logo

Procedural Content Generation for C++ Game Development by Dale Green

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Creating Unique and Randomized Game Objects

In this chapter, we're going to make our classes more random. We touched on a similar subject matter in Chapter 3, Using RNG with C++ Data Types, by giving the player random stats, so we'll continue further down that path and build bigger, more versatile procedural classes.

Having game items generated randomly is a great way to bring versatility and replayability to a game. For example, all the weapons in Borderlands are generated randomly; each chest and loot drop will contain a unique item. It brings an element of unknown to the game, and each time you find an item there's no knowing what it could be.

In this chapter, we'll cover the following topics:

  • Giving objects random sprites
  • Generating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required