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

2
00:00:06,880 --> 00:00:12,160
.  Today, I would like to tell you the backstory of why this algorithm was invented, why it works so well, and why it could become the

3
00:00:12,160 --> 00:00:15,520
most important algorithm in video game history

4
00:00:15,520 --> 00:00:19,440
.  And I hope you provide sufficient evidence to confirm whether you agree.  It

5
00:00:19,440 --> 00:00:24,640
all starts with the 1982 movie that changed the history of computer graphics.

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

7
00:00:29,120 --> 00:00:35,120
was part of the visual effects team for Tron, the first Hollywood movie made almost entirely with computer-generated images.  It was groundbreaking.  However, that alone was

8
00:00:35,120 --> 00:00:39,440
not enough for him.  He later said, "Everything looked like a machine."

9
00:00:39,440 --> 00:00:44,000
The problem was the texture.  When I tried to simulate things like fire or smoke, the

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

11
00:00:47,071 --> 00:00:50,520
detail generation tool relied on white noise to produce

12
00:00:50,520 --> 00:00:54,194
results that felt more static than natural.

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

14
00:00:56,037 --> 00:00:59,720
gives a smooth and organic feel, but can be

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

16
00:01:02,160 --> 00:01:08,400
His solution became Perlin Noise, and in 1997, he

17
00:01:10,800 --> 00:01:15,200
received the Academy Award for Technical Achievement, an accolade later awarded alongside the Oscar at an awards ceremony honoring the creators of Photoshop

18
00:01:15,200 --> 00:01:18,417
.  then…  What exactly is Perlin Noise?

19
00:01:18,417 --> 00:01:20,880
The key is just the function.  If you

20
00:01:20,880 --> 00:01:25,200
provide one or more numbers as input (positions in space), other numbers are returned

21
00:01:25,200 --> 00:01:31,360
.  Technically, the output ranges from -1 to 1, but in most visual applications, it

22
00:01:31,360 --> 00:01:37,920
is adjusted to a range between 0 and 1 (black to white, including shades of gray in between).

23
00:01:37,920 --> 00:01:43,600
But here is the trick.  Nearby inputs produce similar outputs.  Later, we will see that this is exactly why it is so useful in video games

24
00:01:43,600 --> 00:01:48,880
.  In other words, it generates a pattern with an appropriate balance of order and chaos

25
00:01:48,880 --> 00:01:55,680
.  It is unpredictable but smooth.  It is random but structured.  Let's take a

26
00:01:55,680 --> 00:02:00,720
look at how it works.  And don't worry.  In reality, it is surprisingly simple.

27
00:02:00,720 --> 00:02:05,600
To generate Perlin Noise, start by dividing the space into a regular grid.

28
00:02:05,600 --> 00:02:11,328
Assign a unit vector pointing in an arbitrary direction to each corner of the grid.

29
00:02:11,328 --> 00:02:15,600
This is called a gradient and forms the behavior of the noise.

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

31
00:02:21,200 --> 00:02:26,320
calculate the extent to which that pixel is affected by each gradient.

32
00:02:26,320 --> 00:02:32,745
This is done by calculating the displacement, which is the vector from pixel to corner at each corner, and taking the inner product with the gradient.

33
00:02:32,745 --> 00:02:37,760
This is a simple task that tells you how aligned the two vectors are.  If you point in a similar direction, the

34
00:02:37,760 --> 00:02:44,400
result is closer to 1.  As they move further apart, they get closer to 0.

35
00:02:44,400 --> 00:02:49,760
This way, four numbers are provided, one from each corner.  Repeat this process for every pixel of the image to

36
00:02:49,760 --> 00:02:55,280
calculate the 4 partial results.  Then, the numbers are combined through linear interpolation, a mathematical operation used for smooth transitions

37
00:02:55,280 --> 00:03:02,080
.  First horizontally,

38
00:03:02,080 --> 00:03:06,240
then vertically, visible seams are removed

39
00:03:06,240 --> 00:03:10,813
to create a continuous pattern of organic change, becoming smoother at higher resolutions.  It is a pattern that would have looked completely different

40
00:03:10,813 --> 00:03:13,016
if the initial slope had pointed in a different direction

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

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

43
00:03:20,729 --> 00:03:24,285
We can generate various variations and

44
00:03:24,285 --> 00:03:27,456
combine them using a technique commonly known as fractal noise

45
00:03:27,456 --> 00:03:32,781
.  Use each new layer (or octave) to increase the frequency and decrease the intensity.

46
00:03:32,781 --> 00:03:36,160
Then, you

47
00:03:36,160 --> 00:03:40,960
just need to add values ​​pixel by pixel and layer details without overwhelming the structure.  The first layer

48
00:03:40,960 --> 00:03:47,440
captures wide strokes and large shapes.  Next, add a smaller wave.  Then, finer bumps occur.

49
00:03:47,440 --> 00:03:49,280
This is how mountain erosion

50
00:03:49,280 --> 00:03:54,960
or cloud turbulence occurs.  It is just noise for now, but it feels like nature.

51
00:03:54,960 --> 00:04:01,120
And what's the best part?  It is incredibly efficient.  You

52
00:04:01,120 --> 00:04:09,680
can calculate instantly without needing to save large textures or pre-made assets.  Just math.  Simple, elegant, fast... and endlessly useful.  Let's

53
00:04:09,680 --> 00:04:13,680
take a look at some of the most common use cases in games.

54
00:04:13,680 --> 00:04:15,708
First: Terrain.

55
00:04:15,708 --> 00:04:20,444
In the procedural world, there are often attempts to generate landscapes algorithmically.

56
00:04:20,444 --> 00:04:25,600
Hills, mountains, valleys... all of these can appear on the Perlin Noise map.

57
00:04:25,600 --> 00:04:29,760
Here, each value defines the elevation of a point in space.

58
00:04:29,760 --> 00:04:34,880
Perlin Noise

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

60
00:04:40,874 --> 00:04:42,497
twisted cave.

61
00:04:42,497 --> 00:04:47,840
Instead of building these structures by hand, let the noise carve out the space.

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

63
00:04:54,800 --> 00:05:00,800
Think about trees, loot, and enemies.  Areas with high values ​​gain more content, while other areas

64
00:05:00,800 --> 00:05:06,640
maintain it sparingly.  As a result, natural clusters were created that felt like a real ecosystem, including dense forests, scattered resources, and dangerous areas teeming with enemies

65
00:05:06,640 --> 00:05:11,920
.  Next, there is texture.

66
00:05:11,920 --> 00:05:17,200
Perlin Noise is a useful tool for visual variety that is often used to generate effects such as smoke, magical energy, or fire

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

68
00:05:22,240 --> 00:05:28,160
For example, you can make objects feel more organic by adjusting color and transparency.  You can

69
00:05:28,160 --> 00:05:35,120
also drive animations on both textures, such as grass swaying in the wind or

70
00:05:35,120 --> 00:05:41,680
gently rolling waves, and on larger scenes.  As a result, motion that is always changing is generated without feeling repetitive.

71
00:05:41,680 --> 00:05:47,520
And the same idea can be applied to sound as well.  Perlin Noise

72
00:05:47,520 --> 00:05:54,960
can subtly alter elements such as pitch or volume.  It is particularly useful for surrounding elements that are frequently repeated, such as footprints or wind.  You

73
00:05:54,960 --> 00:05:58,519
can use Perlin Noise for everything that needs to feel alive.  It

74
00:05:58,519 --> 00:06:04,400
is a building block.  Seed.  Rhythm.  Whatever you need.

75
00:06:04,400 --> 00:06:08,849
There is no place where this is more obvious than in Minecraft.  This game uses Perlin Noise for everything,

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

77
00:06:14,000 --> 00:06:17,680
Instead of assigning randomly, first

78
00:06:17,680 --> 00:06:25,680
generate a set of environment attributes using a separate noise map.  Temperature, humidity, erosion, altitude…  And a few others.

79
00:06:25,680 --> 00:06:32,005
Then, a series of rules are used to combine those attributes to determine which biome is suitable for each location.  Is

80
00:06:32,005 --> 00:06:35,967
the temperature high and the humidity low?  It might be a desert.

81
00:06:35,967 --> 00:06:40,460
Is it high altitude, humid, and hot?  It could be a jungle in the mountains.

82
00:06:40,460 --> 00:06:44,184
Is the elevation low and erosion high?  This is a beach.  If you do

83
00:06:44,184 --> 00:06:47,920
this, a snow-covered peak will not form right next to the volcano.  Just

84
00:06:47,920 --> 00:06:52,091
like in the real world, you can obtain transitions and gradients.

85
00:06:52,091 --> 00:06:57,760
And it is not just aesthetic.  Biomes affect gameplay.  There are targets where mobs spawn,

86
00:06:57,760 --> 00:07:02,720
resources that appear, weather, etc.  It is a procedural generation, but it is

87
00:07:02,720 --> 00:07:08,720
meaningful.  A world that has meaning despite not being designed by hand.

88
00:07:08,720 --> 00:07:14,174
then…  Is Perlin Noise really the most important algorithm in video game history?

89
00:07:14,174 --> 00:07:19,280
That is a big claim.  However, from the mid-1990s, and especially throughout the first half of the 2000s, it

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

91
00:07:23,760 --> 00:07:26,880
To understand more clearly how far its influence extends,

92
00:07:26,880 --> 00:07:32,720
I analyzed a wide range of game sets across three categories.  It is the title most frequently cited as the greatest game of all time based on the 50 bestsellers of all time,

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

94
00:07:36,947 --> 00:07:42,960
cross-referenced critical rankings.  All together, there are nearly 400 titles.

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

96
00:07:47,680 --> 00:07:53,360
analyzed whether Perlin Noise or closely related techniques were used in the most common applications

97
00:07:53,360 --> 00:07:59,280
.  Each case was scored using three levels of certainty: not in use, possible or indirect use, and clear or documented use

98
00:07:59,280 --> 00:08:04,880
.  The results were quite impressive.  It was found that 84% of the top 50 bestsellers

99
00:08:04,880 --> 00:08:11,520
clearly or very likely used Perlin Noise or its derivatives.  The remaining 16% were mostly old titles, and some

100
00:08:11,520 --> 00:08:16,800
were released before the algorithm was invented.  Every single game on this year's game list

101
00:08:16,800 --> 00:08:20,960
used this in at least one common format; while mostly used for visuals and effects, it

102
00:08:20,960 --> 00:08:26,560
was also used for animation and procedural content.  And over the decades,

103
00:08:26,560 --> 00:08:32,080
algorithms appear more and more over time in lists of the greatest games of all time.

104
00:08:32,080 --> 00:08:37,120
Finally, many of the best-selling titles do not simply use this, but

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

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

107
00:08:47,360 --> 00:08:53,360
Determines the look, sound, and feel of the game.  And this is the backbone of procedural generation, the technology that defines modern game design

108
00:08:56,320 --> 00:09:00,320
.  If you want evidence of that influence,

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

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

111
00:09:06,302 --> 00:09:07,652
maybe.

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

113
00:09:10,256 --> 00:09:14,074
Some of the most powerful tools in the game are tools that you can never see.

114
00:09:14,074 --> 00:09:19,215
Perlin Noise does not attract attention on its own.  But it is always beneath the surface.  It

115
00:09:19,215 --> 00:09:23,635
is not just mathematics.  This is a way to build complexity from simplicity.

116
00:09:23,635 --> 00:09:27,681
Creates infinite fantasies in a world that fits perfectly on a hard drive.

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

118
00:09:30,459 --> 00:09:34,102
However, perhaps that is the reason it feels like a game.

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

