Kyle Miceli
  • Home
  • Contact

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:
  • Old tiles were never removed causing a lot of unneeded garbage collection
  • Tiles were not generated along with the player, meaning tiles would be continuously spawned if the player was not moving. Eventually, so many tiles would spawn, that the game would end up crashing
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.
Picture
Picture

System behind the scenes:

Here is a behind the scenes of a traffic system I developed in 2020:

  • Home
  • Contact