By Brenden Bobby
Unless you’re an avid gamer, the phrase “procedural generation” probably hasn’t meant much to you up to this point. You have to admit, it looks more like the name of a sci-fi cop novel than anything that might impact your life.
However, procedural generation has slipped its way into our digital lives in more ways than we realize. So what is it?
Essentially, it just means that a computer made something, graphically, with minimal human intervention.
The most relatable example I can think of is “Minecraft”.
Mojang, the developers of “Minecraft”, programmed the functions, models and textures into the game, but set the game up to generate everything inside of it as you encounter it, then save it afterward. That means that no two experiences are alike, and each time you step into a new world, you’re stepping into a totally new adventure.
How does the computer do this? Will it gain sentience?!
Luckily it won’t. It’s just using mathematical algorithms programmed in by the developers to generate things in a procedure, hence the name. In the case of “Minecraft”, it begins with a seed. You can’t plant the seed in the garden, because this seed is just a string of numbers that fits into the constant of the algorithm.
As an example, if you set the seed as 12345 then enter the game, you’ll get a world. If you start a new game and set the seed as 12345, you’ll get the exact same world, because 12345 is now the constant in the equation you can’t see.
So what happens if you don’t select a seed? How does the computer figure out what to do then?
There are a number of ways the computer decides how to proceed. We’ve talked about RNG, or random number generation before. A computer is a machine, and it’s not capable of being truly random, it’s just really good at appearing random. If you don’t select a seed, generally the computer will snapshot the exact time it was told to create a seed. You don’t see these processes happening, so to you it looks completely random. In actuality, if you told it to create something at the exact same time (down to the thousandths, even millionths of a second) on two separate days, chances are you’ll get the same outcome. This process varies between software developers.
So what are the benefits of doing things this way? There are many!
Less human time spent on developing computer programs. This translates to less money being spent on program developers and a bigger focus on catching bugs and unintended behavior, which creates a polished and marketable product.
Less file space usage, which translates to faster download times, more storage on your computer and better computer performance.
More variance for the end user. Who doesn’t like variety? “Minecraft” and the “Diablo” franchise are still hugely popular because of their near-infinite replayability.
While procedural generation has the biggest benefit to gamers, that’s not the only place it’s filtered into our lives. It’s been used in the film industry to quickly generate background items that appear extremely detailed, but would cost a fortune to build and shoot for a few hours. As an example, some chain grocery store commercials procedurally generate stands full of fruit. If you were to visit during filming, you’d see empty stands, but they later use a computer to generate an apple, then an algorithm to generate another apple of a slightly different shape, color, maybe with different markings, then do that a couple of hundred times in a few seconds to fill the stand.
Background items that aren’t a focus, like cliffs or clouds or treelines are also procedurally generated, especially in movies that heavily use CGI (think: any superhero movie.)
Similar functions are used to tailor search engines to your interests. The seed, in the case of your search engine, is your past results, then the algorithm crafts everything around those searches to fine-tune future results for you. This, however, isn’t technically referred to as procedural generation. It has another name that strikes fear into the hearts of humans, who are woefully ignorant of the depth in which it permeates our lives.
Dun dun dunnnn!
That’s right, 7B. I lured you in with the promise of cool game technology to bait and switch you into a controversial subject at the cutting edge of science.
I’ve been wanting to cover AI for a while now, but it’s an intensely complicated, multifaceted subject that would take a few articles to cover.
Now that we’ve covered some of the basics, we can dive right in next week to begin a two-week series on artificial intelligence.
In the words of another famous AI: I’ll be back.