1
00:00:03,360 --> 00:00:06,880
simple mathematical functions from the 80s that have quietly shaped some of the most iconic games of the past few decades.

2
00:00:06,880 --> 00:00:12,160
Today, I'd like to talk about the story behind it, why it was invented, why it works so well,

3
00:00:12,160 --> 00:00:15,520
and why I believe it might be the most important algorithm in the history of video games

4
00:00:15,520 --> 00:00:19,440
.  And if possible, please provide sufficient evidence to confirm whether you agree or not.  It

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

6
00:00:24,640 --> 00:00:29,120
Ken Perlin was

7
00:00:29,120 --> 00:00:35,120
part of the visual effects team for Tron, the first Hollywood film to be built almost entirely with computer-generated images.  That was groundbreaking.  However, that wasn't enough for him

8
00:00:35,120 --> 00:00:39,440
.  "Everything seemed like a machine," he later said.

9
00:00:39,440 --> 00:00:44,000
The problem was the texture.  When we tried to simulate fire and smoke, the

10
00:00:44,000 --> 00:00:47,071
results looked flat and artificial.  The

11
00:00:47,071 --> 00:00:50,520
tools used to generate detail relied on white noise, resulting in a

12
00:00:50,520 --> 00:00:54,194
static rather than natural look.

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

14
00:00:56,037 --> 00:00:59,720
feels smooth and organic, yet it can be generated instantly without requiring handcrafting or heavy calculations

15
00:00:59,720 --> 00:01:02,160
.

16
00:01:02,160 --> 00:01:08,400
His solution became Perlin Noise, and he received the Academy Technical Achievement Award in 1997.

17
00:01:08,400 --> 00:01:10,800
This award was presented alongside the Oscars at an awards ceremony that would later honor the creators of Photoshop

18
00:01:10,800 --> 00:01:15,200
.

19
00:01:15,200 --> 00:01:18,417
So... what exactly is Perlin noise?

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

21
00:01:20,880 --> 00:01:25,200
provide one or more numbers as input (locations in space), it will

22
00:01:25,200 --> 00:01:31,360
return a different number.  Technically, the output varies from -1 to 1, but most visual applications

23
00:01:31,360 --> 00:01:37,920
scale it to a range from 0 to 1 (black to white, with gray tones in between).

24
00:01:37,920 --> 00:01:43,600
However, there's a trick to it.  Nearby inputs produce similar outputs.  You'll later see why this is so useful in video games

25
00:01:43,600 --> 00:01:48,880
.  It creates patterns that have the right balance between order and chaos

26
00:01:48,880 --> 00:01:55,680
.  It's unpredictable, but smooth.  It's random, but structured.  Let's take a look at how it

27
00:01:55,680 --> 00:02:00,720
works.  Don't worry.  It's actually surprisingly simple.

28
00:02:00,720 --> 00:02:05,600
To generate Perlin noise, the space is first divided into a regular grid.

29
00:02:05,600 --> 00:02:11,328
Assign a unit vector pointing in a random direction to each corner of that grid.

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

31
00:02:15,600 --> 00:02:21,200
For every pixel in the image, we examine the four corners surrounding it and

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

33
00:02:26,320 --> 00:02:32,745
This is done by calculating the displacement, which is a vector from the pixel to the corner, and then calculating the dot product of this displacement and its gradient.

34
00:02:32,745 --> 00:02:37,760
This is a simple operation that shows how closely two vectors are aligned.  If they are all pointing in the same direction

35
00:02:37,760 --> 00:02:44,400
, the result will approach 1.  If they are far apart from each other, the result will approach 0.

36
00:02:44,400 --> 00:02:49,760
This gives us one number from each corner, for a total of four numbers.  We

37
00:02:49,760 --> 00:02:55,280
repeat this process for every pixel in the image, calculating four partial results.  Next, we combine those numbers

38
00:02:55,280 --> 00:03:02,080
using linear interpolation (a mathematical operation used to smooth transitions).  First horizontally,

39
00:03:02,080 --> 00:03:06,240
then vertically, the process eliminates visible seams, generating a continuous pattern of organic change

40
00:03:06,240 --> 00:03:10,813
, which becomes smoother as the resolution increases.

41
00:03:10,813 --> 00:03:13,016
If the initial gradient had been pointing in a different direction, it would have resulted

42
00:03:13,016 --> 00:03:17,040
in a completely different pattern.

43
00:03:17,040 --> 00:03:20,729
However, it is not limited to just one of these patterns.  A technique

44
00:03:20,729 --> 00:03:24,285
commonly known as fractal noise

45
00:03:24,285 --> 00:03:27,456
can be used to generate multiple variations and combine them

46
00:03:27,456 --> 00:03:32,781
.  Each time a new layer (or octave) is added, the frequency increases and the intensity decreases.

47
00:03:32,781 --> 00:03:36,160
Next, we add that value to each pixel,

48
00:03:36,160 --> 00:03:40,960
layering the details without overwhelming the structure.  The first layer

49
00:03:40,960 --> 00:03:47,440
captures broad strokes and large shapes.  Next, we'll add some small waves.  Next, fine bumps and irregularities.

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

51
00:03:49,280 --> 00:03:54,960
and cloud turbulence occur in this way.  It's still just noise, but it feels natural.

52
00:03:54,960 --> 00:04:01,120
And what's the best part?  It's incredibly efficient.  You don't need to save large textures or pre-created assets;

53
00:04:01,120 --> 00:04:09,680
calculations can be done on the fly.  It's just mathematics.  Simple, elegant, fast, and infinitely convenient.  Let's

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

55
00:04:13,680 --> 00:04:15,708
terrain.

56
00:04:15,708 --> 00:04:20,444
In the procedural world, we often want to generate landscapes algorithmically.

57
00:04:20,444 --> 00:04:25,600
Hills, mountains, valleys...they are all derived from Perlin noise maps.

58
00:04:25,600 --> 00:04:29,760
Here, each value defines the altitude at a point in space.

59
00:04:29,760 --> 00:04:34,880
Perlin noise

60
00:04:34,880 --> 00:04:40,874
can also define how the world is structured, including not only the elevation of the land but also the overall layout of the region.  The place where one area ends and another begins.  A

61
00:04:40,874 --> 00:04:42,497
place where the cave winds and twists.

62
00:04:42,497 --> 00:04:47,840
Instead of manually constructing these structures, we let noise carve out the space for us.

63
00:04:47,840 --> 00:04:54,800
Next is distribution.  Instead of randomly placing objects, you can use Perlin noise as a density map.  Let's

64
00:04:54,800 --> 00:05:00,800
consider trees, loot, and enemies.  Areas with higher values ​​contain more content, while other areas remain

65
00:05:00,800 --> 00:05:06,640
sparse.  As a result, you get clusters with a natural appearance that feels like a real ecosystem, with dense jungles, scattered resources, and dangerous areas where enemies roam

66
00:05:06,640 --> 00:05:11,920
.

67
00:05:11,920 --> 00:05:17,200
Next is the texture.  Perlin Noise is a reliable tool for achieving visual diversity and is

68
00:05:17,200 --> 00:05:22,240
often used to generate effects such as smoke, magical energy, and fire.

69
00:05:22,240 --> 00:05:28,160
For example, you can adjust the color and transparency to make things feel more organic.

70
00:05:28,160 --> 00:05:35,120
Additionally, you

71
00:05:35,120 --> 00:05:41,680
can drive animations in both textures and larger scenes, such as grass swaying in the wind or gently lapping waves.  As a result, you get a constantly shifting motion that doesn't feel like a loop.

72
00:05:41,680 --> 00:05:47,520
And the same way of thinking applies to sound as well.  Perlin noise

73
00:05:47,520 --> 00:05:54,960
can subtly alter pitch, volume, and other characteristics.  It's especially useful for ambient elements that are frequently repeated, such as footsteps or wind.  You

74
00:05:54,960 --> 00:05:58,519
can use Perlin noise for anything that needs to feel alive.

75
00:05:58,519 --> 00:06:04,400
Those are building blocks.  It's a seed.  It's rhythm.  Whatever you need.  There is no

76
00:06:04,400 --> 00:06:08,849
place where this is more obvious than in Minecraft.  Perlin Noise is used throughout this game,

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

78
00:06:14,000 --> 00:06:17,680
Instead of assigning them randomly, we first

79
00:06:17,680 --> 00:06:25,680
create a set of environment properties using separate noise maps.  Temperature, humidity, erosion, elevation...and several others.

80
00:06:25,680 --> 00:06:32,005
Next, we combine these properties using a set of rules to determine which biota makes sense at each location.  Is it

81
00:06:32,005 --> 00:06:35,967
high temperature and low humidity?  It might be a desert.  Is it hot and humid because of the high

82
00:06:35,967 --> 00:06:40,460
altitude?  It might be a jungle in the mountains.  Is

83
00:06:40,460 --> 00:06:44,184
this a beach because it's at a low elevation and heavily eroded?

84
00:06:44,184 --> 00:06:47,920
This prevents snow-covered mountains from forming right next to volcanoes.  You can

85
00:06:47,920 --> 00:06:52,091
achieve transitions and gradients just like in the real world.

86
00:06:52,091 --> 00:06:57,760
And it's not just about beauty.  Biomes affect gameplay.  In other words, it includes things like which mobs will spawn,

87
00:06:57,760 --> 00:07:02,720
what resources will appear, and what the weather will be like.  This is procedural generation,

88
00:07:02,720 --> 00:07:08,720
but it has meaning.  A world that has meaning, even though no one designed it by hand.

89
00:07:08,720 --> 00:07:14,174
So... is Perlin noise really the most important algorithm in the history of video games?

90
00:07:14,174 --> 00:07:19,280
That's a strong point.  However, from the mid-1990s onward, and especially throughout the 2000s, it

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

92
00:07:23,760 --> 00:07:26,880
To gain a clearer understanding of the extent of its influence,

93
00:07:26,880 --> 00:07:32,720
I analyzed a wide range of game sets across three categories.  In other words, these are the titles most frequently cited as the greatest works of all time, based on the 50 best-selling books of all time,

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

95
00:07:36,947 --> 00:07:42,960
cross-referenced critical rankings.  There are nearly 400 titles in total.

96
00:07:42,960 --> 00:07:47,680
For each game, we

97
00:07:47,680 --> 00:07:53,360
analyzed whether Perlin noise or closely related techniques were used in the most common applications.  Each case was

98
00:07:53,360 --> 00:07:59,280
scored using three certainty levels: no use, possible or indirect use, and clear or documented use

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

100
00:08:04,880 --> 00:08:11,520
were shown to clearly use or very likely use Perlin noise or its derivatives.  The remaining 16% consisted mostly of older titles, some of which were

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

102
00:08:16,800 --> 00:08:20,960
uses it in at least one common form, many of which are used for visuals and effects,

103
00:08:20,960 --> 00:08:26,560
but also for animation and procedural content.  And the further back in time you go in the list of the greatest games of all time over several decades, the more

104
00:08:26,560 --> 00:08:32,080
algorithms you'll find.

105
00:08:32,080 --> 00:08:37,120
Finally, many top-selling titles not just use it, but

106
00:08:37,120 --> 00:08:42,240
use it frequently in a more sophisticated way.  It is layered with other systems across multiple domains.

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

108
00:08:47,360 --> 00:08:53,360
It shapes the look, sound, and feel of the game.  And this is the backbone of procedural generation, a methodology that defines modern game design

109
00:08:56,320 --> 00:09:00,320
.  If you need proof of that influence,

110
00:09:00,320 --> 00:09:03,296
look at the best-selling, and perhaps most influential, games of the past few decades.  Would

111
00:09:03,296 --> 00:09:06,302
Minecraft exist without Perlin noise?

112
00:09:06,302 --> 00:09:07,652
Probably.

113
00:09:07,652 --> 00:09:10,256
However, it certainly won't feel the same.  Some of the

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

115
00:09:14,074 --> 00:09:19,215
Perlin noise itself does not draw attention.  However, it always exists beneath the surface.  It's not just

116
00:09:19,215 --> 00:09:23,635
mathematics.  This is a way of building complexity from simplicity.

117
00:09:23,635 --> 00:09:27,681
Creating infinite fantasies within the world contained on a hard drive.

118
00:09:27,681 --> 00:09:30,459
Perlin noise is not the reason I play games.

119
00:09:30,459 --> 00:09:34,102
However, that might be why it feels like a game.  See you

120
00:09:35,662 --> 00:09:36,671
next time.

