1
00:00:00,160 --> 00:00:03,360
A simple mathematical function from the 1980s has quietly

2
00:00:03,360 --> 00:00:06,880
shaped some of the most iconic games of the past few decades.

3
00:00:06,880 --> 00:00:12,160
Today, I want to tell you the story behind it, why it was invented, why it works so well,

4
00:00:12,160 --> 00:00:15,520
and why I believe it could be the most important algorithm in the history of

5
00:00:15,520 --> 00:00:19,440
video games.  And hopefully, this provides you with enough evidence to decide whether or not you agree.  It

6
00:00:19,440 --> 00:00:24,640
all began in 1982 with a film that changed the history of computer graphics.

7
00:00:24,640 --> 00:00:29,120
Ken Perlin was a member of the visual effects team on Tron, the first Hollywood film

8
00:00:29,120 --> 00:00:35,120
built almost entirely from computer-generated imagery.  It was groundbreaking.  But for him,

9
00:00:35,120 --> 00:00:39,440
that still wasn't good enough: "everything looked like a machine," he later said.

10
00:00:39,440 --> 00:00:44,000
The problem is the structure.  When they try to simulate things like fire or smoke,

11
00:00:44,000 --> 00:00:47,071
the results look flat and artificial.

12
00:00:47,071 --> 00:00:50,520
The tools for creating detail rely on white noise,

13
00:00:50,520 --> 00:00:54,194
resulting in a more static-looking rather than natural effect.

14
00:00:54,194 --> 00:00:56,037
Perlin wanted something better.

15
00:00:56,037 --> 00:00:59,720
Something that feels smooth and natural but can be created quickly

16
00:00:59,720 --> 00:01:02,160
without heavy manual work or calculations.

17
00:01:02,160 --> 00:01:08,400
His solution became Perlin Noise, and in 1997, it won the Academy Award for Technical Achievement,

18
00:01:08,400 --> 00:01:10,800
an award given alongside the Oscars,

19
00:01:10,800 --> 00:01:15,200
in a ceremony that later also honored the creators of Photoshop.

20
00:01:15,200 --> 00:01:18,417
So… what exactly is Perlin Noise?

21
00:01:18,417 --> 00:01:20,880
At its core, it's just a function.

22
00:01:20,880 --> 00:01:25,200
You provide it with one or more numbers as input (a position in space) and it will return

23
00:01:25,200 --> 00:01:31,360
another number to you.  Technically, the output goes from –1 to 1, but in most visual applications,

24
00:01:31,360 --> 00:01:37,920
it's scaled to a range from 0 to 1: black to white, with shades of gray in between.

25
00:01:37,920 --> 00:01:43,600
But here's the trick: inputs that are close together will produce similar outputs.  We will later see that this is

26
00:01:43,600 --> 00:01:48,880
precisely what makes it useful in video games: it creates patterns with a reasonable balance

27
00:01:48,880 --> 00:01:55,680
between order and chaos.  Unpredictable, but smooth.  Random but structured.

28
00:01:55,680 --> 00:02:00,720
Let's see how it works.  And don't worry, it's surprisingly simple.

29
00:02:00,720 --> 00:02:05,600
To create Perlin Noise, we begin by dividing the space into a regular grid.

30
00:02:05,600 --> 00:02:11,328
At each corner of that grid, we assign a unit vector pointing in a random direction.

31
00:02:11,328 --> 00:02:15,600
These are called gradients, and they shape the behavior of noise.

32
00:02:15,600 --> 00:02:21,200
For each pixel in the image, we consider the four corners surrounding it and calculate the degree to which

33
00:02:21,200 --> 00:02:26,320
that pixel is affected by each gradient.  From each corner, we do this by calculating

34
00:02:26,320 --> 00:02:32,745
the displacement, a vector from the pixel to the corner, and taking the product of its dot count and the slope.

35
00:02:32,745 --> 00:02:37,760
This is a simple calculation that tells us how two vectors are aligned.  If they are pointing in the

36
00:02:37,760 --> 00:02:44,400
same direction, the result will be close to 1. If they are pointing away from each other, the result will be closer to 0.

37
00:02:44,400 --> 00:02:49,760
This gives us four numbers, each in a corner.  We repeated this process for each

38
00:02:49,760 --> 00:02:55,280
pixel in the image, calculating four partial results.  Then, we combine those numbers through

39
00:02:55,280 --> 00:03:02,080
linear interpolation: an operation used to smooth the transition process.  First horizontally,

40
00:03:02,080 --> 00:03:06,240
then vertically, this eliminates visible seams and creates a

41
00:03:06,240 --> 00:03:10,813
smoother, more continuously evolving organic pattern at higher resolutions.

42
00:03:10,813 --> 00:03:13,016
A pattern can look completely different

43
00:03:13,016 --> 00:03:17,040
if the initial slope is in a different direction.

44
00:03:17,040 --> 00:03:20,729
But we're not limited to just one of these models.

45
00:03:20,729 --> 00:03:24,285
We can create many variations and combine them using a technique

46
00:03:24,285 --> 00:03:27,456
often referred to as fractal noise.

47
00:03:27,456 --> 00:03:32,781
With each new class (or octave), we increase the frequency and decrease the intensity.

48
00:03:32,781 --> 00:03:36,160
Then, we simply add their values, pixel by pixel,

49
00:03:36,160 --> 00:03:40,960
layer by layer of detail, without overwhelming the structure.  The first layer captures

50
00:03:40,960 --> 00:03:47,440
broad strokes and large shapes.  Next, add smaller waves.  After that, the swelling subsided.

51
00:03:47,440 --> 00:03:49,280
That's like erosion on a mountain,

52
00:03:49,280 --> 00:03:54,960
or turbulence in a cloud.  It's still just noise, but it feels like nature.

53
00:03:54,960 --> 00:04:01,120
And the best part?  It's extremely effective.  You can calculate it quickly without needing to store

54
00:04:01,120 --> 00:04:09,680
large textures or pre-generated content.  It's just mathematics.  Simple, elegant, fast… and incredibly useful.

55
00:04:09,680 --> 00:04:13,680
Let's take a closer look at some of its most common use cases in gaming.

56
00:04:13,680 --> 00:04:15,708
First: the terrain.

57
00:04:15,708 --> 00:04:20,444
In the procedural world, you often want to create landscapes algorithmically.

58
00:04:20,444 --> 00:04:25,600
Hills, mountains, valleys… all of these can come from a Perlin Noise map,

59
00:04:25,600 --> 00:04:29,760
where each value defines the elevation at a point in space.

60
00:04:29,760 --> 00:04:34,880
Perlin Noise can also determine the structure of a world, not only the elevation of the land

61
00:04:34,880 --> 00:04:40,874
but also the layout of the entire area.  Where one area ends and another begins.

62
00:04:40,874 --> 00:04:42,497
Where the cave twists.

63
00:04:42,497 --> 00:04:47,840
Instead of building these structures by hand, let the noise create your space.

64
00:04:47,840 --> 00:04:54,800
Next: Distribution. Instead of placing everything randomly, you can use Perlin Noise as a density map.

65
00:04:54,800 --> 00:05:00,800
Think about trees, loot, or enemies: high-value areas receive more content, while others

66
00:05:00,800 --> 00:05:06,640
are sparsely populated.  The result is naturally-looking clusters that feel like real ecosystems:

67
00:05:06,640 --> 00:05:11,920
dense forests, scattered resources, or dangerous areas teeming with predators.

68
00:05:11,920 --> 00:05:17,200
Next comes the structure.  Perlin Noise is a versatile visual tool,

69
00:05:17,200 --> 00:05:22,240
often used to create effects such as smoke, magical energy, or fire.

70
00:05:22,240 --> 00:05:28,160
For example, it can adjust the color and transparency to make everything feel more natural.

71
00:05:28,160 --> 00:05:35,120
It can also control animation, both in terms of texture and larger scenes, such as blades of grass swaying in the wind or

72
00:05:35,120 --> 00:05:41,680
gentle ripples on the waves.  As a result, the movement doesn't feel repetitive but is always in motion.

73
00:05:41,680 --> 00:05:47,520
And the same idea can be applied to sound.  Perlin noise can subtly alter things like pitch

74
00:05:47,520 --> 00:05:54,960
or volume.  Particularly useful in environments with frequently repeated sounds, such as footsteps or wind.

75
00:05:54,960 --> 00:05:58,519
Anything that needs to feel lifelike can use Perlin Noise.

76
00:05:58,519 --> 00:06:04,400
It's a building block.  A seed.  A rhythm.  No matter how much you need it.

77
00:06:04,400 --> 00:06:08,849
Nowhere is this more evident than in Minecraft.  That game uses Perlin Noise

78
00:06:08,849 --> 00:06:14,000
for everything, but the way it creates biomes is particularly clever.

79
00:06:14,000 --> 00:06:17,680
Instead of assigning them randomly, it first generates a set of

80
00:06:17,680 --> 00:06:25,680
environmental characteristics using distinct noise maps.  Temperature, humidity, erosion, altitude… and a few other factors.

81
00:06:25,680 --> 00:06:32,005
Then, it combines those characteristics using a set of rules to determine which communities are relevant at each location.

82
00:06:32,005 --> 00:06:35,967
High temperature and low humidity?  Perhaps it was a desert.

83
00:06:35,967 --> 00:06:40,460
High altitude, humid, and hot?  It could be a forest in the mountains.

84
00:06:40,460 --> 00:06:44,184
Low elevation and high erosion?  This is a beach.

85
00:06:44,184 --> 00:06:47,920
This way, you won't have snow-capped peaks right next to volcanoes.

86
00:06:47,920 --> 00:06:52,091
You get transition effects and gradients that look just like in the real world.

87
00:06:52,091 --> 00:06:57,760
And it's not just about aesthetics.  The ecosystem influences gameplay: what mobs spawn,

88
00:06:57,760 --> 00:07:02,720
what resources appear, and what the weather is like.  It was a procedural generation,

89
00:07:02,720 --> 00:07:08,720
but it was meaningful.  A world with meaning, even though no one designed it by hand.

90
00:07:08,720 --> 00:07:14,174
So… is Perlin Noise really the most important algorithm in video game history?

91
00:07:14,174 --> 00:07:19,280
That's a big statement.  But starting in the mid-1990s and especially throughout the 2000s,

92
00:07:19,280 --> 00:07:23,760
it gained attention and quietly became a standard tool across the industry.

93
00:07:23,760 --> 00:07:26,880
To better understand its impact,

94
00:07:26,880 --> 00:07:32,720
I analyzed a range of games from three categories: the 50 best-selling games of all time,

95
00:07:32,720 --> 00:07:36,947
Game of the Year winners, and titles consistently considered the best games ever

96
00:07:36,947 --> 00:07:42,960
created, based on cross-referenced critical ratings.  All together, nearly 400 titles.

97
00:07:42,960 --> 00:07:47,680
For each game, I analyzed whether it used Perlin Noise or some closely related technique

98
00:07:47,680 --> 00:07:53,360
in any of its most common applications.  Each instance is scored using three levels of certainty:

99
00:07:53,360 --> 00:07:59,280
not used, possibly or indirectly used, and explicitly or documented used.

100
00:07:59,280 --> 00:08:04,880
The results are quite impressive.  Among the top 50 best-selling products, 84% clearly

101
00:08:04,880 --> 00:08:11,520
or very likely use Perlin Noise or its derivatives.  The remaining 16% consists mostly of older games, some

102
00:08:11,520 --> 00:08:16,800
released even before algorithms were invented.  In the list of Games of the Year, every game

103
00:08:16,800 --> 00:08:20,960
utilizes it in at least one common form, often in terms of visuals and effects,

104
00:08:20,960 --> 00:08:26,560
as well as for animation and process content.  And in the list of the greatest games of all time, which

105
00:08:26,560 --> 00:08:32,080
spans several decades, the algorithms become increasingly prominent as time goes on.

106
00:08:32,080 --> 00:08:37,120
Ultimately, many bestselling books not only use it, but use it frequently

107
00:08:37,120 --> 00:08:42,240
and in more sophisticated ways.  In many regions, they are layered with other systems.

108
00:08:42,240 --> 00:08:47,360
Perlin Noise has quietly become one of the most widely used algorithms in game development.

109
00:08:47,360 --> 00:08:53,360
It shapes how the game looks, sounds, and feels.  And that's the backbone of procedural creation,

110
00:08:53,360 --> 00:08:56,320
a technique that defines modern game design.

111
00:08:56,320 --> 00:09:00,320
If you want proof of its impact, just look at the best-selling and arguably

112
00:09:00,320 --> 00:09:03,296
most influential game of the last few decades.

113
00:09:03,296 --> 00:09:06,302
Would Minecraft exist without Perlin Noise?  Maybe

114
00:09:06,302 --> 00:09:07,652
.

115
00:09:07,652 --> 00:09:10,256
But it certainly won't feel that way.

116
00:09:10,256 --> 00:09:14,074
Some of the most powerful tools in the game are tools you've never seen before.

117
00:09:14,074 --> 00:09:19,215
Perlin noise doesn't draw attention to itself.  But it's always there, beneath the surface.

118
00:09:19,215 --> 00:09:23,635
It's not just about mathematics.  It's a way to build complexity from simplicity.

119
00:09:23,635 --> 00:09:27,681
To create the illusion of infinity, in a world contained within a hard drive.

120
00:09:27,681 --> 00:09:30,459
Perlin noise isn't the reason we play games.

121
00:09:30,459 --> 00:09:34,102
But perhaps that's why they enjoy the game.

122
00:09:35,662 --> 00:09:36,671
See you next time.

