CodeBlanks Logo Icon CodeBlanks

What is procedural?

Learn that procedural generation creates content via algorithm.

Procedural Content Generation (PCG)

Procedural Generation is the algorithmic creation of game content (maps, levels, textures) using mathematical rules rather than manual handcrafting by designers.

// Generating a world at runtime using algorithms
void GenerateWorld() {
    // Terrain is constructed via rules and loops
}

This methodology enables infinite level variety, providing players with a fresh experience on every playthrough.

Runtime Execution and Memory Savings

Storing mathematical recipes and synthesizing worlds at runtime instead of packaging hundreds of gigabytes of pre-built meshes yields massive storage savings.

// Store rules in code, generate maps on demand
int levelSeed = 1337;

Titles such as Minecraft and No Man's Sky deliver boundless territory while requiring minimal initial install sizes.

Practice Procedural generation status

Define a Start method. Inside, declare string durum = "Procedural dunya uretildi"; and print it to the console with Debug.Log(durum);.

Starter code

Player.cs
using UnityEngine;

public class ProceduralIntro : MonoBehaviour
{
    // Start icinde durum tanimla ve yazdir
}

Sample solution

Player.cs
using UnityEngine;

public class ProceduralIntro : MonoBehaviour
{
    void Start()
    {
        string durum = "Procedural dunya uretildi";
        Debug.Log(durum);
    }
}

Expected output

Procedural dunya uretildi

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is the most distinct advantage of Procedural Content Generation (PCG) compared to handcrafted map design?

  • Deleting all cameras and lights from the scene
  • Generating varied, infinite, or reproducible content automatically each run Correct answer
  • Disabling the game graphics card (GPU) completely
  • Converting all audio files automatically to mono format

Explanation: Procedural generation can automatically build unique or infinite worlds on every session using algorithmic rules.

2 World generation function

Question
void ____() { }
Answer
void GenerateWorld() { }

Explanation: The function triggering procedural generation logic is conventionally declared with an expressive name like 'GenerateWorld'.

3 Procedural core concepts

Term Meaning
Procedural Algorithmic content generation
Runtime The moment the game is actively running
Handcrafted Manually designed traditional content
Algorithm Mathematical steps shaping the content

All lessons in Advanced