1
00:00:03,360 --> 00:00:06,880
There's a simple mathematical function from the 80s that quietly shaped some of the most iconic games of the last few decades.

2
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, and why

3
00:00:12,160 --> 00:00:15,520
I believe it could be the most important algorithm in video game history.

4
00:00:15,520 --> 00:00:19,440
And I hope I can provide you with enough evidence to see if you agree with me.  It

5
00:00:19,440 --> 00:00:24,640
all begins with a film in 1982 that changed the history of computer graphics.  Ken Perlin was

6
00:00:29,120 --> 00:00:35,120
part of the visual effects team for Tron, the first Hollywood film built almost entirely with computer-generated imagery.  It was groundbreaking.  But according to him,

7
00:00:35,120 --> 00:00:39,440
this wasn't good enough: "Everything looked like a machine," he later said.  The

8
00:00:39,440 --> 00:00:44,000
problem was the fabric.  When they tried to simulate things like fire or smoke,

9
00:00:44,000 --> 00:00:47,071
the results looked flat and artificial.  The tools used to create detail relied on white noise, which

10
00:00:47,071 --> 00:00:50,520
produced results that felt more static than natural

11
00:00:50,520 --> 00:00:54,194
.  Perlin wanted something better.  Something that feels

12
00:00:54,194 --> 00:00:56,037
smooth and organic, but can be created quickly

13
00:00:56,037 --> 00:00:59,720
without any hand craftsmanship or extensive calculations

14
00:01:02,160 --> 00:01:08,400
.  The solution was Perlin Noise, and in 1997, it won the Academy Award for Technical Achievement, an award presented alongside the Oscars at a ceremony that would later also celebrate the creators of Photoshop.

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

16
00:01:18,417 --> 00:01:20,880
Essentially, it's just a function.

17
00:01:20,880 --> 00:01:25,200
You give it one or more numbers as input (a position in space), and it

18
00:01:25,200 --> 00:01:31,360
gives you another number in return.  Technically, the output ranges from -1 to 1, but in most visual applications

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

20
00:01:37,920 --> 00:01:43,600
But here's the key point: nearby inputs produce similar outputs.

21
00:01:43,600 --> 00:01:48,880
We will later see that this is precisely what makes it so useful in video games:

22
00:01:48,880 --> 00:01:55,680
it creates models that have the perfect balance between order and chaos.  Unpredictable, but smooth.  Random but structured.  Let's take

23
00:01:55,680 --> 00:02:00,720
a look at how it works.  And don't worry, it's actually surprisingly simple.

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

25
00:02:05,600 --> 00:02:11,328
We assign a unit vector, pointing in a random direction, to each corner of this grid.

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

27
00:02:15,600 --> 00:02:21,200
For each pixel in the image, we look at the four corners surrounding it and

28
00:02:21,200 --> 00:02:26,320
calculate how much that pixel is affected by each gradient.

29
00:02:26,320 --> 00:02:32,745
We do this by calculating the pixel-to-pixel vector displacement from each corner and then multiplying the gradient by the dots.

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

31
00:02:37,760 --> 00:02:44,400
the result approaches 1; if they are moving far apart, the result approaches 0.

32
00:02:44,400 --> 00:02:49,760
This gives us four numbers, one from each corner.  We repeat this process for each pixel in the image, calculating four partial results

33
00:02:49,760 --> 00:02:55,280
.  We then combine these numbers using linear interpolation

34
00:02:55,280 --> 00:03:02,080
: a mathematical operation used to smooth the transitions.  First horizontally,

35
00:03:02,080 --> 00:03:06,240
then vertically, it eliminates visible seams and

36
00:03:06,240 --> 00:03:10,813
produces a smoother, more continuous organic variety pattern at higher resolutions.  The pattern would look completely different

37
00:03:10,813 --> 00:03:13,016
if the initial slopes had pointed in other directions

38
00:03:13,016 --> 00:03:17,040
.

39
00:03:17,040 --> 00:03:20,729
However, we are not limited to just one of these patterns.

40
00:03:20,729 --> 00:03:24,285
We can generate multiple variations and

41
00:03:24,285 --> 00:03:27,456
combine them using a technique often referred to as fractal noise.  With

42
00:03:27,456 --> 00:03:32,781
each new layer (or octave), we increase the frequency and decrease the power.  Next

43
00:03:32,781 --> 00:03:36,160
,

44
00:03:36,160 --> 00:03:40,960
we simply add pixel-by-pixel values, layering the details without overwhelming the structure.  The first layer

45
00:03:40,960 --> 00:03:47,440
captures broad contours and large shapes.  The next one adds smaller waves.  Then finer bumps.

46
00:03:47,440 --> 00:03:49,280
Mountain erosion

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

48
00:03:54,960 --> 00:04:01,120
And the best part?  Incredibly efficient.

49
00:04:01,120 --> 00:04:09,680
You can calculate this instantly without needing to store large textures or pre-crafted assets.  Just mathematics.  Simple, elegant, fast… and infinitely useful.

50
00:04:09,680 --> 00:04:13,680
Let's look at some of the most common use cases in games.

51
00:04:13,680 --> 00:04:15,708
First: land.

52
00:04:15,708 --> 00:04:20,444
In procedural worlds, you often want to generate landscapes algorithmically.

53
00:04:20,444 --> 00:04:25,600
Hills, mountains, valleys… all of these can come from the Perlin Noise Map,

54
00:04:25,600 --> 00:04:29,760
where each value defines the height of a point in space.

55
00:04:29,760 --> 00:04:34,880
Perlin Noise can also describe how a world is structured;  It can define not only the elevation of the land but

56
00:04:34,880 --> 00:04:40,874
also the layout of entire areas.  The place where one area ends and another begins.

57
00:04:40,874 --> 00:04:42,497
The place where the caves curve.

58
00:04:42,497 --> 00:04:47,840
Instead of building these structures by hand, you're letting the noise open up the space for you.

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

60
00:04:54,800 --> 00:05:00,800
Consider trees, loot, or enemies: areas of high value receive more content, while others

61
00:05:00,800 --> 00:05:06,640
remain sparse.  The result is natural-looking clusters that resemble real ecosystems:

62
00:05:06,640 --> 00:05:11,920
dense forests, scattered resources, or dangerous zones teeming with enemies.

63
00:05:11,920 --> 00:05:17,200
Then there's the tissue.  Perlin Noise is a tool used for visual variety, often employed to create effects such as smoke, magical energy, or fire

64
00:05:17,200 --> 00:05:22,240
.

65
00:05:22,240 --> 00:05:28,160
For example, you can change the color and transparency of objects to make them look more organic.  It can

66
00:05:28,160 --> 00:05:35,120
also support animation in both textures and larger scenes, such as grass swaying in the wind or

67
00:05:35,120 --> 00:05:41,680
gently rolling waves.  The result is a constantly changing movement that doesn't feel cyclical.  The

68
00:05:41,680 --> 00:05:47,520
same idea can be applied to sound.  Perlin Noise

69
00:05:47,520 --> 00:05:54,960
can subtly alter things like pitch or volume.  It is particularly useful for frequently repeated environmental factors such as footsteps or wind.

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

71
00:05:58,519 --> 00:06:04,400
This is a building block.  A seed.  A rhythm.  Get whatever you need.

72
00:06:04,400 --> 00:06:08,849
This is nowhere more evident than in Minecraft.  This game uses Perlin Noise for everything

73
00:06:08,849 --> 00:06:14,000
, but the way it generates the biomes is particularly clever.

74
00:06:14,000 --> 00:06:17,680
Instead of assigning these randomly, it first

75
00:06:17,680 --> 00:06:25,680
generates a series of environmental features using separate noise maps.  Temperature, humidity, erosion, altitude… and a few others.  It

76
00:06:25,680 --> 00:06:32,005
then combines these features, using a set of rules to decide which biome is meaningful at each location.

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

78
00:06:35,967 --> 00:06:40,460
high altitude, humid and hot?  There might be a forest in the mountains.

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

80
00:06:44,184 --> 00:06:47,920
This way, you won't see snow-capped peaks right next to the volcano.

81
00:06:47,920 --> 00:06:52,091
Just like in the real world, you get transitions and gradients.

82
00:06:52,091 --> 00:06:57,760
And it's not just about aesthetics.  Biomes affect gameplay: which mobs appear,

83
00:06:57,760 --> 00:07:02,720
which resources are available, and what the weather is like.  This is a procedural generation,

84
00:07:02,720 --> 00:07:08,720
but it has meaning.  It's a meaningful world, even though no one designed it by hand.

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

86
00:07:14,174 --> 00:07:19,280
That's a bold claim.  However, it gained popularity from the mid-1990s onwards, and especially throughout the 2000s,

87
00:07:19,280 --> 00:07:23,760
and quietly became a standard vehicle in the industry.

88
00:07:23,760 --> 00:07:26,880
To get a clearer idea of ​​how far its impact goes, I

89
00:07:26,880 --> 00:07:32,720
analyzed a broad group of games across three categories: the 50 best-selling games of all time,

90
00:07:32,720 --> 00:07:36,947
Game of the Year winners, and

91
00:07:36,947 --> 00:07:42,960
games most frequently cited as the best games ever made, according to cross-referenced critical rankings.  All in all, that's around 400 titles.

92
00:07:42,960 --> 00:07:47,680
For each game, I

93
00:07:47,680 --> 00:07:53,360
analyzed whether it used Perlin Noise or a closely related technique in any of the most common implementations.  Each case was scored using three levels of certainty:

94
00:07:53,360 --> 00:07:59,280
no use, possible or implied use, and explicit or documented use.

95
00:07:59,280 --> 00:08:04,880
The results were quite striking.  Of the top 50 best-selling books, 84%

96
00:08:04,880 --> 00:08:11,520
showed explicit or very likely use of Perlin Noise or its derivatives.  Most of the remaining 16% were older headlines;  Some of them

97
00:08:11,520 --> 00:08:16,800
were published before the algorithm was invented.  In the Game of the Year list, every game

98
00:08:16,800 --> 00:08:20,960
used it in at least one common way;  Primarily for visuals and effects, but

99
00:08:20,960 --> 00:08:26,560
also for animation and procedural content.  And in lists of the best games of all time, spanning decades,

100
00:08:26,560 --> 00:08:32,080
the further back in time you go, the more the algorithm reveals itself.

101
00:08:32,080 --> 00:08:37,120
Finally, many best-selling books not only use this, but

102
00:08:37,120 --> 00:08:42,240
they also use it frequently and in more complex ways.  It operates in multiple domains and is layered with other systems.

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

104
00:08:47,360 --> 00:08:53,360
It shapes the look, sound, and feel of games.  And this is the backbone of procedural generation,

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

106
00:08:56,320 --> 00:09:00,320
.  If you want proof of its impact,

107
00:09:00,320 --> 00:09:03,296
look at the best-selling and arguably most influential game of the last few decades.

108
00:09:03,296 --> 00:09:06,302
Could Minecraft exist without Perlin Noise?

109
00:09:06,302 --> 00:09:07,652
Maybe.

110
00:09:07,652 --> 00:09:10,256
But it definitely wouldn't feel the same.

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

112
00:09:14,074 --> 00:09:19,215
Perlin noise is inconspicuous.  But it's always there, beneath the surface.  It's

113
00:09:19,215 --> 00:09:23,635
not just mathematics.  It's a way of creating complexity from simplicity.

114
00:09:23,635 --> 00:09:27,681
To create the illusion of infinity in a world that fits on a hard drive.

115
00:09:27,681 --> 00:09:30,459
Perlin Noise is not the reason we play games.

116
00:09:30,459 --> 00:09:34,102
But perhaps that's why they feel like a game.

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

