Procedural Generation
Time 5 hrs

Difficulty Module 3
Prerequisites Elevator Challenge
Departments Career & Technology Studies
Authors Sandra Kuipers
Groupings Individual
Minimum Year Group None

Blurb

Procedural Generation

License

This work is shared under the following license: Creative Commons BY-SA-NC

Outline

Learner Outcomes
Students will:
  • ...
Competency Focus
  • ...
Interdisciplinary Connections
  • ...
Reflection
What was successful? What needs changing? Alternative Assessments and Lesson Ideas? What other Differentiation Ideas/Plans could be used?
  • ...
Credits
Any CC attribution, thanks, credit, etc.

This page requires you to be logged in to access it. Please login and try again.
5 mins
Randomness and Pseudorandomness!
Introduction
  • Procedural Generation is the art of creating non-random things randomly.
  • Why is it so popular? Because it enables us to add endless variation to our games :D
  • Procedurally generated games are becoming more and more popular because the way they can increase the replayability of games.
5 mins
A Little History
Getting Started

  • Some of the earliest procedural games were ASCII dungeon crawlers like Rogue (1980) and NetHack (1987).
  • They were created using letters and symbols to create rooms and hallways.
  • Programmers can use a maze generation algorithm to help them draw randomized hallways.
  • Games like Rogue were also low on computer memory because they never needed to store any more than the current game level. Everything else was generated on the fly.
  • If you're interested in these old-school types of games, there's a great tutorial for how to create a maze-based game in Unity.
10 mins
How it Works
Theory
  • There are a lot of different approaches to procedural generation.
  • The core concept is that each method uses a procedure: a set of steps to follow to generate something new.
  • These steps can be as simple as a single random number, or as complex as many multiplied layers of perlin noise.
    • A maze-based approach uses an algorithm to generate hallways and tunnels that connect together. This includes ASCII games like Rogue, NetHack, Angband, ADOM, etc.
    • A tile-based approach uses pre-designed sections of a level, then connects them in square or hexagonal tiles. This approach is used by tonnes of games, including the original Diablo, Civilization, Fortnite, Binding of Issac, etc.
    • A noise-based approach uses a mathematical noise function to generate a continuous value between 0 and 1. These values can then be used to map terrain, objects, biomes, solar systems, etc. This approach is used by games like Minecraft, Diablo II & III, No Mans Sky, etc.
  • The following video gives an example of how noise is used to generate a game level:

10 mins
Dungeon Generation
Examples

  • Dungeon generation may have started with simple ASCII games, but it
  • The gif above comes from an article called Rooms and Mazes.
    • Check it out if you're interested in how dungeon generation works.
    • It has interactive examples and a great description of how the algorithms work.

  • A similar dungeon generation method (above) first creates the rooms, then continues moving them outwards until they no longer overlap.
    • Check out the Gamasutra article for a somewhat long but detailed explanation of this approach.
  • Franchises like Diablo, Torchlight, have used random dungeon generation with amazing results.
  • If random dungeon generation sounds like something you'd like to try yourself, this tutorial could help get you started:

5 mins
Terrain Generation
Examples

  • Branching out from dark underground dungeons, programmers began to use procedural generation above ground to create amazing landscapes.
  • Terrain generation often uses a noide-based approach, using perlin noise or a variation of it, to create hills and valleys, and all the variation of terrain in between.
  • Terrain generation can also use a perlin noise map to determine the temperature and humidity of a region, enabling developers to create randomly placed biomes and ecosystems.
  • There are many different ways to approach making procedural terrain.
    • Minecraft and it's many clones uses a block-based approach.
    • Games like Astroneer take a voxel approach employing the marching cubes algorithm.
    • Noise maps can also be combined with tiles to create randomized levels using pre-defined terrain features. Games like Civilization use this approach.

  • "Since the success of Minecraft, players have seen more and more games dabble in the art of procedural generation, offering them limitless worlds to explore."
  • Games like Fortnite use a style of procedural generation combined with pre-defined content to create semi-random levels. Check out the article here for more info about how Fortnite levels are created.
5 mins
World Generation
Examples

  • If we can create procedural landscapes, the next step is ... a whole procedural world!
  • World generation takes procedural landscapes to an even bigger scale.
  • Not only are noise functions used for the land, but also the sky, weather, ecosystems, plants, and animals.

  • Games like No Mans Sky take it one step further to generate an entire universe of random worlds.
  • The same procedural approach still applies, but in a bigger and bigger scale.
  • Check out Creating Procedural Planets in Unity

5 mins
Procedural Animation
Digging In
  • Dungeons, landscapes and game levels aren't the only thing we can procedurally generate.
  • A procedural process can also be used to animate characters.
  • In 2008, Spore was one of the earliest games to introduce procedural animation.
  • It allowed players to evolve creatures that, no matter how many libss or arms they had, the game would figure out a way for the creature to procedurally walk and move in the world.

  • Spore used a style of procedural animation called Inverse Kinematics, which you can see explained in the video below:

5 mins
Procedural Textures
Digging In
  • The textures we use on 3D models can also be procedurally generated.
  • This can give designers realistic looking textures without hand-creating each image.
  • The following images were created procedurally by layering different pseudo-random effects on top of each other.

10 mins
Why use procedural generation?
Inquiry
  • Finally, to conclude this look at procedural generation, Extra Credits takes a look a why and why not to use procedural generation in game design.

240 mins
Your Procedural Design
Evidence
  • This is an open-ended unit.
  • Take time to explore the many different types and styles of procedural generation and pick one that interests you.
  • In Unity, try your hand at creating some procedurally generated content :D
  • It doesn't have to be a big complex world or game level: start small and build from there.
  • Take some time to search online and experiment with different techniques.
  • Have fun in this unit! Decide what you would like to create, take time to explore what Unity can do, then feel free to submit your procedural creation as your evidence of learning in this unit.
There are no records to display.
There are no records to display.
Powered by Gibbon v26.0.00dev

Founded by Ross Parker at ICHK Secondary | Built by Ross Parker, Sandra Kuipers and the Gibbon community
Copyright © Gibbon Foundation 2010-2024 | Gibbon™ of Gibbon Education Ltd. (Hong Kong)
Created under the GNU GPL | Credits | Translators | Support