procedural generation

  • you can produce content (sound, 3d graphics, ) using an algorithm by defining a set of rules
  • minecraft is a game where the landscape is procedurally generated. there are terrain building algorithms thtat run on the fly as you explore the world
  • proceduralGeneration = rules + randomness + noise + parameters
  • rules give the content structure (”mountains are made of stone”, “trees grow on grass”)
  • randomness gives variety. for example, you can use a pseudo random number generator’s source of decisions. everytime the genearator needs to make a decision, you can have the RNG to make the decision
    • to determine if a chunk should have a lava lake → chance (yes/no) r < 0.3
    • to determine a tree height, we could pick a value within a range min + r × (max − min)
  • noise are mathematical algorithms that produce pseudo-random, smooth, and natural-looking patterns. we use noise so that nearby inputs give similar outputs, so that the random function is “smoothed” and there are no sudden jumps between neighboring points
    • if we used raw randomness instead of randomness + noise, we’d get static everywhere, where let’s say for example you get a desert block next to a snow block next to a jungle block in a minecraft biome
  • parameters help shape the character of the output (size, amounts, ranges, frequencies)