WEBVTT

1
00:00:00.120 --> 00:00:02.919
<v Speaker 1>Welcome back to the deep dive. Hey there, So today

2
00:00:03.480 --> 00:00:07.120
<v Speaker 1>we're opening up the hood on something that I think

3
00:00:07.240 --> 00:00:09.240
<v Speaker 1>keeps a lot of people up at night. Oh yeah,

4
00:00:09.279 --> 00:00:12.640
<v Speaker 1>it's that massive, you know, that intimidating chasm between being

5
00:00:12.679 --> 00:00:17.320
<v Speaker 1>a bedroom coder hacking things together until they mostly work.

6
00:00:17.480 --> 00:00:19.559
<v Speaker 2>Hoping for the best. Yeah, I know that.

7
00:00:19.440 --> 00:00:24.760
<v Speaker 1>Stage, and then the other side being an actual certified

8
00:00:24.920 --> 00:00:26.120
<v Speaker 1>professional developer.

9
00:00:26.239 --> 00:00:28.920
<v Speaker 2>It is a huge leap. I mean, it's the difference

10
00:00:28.920 --> 00:00:32.759
<v Speaker 2>between building a treehouse in your backyard and building a skyscraper.

11
00:00:33.280 --> 00:00:36.200
<v Speaker 2>They both use wood and nails, you know, But if

12
00:00:36.240 --> 00:00:38.320
<v Speaker 2>you build the skyscraper the way you build the treehouse,

13
00:00:38.359 --> 00:00:39.960
<v Speaker 2>it is going to fall down exactly.

14
00:00:40.399 --> 00:00:44.000
<v Speaker 1>And to help us navigate that construction site, we are

15
00:00:44.000 --> 00:00:48.640
<v Speaker 1>looking at the Unity Certified Programmer Exam Guide by Philip Walker.

16
00:00:49.320 --> 00:00:51.560
<v Speaker 1>Now hold on, I know you're thinking a test prep book.

17
00:00:51.679 --> 00:00:53.960
<v Speaker 2>Really I had the same reaction, I'll be honest, right.

18
00:00:54.000 --> 00:00:55.960
<v Speaker 1>I mean, usually these things are just dry lists of

19
00:00:56.079 --> 00:00:58.799
<v Speaker 1>multiple choice questions. But as we dug into this, it

20
00:00:58.799 --> 00:01:02.159
<v Speaker 1>became clear that this isn't really just about passing a test, No,

21
00:01:02.159 --> 00:01:04.719
<v Speaker 1>not at all. It's a manifesto on how to think

22
00:01:04.920 --> 00:01:06.120
<v Speaker 1>like a software engineer.

23
00:01:06.239 --> 00:01:10.280
<v Speaker 2>It is Walker uses this project aside scrolling shooter called

24
00:01:10.359 --> 00:01:14.239
<v Speaker 2>Killer Wave, to basically dismantle all your bad habits and

25
00:01:14.319 --> 00:01:15.640
<v Speaker 2>rebuild them from the ground up.

26
00:01:15.680 --> 00:01:17.319
<v Speaker 1>It's almost like a stealth textbook.

27
00:01:17.439 --> 00:01:20.040
<v Speaker 2>It is. Yes, the explicit goal is to get you

28
00:01:20.079 --> 00:01:23.519
<v Speaker 2>that Unity certification, but the real value is that it

29
00:01:23.560 --> 00:01:26.359
<v Speaker 2>forces you to look at your code and ask, will

30
00:01:26.359 --> 00:01:27.599
<v Speaker 2>this scale right?

31
00:01:27.640 --> 00:01:29.920
<v Speaker 1>Can five other people work on this without wanting to

32
00:01:29.920 --> 00:01:30.480
<v Speaker 1>strangle me?

33
00:01:30.760 --> 00:01:32.359
<v Speaker 2>Exactly? That's the real question.

34
00:01:32.519 --> 00:01:34.879
<v Speaker 1>So that brings us to the why why even bother

35
00:01:34.959 --> 00:01:38.680
<v Speaker 1>with certification? In the creative world, we always hear portfolio

36
00:01:38.719 --> 00:01:41.959
<v Speaker 1>as king just show me the game. If the game's fun,

37
00:01:42.000 --> 00:01:43.280
<v Speaker 1>who cares about the code?

38
00:01:43.319 --> 00:01:46.359
<v Speaker 2>That is the classic argument, and it has some merit.

39
00:01:46.879 --> 00:01:49.159
<v Speaker 2>But Walker makes a really sharp point here, which is,

40
00:01:49.319 --> 00:01:51.439
<v Speaker 2>let's say you've been working at a studio for three years.

41
00:01:51.799 --> 00:01:56.159
<v Speaker 2>You're writing these complex, amazing systems, but you're under a

42
00:01:56.200 --> 00:02:01.480
<v Speaker 2>strict NDA. You can't show that code to a future employer.

43
00:02:02.079 --> 00:02:02.920
<v Speaker 2>It's invisible.

44
00:02:03.359 --> 00:02:06.560
<v Speaker 1>Or or maybe you're a computer science grad. You've got

45
00:02:06.599 --> 00:02:09.840
<v Speaker 1>four years of theory, you know algorithms inside and out,

46
00:02:10.199 --> 00:02:12.960
<v Speaker 1>but you have never actually shipped a title on Steam

47
00:02:13.199 --> 00:02:14.159
<v Speaker 1>or the app store.

48
00:02:14.319 --> 00:02:17.599
<v Speaker 2>Exactly. You have the skills, but you have zero proof.

49
00:02:17.719 --> 00:02:19.319
<v Speaker 1>So that's where certification comes in.

50
00:02:19.520 --> 00:02:22.719
<v Speaker 2>It's a standardized stamp of approval. It tells a hiring

51
00:02:22.759 --> 00:02:26.400
<v Speaker 2>manager I know the Unity API, I understand architecture, and

52
00:02:26.479 --> 00:02:30.439
<v Speaker 2>most importantly, I know how to work in a professional pipeline.

53
00:02:31.000 --> 00:02:34.360
<v Speaker 2>It validates the skills when the work itself is invisible.

54
00:02:34.560 --> 00:02:37.000
<v Speaker 1>So it's basically a badge that says I am not

55
00:02:37.199 --> 00:02:38.039
<v Speaker 1>a liability.

56
00:02:38.199 --> 00:02:41.719
<v Speaker 2>That's a harsh way to put it, but yes, pretty much.

57
00:02:41.800 --> 00:02:43.319
<v Speaker 2>It proves you aren't going to break the build on

58
00:02:43.439 --> 00:02:43.840
<v Speaker 2>day one.

59
00:02:44.000 --> 00:02:46.840
<v Speaker 1>So what does this exam actually cover. Walker breaks it

60
00:02:46.879 --> 00:02:49.120
<v Speaker 1>down into six pillars. We won't bore you by just

61
00:02:49.199 --> 00:02:51.800
<v Speaker 1>reading the syllabus, but I think the roadmap is important

62
00:02:51.840 --> 00:02:56.479
<v Speaker 1>for sure. We're talking core interactions, the art, pipeline, application systems,

63
00:02:56.520 --> 00:03:00.400
<v Speaker 1>scene design optimization, and the big one working in.

64
00:03:00.400 --> 00:03:03.599
<v Speaker 2>Teams, working in teams, And honestly, if you're a self

65
00:03:03.599 --> 00:03:06.759
<v Speaker 2>taught dev, that working in teams part is usually the

66
00:03:06.759 --> 00:03:09.280
<v Speaker 2>blind spot. You can be a wizard at C sharp,

67
00:03:09.599 --> 00:03:12.039
<v Speaker 2>but if you don't understand version control or how to

68
00:03:12.080 --> 00:03:14.919
<v Speaker 2>structure a project for others, you're going to hit a

69
00:03:14.919 --> 00:03:15.919
<v Speaker 2>wall hard.

70
00:03:16.360 --> 00:03:18.080
<v Speaker 1>Well, let's hit that wall together and see if we

71
00:03:18.080 --> 00:03:20.039
<v Speaker 1>can climb it. I want to start with the meat

72
00:03:20.039 --> 00:03:22.719
<v Speaker 1>and potatoes of the book, The Architecture of Code. Okay,

73
00:03:23.000 --> 00:03:25.879
<v Speaker 1>Walker spends a huge chunk of time on design.

74
00:03:25.599 --> 00:03:28.080
<v Speaker 2>Patterns, rightfully, so this is the foundation.

75
00:03:28.280 --> 00:03:31.840
<v Speaker 1>So for the person listening who just opens Unity, creates

76
00:03:31.840 --> 00:03:35.719
<v Speaker 1>a script called player controller, and then types everything into void. Update.

77
00:03:35.800 --> 00:03:36.599
<v Speaker 2>We've all been there.

78
00:03:36.719 --> 00:03:39.560
<v Speaker 1>Let's back up. What exactly is a design pattern?

79
00:03:39.719 --> 00:03:42.639
<v Speaker 2>Think of design patterns as the common language of engineering.

80
00:03:43.240 --> 00:03:44.840
<v Speaker 2>If you and I are building a house and I

81
00:03:44.840 --> 00:03:47.840
<v Speaker 2>say we need a Victorian roof, you instantly have a

82
00:03:47.919 --> 00:03:49.280
<v Speaker 2>mental image of the structure.

83
00:03:49.360 --> 00:03:50.280
<v Speaker 1>Right I know what that means.

84
00:03:50.360 --> 00:03:52.639
<v Speaker 2>I don't have to explain every single beam and shingle.

85
00:03:53.360 --> 00:03:56.680
<v Speaker 2>Design patterns are the same for code. They are standard

86
00:03:56.719 --> 00:04:00.719
<v Speaker 2>blueprints for solving common problems that developers have faced for decades.

87
00:04:00.960 --> 00:04:03.400
<v Speaker 1>So instead of reinventing the wheel every time I need

88
00:04:03.439 --> 00:04:06.520
<v Speaker 1>to spawn an enemy, I just use the wheel pattern precisely.

89
00:04:07.080 --> 00:04:11.599
<v Speaker 2>The book reference is the famous gang of four categories, creational, structural,

90
00:04:11.680 --> 00:04:12.479
<v Speaker 2>and behavioral.

91
00:04:12.599 --> 00:04:15.120
<v Speaker 1>It's about organizing your toolbox exactly.

92
00:04:15.400 --> 00:04:17.759
<v Speaker 2>Do you need to make something that's creational? Do you

93
00:04:17.800 --> 00:04:20.199
<v Speaker 2>need to connect things that's structural? Do you need things

94
00:04:20.279 --> 00:04:22.079
<v Speaker 2>to communicate behavioral.

95
00:04:22.399 --> 00:04:25.360
<v Speaker 1>Let's unpack the ones Walker says are essential for the exam.

96
00:04:25.439 --> 00:04:29.319
<v Speaker 1>First up, the builder pattern. I feel like the definition

97
00:04:29.399 --> 00:04:32.279
<v Speaker 1>is often so dry, but Walker uses a car analogy

98
00:04:32.319 --> 00:04:33.839
<v Speaker 1>that actually made it click for me.

99
00:04:34.240 --> 00:04:37.439
<v Speaker 2>The car analogy is a classic. So imagine you have

100
00:04:37.519 --> 00:04:40.240
<v Speaker 2>a script for a car, but then you need a

101
00:04:40.279 --> 00:04:43.439
<v Speaker 2>red car, okay, then a red car with sunroof, then

102
00:04:43.480 --> 00:04:44.959
<v Speaker 2>a blue car with turbo engine.

103
00:04:45.000 --> 00:04:47.240
<v Speaker 1>If you do that with inheritance, making a new script

104
00:04:47.319 --> 00:04:49.079
<v Speaker 1>for every single variation, you end.

105
00:04:49.040 --> 00:04:52.040
<v Speaker 2>Up with hundreds of scripts. It's a complete nightmare. The

106
00:04:52.079 --> 00:04:55.600
<v Speaker 2>builder pattern separates the construction from the object itself.

107
00:04:55.680 --> 00:04:56.480
<v Speaker 1>How does that work?

108
00:04:56.759 --> 00:04:59.879
<v Speaker 2>You have a builder script that acts like an assembly line,

109
00:05:00.120 --> 00:05:02.120
<v Speaker 2>he says, Okay, start with a chass he now paid it.

110
00:05:02.160 --> 00:05:05.399
<v Speaker 2>Read now add the sunroof. You write the logic for

111
00:05:05.439 --> 00:05:08.279
<v Speaker 2>adding a sunroof once and you can apply it to

112
00:05:08.319 --> 00:05:08.720
<v Speaker 2>any car.

113
00:05:08.839 --> 00:05:10.759
<v Speaker 1>It's like a sandwichop. You don't have a pre made

114
00:05:10.839 --> 00:05:14.160
<v Speaker 1>sandwich for every mathematical combination of ingredients. No, you have

115
00:05:14.199 --> 00:05:15.519
<v Speaker 1>a sandwich builder line.

116
00:05:15.600 --> 00:05:20.199
<v Speaker 2>Perfect analogy. It keeps your code dry. Don't repeat yourself.

117
00:05:21.079 --> 00:05:23.759
<v Speaker 1>Now, moving to a pattern that I feel like every

118
00:05:24.000 --> 00:05:28.079
<v Speaker 1>Unity developer has a complicated relationship with the singleton.

119
00:05:28.399 --> 00:05:31.000
<v Speaker 2>Ah, the singleton the highlander of design patterns.

120
00:05:31.079 --> 00:05:32.040
<v Speaker 1>There can be only one.

121
00:05:32.360 --> 00:05:33.360
<v Speaker 2>There can be only one.

122
00:05:33.519 --> 00:05:36.079
<v Speaker 1>Walker seems torn on this. He acknowledges it's useful, but

123
00:05:36.120 --> 00:05:38.560
<v Speaker 1>he also calls it dangerous. What's the deal?

124
00:05:38.759 --> 00:05:42.920
<v Speaker 2>So a singleton is a way to ensure a class

125
00:05:43.000 --> 00:05:45.720
<v Speaker 2>has only one instance, and it gives you a global

126
00:05:45.759 --> 00:05:46.560
<v Speaker 2>access point to it.

127
00:05:46.680 --> 00:05:47.000
<v Speaker 1>Yeah.

128
00:05:47.040 --> 00:05:49.360
<v Speaker 2>In Unity we do this constantly with managers.

129
00:05:49.439 --> 00:05:51.680
<v Speaker 1>Game manager dot instance, Audio manager dot instance.

130
00:05:51.959 --> 00:05:54.000
<v Speaker 2>Right. It lets any script in your game talk to

131
00:05:54.040 --> 00:05:55.519
<v Speaker 2>the manager immediately.

132
00:05:55.240 --> 00:05:57.399
<v Speaker 1>Which feels incredibly convenient. Right, I don't have to drag

133
00:05:57.439 --> 00:05:59.439
<v Speaker 1>and drop references in the inspector. I just type the

134
00:05:59.480 --> 00:06:00.399
<v Speaker 1>code and works.

135
00:06:00.519 --> 00:06:04.360
<v Speaker 2>It is convenient, but that convenience comes at a huge cost.

136
00:06:04.600 --> 00:06:08.120
<v Speaker 2>It creates what we call tight coupling, meaning suddenly every

137
00:06:08.240 --> 00:06:12.279
<v Speaker 2>script in your game is dependent on this one manager.

138
00:06:13.319 --> 00:06:15.879
<v Speaker 2>If you change something in the manager, you might break

139
00:06:16.079 --> 00:06:18.040
<v Speaker 2>ten other unrelated systems.

140
00:06:18.120 --> 00:06:20.959
<v Speaker 1>It's like having one central power strip for your entire house.

141
00:06:21.279 --> 00:06:24.079
<v Speaker 1>If it trips the fridge, the TV and the lights.

142
00:06:23.839 --> 00:06:26.360
<v Speaker 2>All go out exactly, and it often leads to god

143
00:06:26.399 --> 00:06:29.199
<v Speaker 2>classes the scripts that just do way too much. But

144
00:06:29.360 --> 00:06:31.040
<v Speaker 2>for the exam you need to know.

145
00:06:30.959 --> 00:06:32.800
<v Speaker 1>How to write one, and more importantly, when to use

146
00:06:32.839 --> 00:06:33.480
<v Speaker 1>it right.

147
00:06:34.240 --> 00:06:37.079
<v Speaker 2>Usually for high level systems like audio or score, it's

148
00:06:37.120 --> 00:06:40.600
<v Speaker 2>acceptable for the player's inventory. H maybe not.

149
00:06:40.680 --> 00:06:42.759
<v Speaker 1>Okay, one more pattern before we move on, and this

150
00:06:42.800 --> 00:06:46.720
<v Speaker 1>one feels non negotiable for performance. The object pool.

151
00:06:46.959 --> 00:06:49.360
<v Speaker 2>Oh, if you want to make mobile games or just

152
00:06:49.399 --> 00:06:51.639
<v Speaker 2>games that don't lag, you need object pooling.

153
00:06:51.920 --> 00:06:55.079
<v Speaker 1>Walker uses a ten bullet's analogy. That really clears this up.

154
00:06:55.600 --> 00:06:58.839
<v Speaker 1>So let's walk through the pain point first, the standard

155
00:06:59.040 --> 00:07:03.120
<v Speaker 1>rookie way. I press the fire button, the game instantiates

156
00:07:03.120 --> 00:07:06.199
<v Speaker 1>a bullet. It creates it, the bullet flies off screen.

157
00:07:06.480 --> 00:07:08.040
<v Speaker 1>I destroy the bullet.

158
00:07:08.000 --> 00:07:12.879
<v Speaker 2>And the CPU weeps. Creating memory and destroying memory is expensive.

159
00:07:13.319 --> 00:07:16.240
<v Speaker 2>It creates garbage, and when the garbage collector runs to

160
00:07:16.279 --> 00:07:19.360
<v Speaker 2>clean it up, your game freezes for a few milliseconds.

161
00:07:19.399 --> 00:07:20.199
<v Speaker 1>That's a frame drop.

162
00:07:20.279 --> 00:07:22.600
<v Speaker 2>That is a frame drop. If you're firing a machine gun,

163
00:07:22.720 --> 00:07:24.199
<v Speaker 2>you're game because a slide show.

164
00:07:24.399 --> 00:07:25.480
<v Speaker 1>So what does the pool do?

165
00:07:25.800 --> 00:07:29.240
<v Speaker 2>The pool creates, say ten bullets. When the game loads,

166
00:07:29.240 --> 00:07:32.439
<v Speaker 2>they're all just sitting there deactivated. When you fire, you

167
00:07:32.439 --> 00:07:34.639
<v Speaker 2>grab one, you activate it, you shoot it. When it

168
00:07:34.680 --> 00:07:36.839
<v Speaker 2>hits the wall, you don't destroy it. You just turn

169
00:07:36.879 --> 00:07:38.639
<v Speaker 2>it off, you just deactivate it and put it back

170
00:07:38.639 --> 00:07:39.319
<v Speaker 2>in the line.

171
00:07:39.120 --> 00:07:42.240
<v Speaker 1>So you're just recycling the same ten plastic bottles forever.

172
00:07:42.519 --> 00:07:48.399
<v Speaker 2>Zero memory allocation during gameplay, zero stutter, smooth, sixty frames

173
00:07:48.399 --> 00:07:51.120
<v Speaker 2>per second. It is the difference between an amateur project

174
00:07:51.399 --> 00:07:52.680
<v Speaker 2>and a professional release.

175
00:07:52.879 --> 00:07:55.279
<v Speaker 1>Okay, if we've got our blueprints, now we need the

176
00:07:55.360 --> 00:07:58.600
<v Speaker 1>rules of the road. Walker dedicates a heavy section to

177
00:07:58.639 --> 00:08:02.600
<v Speaker 1>the Solid principles. If this is an acronym solid, I

178
00:08:02.600 --> 00:08:05.360
<v Speaker 1>feel like this is the vegetables of programming. Oh. Absolutely,

179
00:08:05.439 --> 00:08:07.360
<v Speaker 1>everyone knows they should eat them, but they'd rather just

180
00:08:07.399 --> 00:08:08.279
<v Speaker 1>hack something together.

181
00:08:08.360 --> 00:08:10.800
<v Speaker 2>It is the vegetables. Yeah, but if you don't eat

182
00:08:10.800 --> 00:08:14.800
<v Speaker 2>your vegetables, your code gets scurvy. It becomes brittle and

183
00:08:14.839 --> 00:08:18.360
<v Speaker 2>it rots. Solid is all about keeping your code flexible.

184
00:08:18.560 --> 00:08:21.199
<v Speaker 1>Let's run through them rapid fire style, but keep it practical.

185
00:08:21.439 --> 00:08:24.279
<v Speaker 1>S is single responsibility.

186
00:08:23.560 --> 00:08:27.040
<v Speaker 2>One script, one job. Do not make a player script

187
00:08:27.120 --> 00:08:32.240
<v Speaker 2>that handles movement, health, shooting, inventory and UI updates. Wow,

188
00:08:32.360 --> 00:08:36.240
<v Speaker 2>break that into player movement, player health, player combat.

189
00:08:36.320 --> 00:08:38.799
<v Speaker 1>This makes you bugging so much easier if the player

190
00:08:38.840 --> 00:08:41.720
<v Speaker 1>can't jump, I know exactly which file to open precisely.

191
00:08:41.799 --> 00:08:43.960
<v Speaker 1>I don't have to scroll through line four thousand of

192
00:08:44.000 --> 00:08:44.759
<v Speaker 1>the god script.

193
00:08:44.840 --> 00:08:46.320
<v Speaker 2>It keeps the cognitive load down.

194
00:08:46.399 --> 00:08:49.879
<v Speaker 1>Oh is open closed, open for extension, closed for modification.

195
00:08:50.000 --> 00:08:51.320
<v Speaker 1>This one always trips people up.

196
00:08:51.360 --> 00:08:54.200
<v Speaker 2>Okay, think about the Killer Wave spaceship. You've written the

197
00:08:54.200 --> 00:08:56.799
<v Speaker 2>code for the show. It works. Now you want to

198
00:08:56.799 --> 00:09:00.039
<v Speaker 2>add a laser beam weapon. The rookie way is to

199
00:09:00.080 --> 00:09:04.840
<v Speaker 2>open the ship script and type if weapon do laser things.

200
00:09:05.240 --> 00:09:06.720
<v Speaker 2>You're modifying working.

201
00:09:06.440 --> 00:09:10.799
<v Speaker 1>Code, which risks breaking it. The open closed way is

202
00:09:10.879 --> 00:09:14.320
<v Speaker 1>to design the ship to accept a generic weapon object.

203
00:09:14.879 --> 00:09:17.440
<v Speaker 1>To add the laser, you create a new laser script

204
00:09:17.480 --> 00:09:18.320
<v Speaker 1>and just plug it in.

205
00:09:18.559 --> 00:09:22.320
<v Speaker 2>So you extended the functionality without modifying the original ship code.

206
00:09:22.360 --> 00:09:22.720
<v Speaker 1>Got it.

207
00:09:23.080 --> 00:09:25.720
<v Speaker 2>Don't perform surgery on a healthy patient just to give

208
00:09:25.759 --> 00:09:27.200
<v Speaker 2>them a new hat. I like that.

209
00:09:27.279 --> 00:09:28.200
<v Speaker 1>I'm stealing that one.

210
00:09:28.440 --> 00:09:32.120
<v Speaker 2>L is lisk of substitution. This sounds like a physics theorem.

211
00:09:32.360 --> 00:09:35.519
<v Speaker 1>It sounds intimidating, but it's simple logic. It just means

212
00:09:35.840 --> 00:09:38.240
<v Speaker 1>a subclass must be able to stand in for its

213
00:09:38.279 --> 00:09:40.039
<v Speaker 1>parent without crashing the game.

214
00:09:40.159 --> 00:09:41.240
<v Speaker 2>Okay, give me an example.

215
00:09:41.360 --> 00:09:43.960
<v Speaker 1>The rubber duck analogy. You have a class called duck

216
00:09:43.960 --> 00:09:46.080
<v Speaker 1>and it has a method called quack. Then you make

217
00:09:46.120 --> 00:09:49.559
<v Speaker 1>a subclass called rubber duck. Right, but rubber ducks don't quack.

218
00:09:49.600 --> 00:09:52.840
<v Speaker 1>They squeak, maybe they don't make noise at all. If

219
00:09:52.879 --> 00:09:56.080
<v Speaker 1>you write code that forces the rubber duck to throw

220
00:09:56.120 --> 00:09:59.320
<v Speaker 1>an error when quack is called, you've broken lisk off

221
00:09:59.360 --> 00:10:02.559
<v Speaker 1>because the game expects anything labeled duck to be able

222
00:10:02.600 --> 00:10:03.480
<v Speaker 1>to quack safely.

223
00:10:04.000 --> 00:10:06.759
<v Speaker 2>Right. If you have to write code somewhere else that says,

224
00:10:07.120 --> 00:10:09.320
<v Speaker 2>if this is a rubber duck, please don't call quack.

225
00:10:09.600 --> 00:10:12.080
<v Speaker 2>You failed the principle. Your code is now full of

226
00:10:12.159 --> 00:10:14.440
<v Speaker 2>special exceptions, which is where bugs live.

227
00:10:14.840 --> 00:10:16.759
<v Speaker 1>I is interface segregation.

228
00:10:17.039 --> 00:10:19.840
<v Speaker 2>Don't force a script to use methods it doesn't need.

229
00:10:20.320 --> 00:10:23.399
<v Speaker 2>Walker gives a great example. An interface called iActor that

230
00:10:23.440 --> 00:10:26.159
<v Speaker 2>has health and strength works for a goblin.

231
00:10:26.360 --> 00:10:28.399
<v Speaker 1>Yeah, that makes sense, But what if you have a crate.

232
00:10:28.919 --> 00:10:32.600
<v Speaker 2>A create have health, it can break, but does it

233
00:10:32.679 --> 00:10:33.240
<v Speaker 2>have strength.

234
00:10:33.639 --> 00:10:36.200
<v Speaker 1>No, So don't force the crate to have a strength

235
00:10:36.279 --> 00:10:38.840
<v Speaker 1>variable just to satisfy the interface exactly.

236
00:10:38.879 --> 00:10:42.240
<v Speaker 2>Split it into idamageable and eye attacker. Keep your interfaces

237
00:10:42.320 --> 00:10:44.240
<v Speaker 2>small and specific. It keeps your code clean.

238
00:10:44.399 --> 00:10:46.759
<v Speaker 1>And finally, d dependency inversion.

239
00:10:47.279 --> 00:10:50.039
<v Speaker 2>Lean on abstractions. Don't write code that depends on the

240
00:10:50.080 --> 00:10:53.600
<v Speaker 2>AK forty seven script. Write code that depends on the

241
00:10:53.639 --> 00:10:54.519
<v Speaker 2>webon interface.

242
00:10:54.759 --> 00:10:56.720
<v Speaker 1>So that way, if you swap the AK forty seven

243
00:10:56.759 --> 00:10:58.879
<v Speaker 1>for a banana gun, the player controller doesn't care.

244
00:10:59.039 --> 00:11:01.279
<v Speaker 2>It doesn't care at all, knows it's holding a weapon.

245
00:11:01.679 --> 00:11:04.759
<v Speaker 1>It really all comes down to future proofing. You're assuming

246
00:11:04.799 --> 00:11:07.159
<v Speaker 1>that you will change your mind later, so you write

247
00:11:07.200 --> 00:11:10.279
<v Speaker 1>code that lets you do that without burning the house down.

248
00:11:10.600 --> 00:11:14.200
<v Speaker 2>Game development is ten percent coding and ninety percent changing

249
00:11:14.200 --> 00:11:17.200
<v Speaker 2>your mind. Solid protects you from yourself.

250
00:11:17.799 --> 00:11:20.159
<v Speaker 1>Let's talk about the actual test bed for all this theory,

251
00:11:20.320 --> 00:11:24.519
<v Speaker 1>the Killer Wave Project. It's a futuristic side scroller, a.

252
00:11:24.639 --> 00:11:28.960
<v Speaker 2>Classic genre player moves right, three lives waves of enemies.

253
00:11:29.600 --> 00:11:33.759
<v Speaker 2>But Walker uses this simple premise to show off a

254
00:11:33.799 --> 00:11:35.159
<v Speaker 2>really complex architecture.

255
00:11:35.200 --> 00:11:37.799
<v Speaker 1>He doesn't just start coding, No, he starts.

256
00:11:37.480 --> 00:11:41.360
<v Speaker 2>With UML unified modeling language. He diagrams the whole thing out.

257
00:11:41.159 --> 00:11:43.879
<v Speaker 1>He defines the relationships before writing a single line of

258
00:11:43.919 --> 00:11:44.840
<v Speaker 1>C sharp yep.

259
00:11:45.200 --> 00:11:47.919
<v Speaker 2>He sets up the scene manager, the score manager. But

260
00:11:48.039 --> 00:11:51.360
<v Speaker 2>the key part, I think is the interface iActor template.

261
00:11:51.480 --> 00:11:52.080
<v Speaker 1>What does that do?

262
00:11:52.480 --> 00:11:55.240
<v Speaker 2>It acts as a contract says anything in this game

263
00:11:55.279 --> 00:11:57.679
<v Speaker 2>that is alive must have an attack function and a

264
00:11:57.759 --> 00:11:58.320
<v Speaker 2>die function.

265
00:11:58.480 --> 00:12:00.720
<v Speaker 1>So whether it's the player as sign way enemy or

266
00:12:00.759 --> 00:12:04.000
<v Speaker 1>the final boss. The game knows how to treat them exactly.

267
00:12:04.200 --> 00:12:06.200
<v Speaker 2>The game loop doesn't care if it's a wave enemy

268
00:12:06.200 --> 00:12:08.480
<v Speaker 2>that moves in a sign pattern or a flea enemy

269
00:12:08.519 --> 00:12:11.399
<v Speaker 2>that runs away. It just sees an eye actor. The

270
00:12:11.440 --> 00:12:13.519
<v Speaker 2>specifics are hidden inside the enemy class.

271
00:12:13.960 --> 00:12:17.960
<v Speaker 1>That's encapsulation, and he also separates the visuals from the logic.

272
00:12:18.440 --> 00:12:20.639
<v Speaker 1>There's a player ship build class that just handles the

273
00:12:20.679 --> 00:12:22.000
<v Speaker 1>mesh and the upgrades.

274
00:12:21.679 --> 00:12:23.279
<v Speaker 2>The builder pattern we just talked about.

275
00:12:23.200 --> 00:12:26.240
<v Speaker 1>Right, and a separate player class that handles the input.

276
00:12:26.440 --> 00:12:29.039
<v Speaker 1>It's the single responsibility principle in action.

277
00:12:29.360 --> 00:12:33.000
<v Speaker 2>It basically proves that you can apply enterprise level architecture

278
00:12:33.519 --> 00:12:35.039
<v Speaker 2>even to a simple arcade shooter.

279
00:12:35.159 --> 00:12:37.799
<v Speaker 1>Okay, so we built the code, but code doesn't exist

280
00:12:37.879 --> 00:12:40.399
<v Speaker 1>in a vacuum. It lives in the Unity editor, and

281
00:12:40.440 --> 00:12:43.840
<v Speaker 1>this is where the transition happens from coder to developer.

282
00:12:44.720 --> 00:12:48.279
<v Speaker 1>The exam isn't just c shark. It is about the tools.

283
00:12:48.679 --> 00:12:52.080
<v Speaker 2>Walker is pretty specific about tools. Yeah, he references Unity

284
00:12:52.159 --> 00:12:55.759
<v Speaker 2>twenty seventeen point three, which is I mean ancient history now,

285
00:12:55.919 --> 00:12:58.320
<v Speaker 2>but the concepts hold up. One thing he hammers home

286
00:12:58.480 --> 00:13:02.200
<v Speaker 2>is folder structure sounds, but it is so vital. He

287
00:13:02.240 --> 00:13:05.480
<v Speaker 2>talks about the resources folder. Now, beginners love the resources

288
00:13:05.480 --> 00:13:07.720
<v Speaker 2>folder because it's easy, so easy. You put a file

289
00:13:07.759 --> 00:13:09.679
<v Speaker 2>in there and you can load it with one line

290
00:13:09.679 --> 00:13:11.600
<v Speaker 2>of code resources dot load.

291
00:13:11.720 --> 00:13:14.159
<v Speaker 1>There's a butt, but it's a trap.

292
00:13:14.519 --> 00:13:17.480
<v Speaker 2>Everything in that folder gets built into the game executable

293
00:13:17.559 --> 00:13:20.360
<v Speaker 2>startup memory, even if you don't use it. Oh, and

294
00:13:20.519 --> 00:13:23.840
<v Speaker 2>managing the memory of those assets is manual. It is

295
00:13:23.879 --> 00:13:26.840
<v Speaker 2>so easy to bloat your game and crash a mobile device.

296
00:13:27.240 --> 00:13:29.159
<v Speaker 2>He warns you to use it very sparingly.

297
00:13:29.519 --> 00:13:32.759
<v Speaker 1>And then there's the team aspect objective number six working

298
00:13:32.799 --> 00:13:34.000
<v Speaker 1>in professional teams.

299
00:13:34.159 --> 00:13:34.360
<v Speaker 2>Right.

300
00:13:34.639 --> 00:13:37.840
<v Speaker 1>This brings us to version control. The book focuses on

301
00:13:37.960 --> 00:13:39.720
<v Speaker 1>Unity Collaborate.

302
00:13:39.399 --> 00:13:42.480
<v Speaker 2>Which has since evolved into Unity DevOps, but the logic

303
00:13:42.600 --> 00:13:45.679
<v Speaker 2>is the same. It's basically get light. You need to

304
00:13:45.720 --> 00:13:48.960
<v Speaker 2>know the difference between publishing, pushing your changes to the

305
00:13:48.960 --> 00:13:51.559
<v Speaker 2>cloud and restoring.

306
00:13:51.320 --> 00:13:53.720
<v Speaker 1>Reverting back when you inevitably break something.

307
00:13:53.799 --> 00:13:55.120
<v Speaker 2>When you break something, yes.

308
00:13:55.200 --> 00:13:58.759
<v Speaker 1>The book mentions visual cues specifically for the exam Yes,

309
00:13:58.759 --> 00:13:58.919
<v Speaker 1>and you.

310
00:13:58.879 --> 00:14:01.840
<v Speaker 2>Should memorize these. A green circle means you're SYNCD, A

311
00:14:01.879 --> 00:14:04.440
<v Speaker 2>blue square means you have local changes. These are the

312
00:14:04.519 --> 00:14:07.519
<v Speaker 2>kinds of specific gotcha questions that show up on the test.

313
00:14:07.639 --> 00:14:10.000
<v Speaker 1>He also talks about cloud build a life saver.

314
00:14:10.320 --> 00:14:13.000
<v Speaker 2>Instead of your laptop freezing for twenty minutes while it

315
00:14:13.000 --> 00:14:15.480
<v Speaker 2>compiles the Android version, you just send it to the cloud.

316
00:14:15.559 --> 00:14:18.600
<v Speaker 2>Can you keep working Unity servers build game, you keep coding.

317
00:14:18.799 --> 00:14:19.960
<v Speaker 2>It's all about efficiency.

318
00:14:20.080 --> 00:14:23.080
<v Speaker 1>Let's get into the weeds the pro tips section. There

319
00:14:23.120 --> 00:14:26.360
<v Speaker 1>are some specific hands on details Walker includes that I

320
00:14:26.399 --> 00:14:30.279
<v Speaker 1>found really interesting. One was about importing three D models.

321
00:14:30.559 --> 00:14:32.639
<v Speaker 2>Ah, the import settings hygiene check.

322
00:14:33.080 --> 00:14:33.440
<v Speaker 1>What's that?

323
00:14:34.279 --> 00:14:37.759
<v Speaker 2>When you drag a dot fbx model into Unity, say

324
00:14:38.120 --> 00:14:40.559
<v Speaker 2>your staceship, it brings a lot of baggage with it.

325
00:14:41.039 --> 00:14:43.679
<v Speaker 2>Materials you don't need, animation, rigs you aren't using.

326
00:14:43.799 --> 00:14:45.720
<v Speaker 1>I usually just ignore all that stuff.

327
00:14:45.399 --> 00:14:47.960
<v Speaker 2>And that is why your game is five hundred megabytes

328
00:14:47.960 --> 00:14:52.039
<v Speaker 2>instead of fifty. Ah, looker says, go into the inspector

329
00:14:52.799 --> 00:14:56.200
<v Speaker 2>uncheck import materials, own check import animation. If it's a

330
00:14:56.240 --> 00:14:59.080
<v Speaker 2>static rock, set the rig to none. You have to

331
00:14:59.080 --> 00:15:00.000
<v Speaker 2>strip that data out.

332
00:15:00.000 --> 00:15:01.000
<v Speaker 1>It's digital decluttering.

333
00:15:01.080 --> 00:15:04.919
<v Speaker 2>It's performance optimization on mobile, every single megabyte counts.

334
00:15:05.039 --> 00:15:08.600
<v Speaker 1>Speaking of mobile performance, there's a weirdly specific trick he mentions.

335
00:15:08.600 --> 00:15:12.519
<v Speaker 1>For the player's bullets, he uses a specific shader.

336
00:15:12.360 --> 00:15:14.600
<v Speaker 2>The unlit color shad and he sets.

337
00:15:14.360 --> 00:15:17.039
<v Speaker 1>It to this very specific Cyan.

338
00:15:16.799 --> 00:15:19.759
<v Speaker 2>Color our zero G one ninety B two five and five.

339
00:15:19.960 --> 00:15:22.519
<v Speaker 1>Yeah, why UNLT.

340
00:15:21.840 --> 00:15:25.759
<v Speaker 2>Because lighting is expensive. Real time lighting means the GPU

341
00:15:25.840 --> 00:15:31.279
<v Speaker 2>has to calculate shadows, reflections normals for every pixel every frame.

342
00:15:31.840 --> 00:15:34.600
<v Speaker 2>A bullet is just a fast moving dot. Does it

343
00:15:34.679 --> 00:15:35.320
<v Speaker 2>need a shadow?

344
00:15:35.519 --> 00:15:36.039
<v Speaker 1>Probably not.

345
00:15:36.399 --> 00:15:39.080
<v Speaker 2>By using the unlit shader, you're telling the GPU just

346
00:15:39.120 --> 00:15:42.240
<v Speaker 2>paint these pixels cyan. Don't do any math. It's incredibly fast.

347
00:15:42.360 --> 00:15:43.919
<v Speaker 1>And to make it look good, he just adds a

348
00:15:43.919 --> 00:15:46.559
<v Speaker 1>little point light component to the prefabs exactly.

349
00:15:46.679 --> 00:15:49.480
<v Speaker 2>The object itself is cheap, but it casts a little glow.

350
00:15:49.679 --> 00:15:51.399
<v Speaker 2>It's one of those smoke and mirrors tricks to get

351
00:15:51.440 --> 00:15:53.919
<v Speaker 2>high performance without sacrificing the visual pop.

352
00:15:54.159 --> 00:15:56.840
<v Speaker 1>And of course we have to mention prefabs.

353
00:15:56.399 --> 00:15:58.720
<v Speaker 2>The DNA of Unity. If you aren't using prefabs, you

354
00:15:58.759 --> 00:16:01.679
<v Speaker 2>aren't really using Unity. Emphasize is turning everything into a

355
00:16:01.720 --> 00:16:04.360
<v Speaker 2>prefab the ship, the bullets, the enemies.

356
00:16:04.480 --> 00:16:04.720
<v Speaker 1>Why.

357
00:16:05.000 --> 00:16:06.960
<v Speaker 2>It means if you change the bullets speed in one place,

358
00:16:07.320 --> 00:16:09.320
<v Speaker 2>it updates everywhere instantly.

359
00:16:09.399 --> 00:16:11.799
<v Speaker 1>He also mentions custom tags crucial.

360
00:16:11.399 --> 00:16:13.679
<v Speaker 2>For collision detection. Wow, you don't want your code checking

361
00:16:14.320 --> 00:16:18.679
<v Speaker 2>if mm no beware enemy ship variant three so brittle.

362
00:16:19.399 --> 00:16:22.480
<v Speaker 2>If you rename the ship the code breaks. You want

363
00:16:22.480 --> 00:16:25.039
<v Speaker 2>to check if tag equals enemy. It groups all the

364
00:16:25.039 --> 00:16:27.080
<v Speaker 2>bad guys into one bucket, so your code works on

365
00:16:27.080 --> 00:16:27.559
<v Speaker 2>all of them.

366
00:16:27.960 --> 00:16:33.240
<v Speaker 1>So looking back at all of this patterns, Solid tools optimization,

367
00:16:33.480 --> 00:16:36.000
<v Speaker 1>it is a lot of information. But as we wrap

368
00:16:36.080 --> 00:16:38.279
<v Speaker 1>up this deep dive, the biggest takeaway for me is

369
00:16:38.320 --> 00:16:40.639
<v Speaker 1>that Killer Wave isn't really the point.

370
00:16:40.879 --> 00:16:43.519
<v Speaker 2>No, not at all. The game is just a vehicle.

371
00:16:43.600 --> 00:16:44.879
<v Speaker 2>The point is the mindset.

372
00:16:45.080 --> 00:16:48.080
<v Speaker 1>Walker mentions in the intro that you should avoid muscle

373
00:16:48.120 --> 00:16:50.480
<v Speaker 1>memory during the exam. What does he mean by that?

374
00:16:50.480 --> 00:16:52.759
<v Speaker 2>That is the golden nugget of the whole book. A

375
00:16:52.759 --> 00:16:54.960
<v Speaker 2>lot of us learn by rote, right. We know that

376
00:16:55.000 --> 00:16:56.879
<v Speaker 2>to make a thing move we click here, type this,

377
00:16:56.919 --> 00:16:58.480
<v Speaker 2>and drag that, but we don't know why.

378
00:16:58.519 --> 00:17:00.000
<v Speaker 1>We're just monkeys pushing buttons.

379
00:17:00.200 --> 00:17:03.519
<v Speaker 2>Exactly true expertise, The kind that gets you certified and

380
00:17:03.519 --> 00:17:06.559
<v Speaker 2>gets you hired is understanding the principle behind the button.

381
00:17:07.039 --> 00:17:10.039
<v Speaker 2>If you understand SOLID, you can code in Unity today,

382
00:17:10.559 --> 00:17:14.279
<v Speaker 2>unreal tomorrow, and go down next week. The syntax changes,

383
00:17:14.440 --> 00:17:16.079
<v Speaker 2>but the architecture is universal.

384
00:17:16.200 --> 00:17:18.440
<v Speaker 1>It's the difference between knowing a recipe and knowing how

385
00:17:18.480 --> 00:17:22.240
<v Speaker 1>to cook. Perfectly said, so for everyone listening, here's the

386
00:17:22.319 --> 00:17:25.000
<v Speaker 1>question we want to leave you with when you sit

387
00:17:25.079 --> 00:17:27.400
<v Speaker 1>down to work on your project tonight. Are you designing

388
00:17:27.400 --> 00:17:30.599
<v Speaker 1>a system that can grow or are you just typing

389
00:17:30.680 --> 00:17:32.440
<v Speaker 1>until the red airlines go away?

390
00:17:32.759 --> 00:17:35.960
<v Speaker 2>That is the question that separates the hobbyist from the pro.

391
00:17:36.240 --> 00:17:38.799
<v Speaker 1>Thanks for joining us on the deep dive. Go build

392
00:17:38.839 --> 00:17:39.599
<v Speaker 1>something solid.

393
00:17:39.640 --> 00:17:40.359
<v Speaker 2>Happy coding
