Creating and Optimizing Procedural Generation
In 2019, I set out to create a procedural generation system, similar to a game named Crossy Road. A procedural generation system allows for a game to be random, but also to be played until the player loses. So, they can play forever theoretically.
|
This initial video from September 2019, shows the first iteration of the generation system. Different colors equate to different obstacles spawning. Eventually these obstacles were setup to be things such as a road with a car on it, a farm field with wheat, a tile of just grass, etc.
However, this first system came with two severe problems:
|
|
After this initial prototype, I set out to solve these two problems. The video on the left shows the completed system in action. For a look at how the problems were solved, please see below.
|
Removing Old Tiles: Each tile spawned received a script on it. It would track if the player ever walked on the tile. If it did, it would ready itself for deletion. Additionally, it wouldn't delete itself unless it was off screen. Script in question:
|
Generating Tiles Efficiently: The updated generation system, would spawn a few when the player first opens the game. Then, when the player moves forward would a tile be generated.
|