Latest / CyberSecurity Summary / Holistic Game Development with Unity: An All-in-One Guide to Implementing Game Mechanics, Art, Design and Programming
Transcript
- 0:00Speaker 1: Next time you're playing a video game and you see
- 0:03Speaker 1: like a massive, hyperrealistic mountain range in the distance, I
- 0:06Speaker 1: want you to think about this. An artist didn't actually
- 0:10Speaker 1: draw that.
- 0:10Speaker 2: Mountain, right, A mathematician did exactly.
- 0:13Speaker 1: In fact, that majestic snowy peak is fundamentally nothing but
- 0:17Speaker 1: a series of overlapping flat triangles and well a few
- 0:21Speaker 1: lines of algebraic code. So welcome to today's deep dive.
- 0:25Speaker 1: We are tackling a topic that's specifically designed for you,
- 0:29Speaker 1: the kind of listener who really wants to understand how
- 0:31Speaker 1: the world actually fits together under.
- 0:33Speaker 2: The surface, because we usually don't see those connections, do we.
- 0:36Speaker 1: No, we really don't. And our mission today is to
- 0:39Speaker 1: completely break down that invisible, entirely fabricated wall between logical
- 0:44Speaker 1: programming and creative art.
- 0:46Speaker 2: And that divide is something most of us just accept
- 0:48Speaker 2: as a basic law of human nature. We categorize people
- 0:51Speaker 2: as either analytical or creative. We assume you're either destined
- 0:55Speaker 2: to write complex algorithms in a dark room or I
- 0:58Speaker 2: don't know, paint master pieces in a studio.
- 1:01Speaker 1: Right, you're a math nerd or a theater kid, basically exactly.
- 1:04Speaker 2: But when we actually start looking at the mechanics of
- 1:06Speaker 2: digital creation. The boundary between math and art completely evaporates.
- 1:11Speaker 2: It just disappears.
- 1:13Speaker 1: And our guide for this journey is a really fantastic textbook.
- 1:17Speaker 1: It's called Holistic Game Development with Unity, the second edition
- 1:20Speaker 1: by Penny to Bayo.
- 1:21Speaker 2: She's a professor of Interactive Multimedia and Games at Bond University.
- 1:26Speaker 1: Yeah, and she has this incredible vantage point because she's
- 1:28Speaker 1: taught computer science, computer graphics, and game development for over
- 1:33Speaker 1: two decades now. And in the acknowledgments of her book,
- 1:37Speaker 1: she drops this brilliant metaphor, calling game development the quintessential
- 1:42Speaker 1: scene where the tectonic plates of programming in art meet.
- 1:45Speaker 2: It is such a striking image, isn't it just tectonic
- 1:48Speaker 2: plates grinding together, creating something massive and entirely new out
- 1:52Speaker 2: of that friction.
- 1:53Speaker 1: Okay, let's unpack this, because understanding how these tectonic plates
- 1:56Speaker 1: of art and code interact is going to completely change
- 1:59Speaker 1: how you look at your favorite video games. But to
- 2:02Speaker 1: understand how they meet, we first have to dismantle why
- 2:05Speaker 1: we think they're separate in the first place.
- 2:06Speaker 2: And to do that we have to look at human psychology, specifically,
- 2:11Speaker 2: a rather pervasive misconception about how our brains actually work.
- 2:14Speaker 1: Oh you're talking about the famous left brain versus right
- 2:17Speaker 1: brain divide. I feel like literally everyone has heard this
- 2:19Speaker 1: since grade school.
- 2:20Speaker 2: Oh?
- 2:20Speaker 1: Absolutely, Like left brain is math, numbers, strict logic, and
- 2:26Speaker 1: right brain is spatially, acuity, images, dreaming, pure creativity.
- 2:30Speaker 2: Yeah, that is the popular consensus. It's a concept called lateralization,
- 2:34Speaker 2: the idea that specific intellectual capabilities are segregated strictly to
- 2:38Speaker 2: one physical side of the brain. The education system has
- 2:41Speaker 2: even used it to classify students into different learning styles.
- 2:44Speaker 2: But the truth is the idea of clearly define isolated
- 2:48Speaker 2: left and right brain functions is a Neuromis a neuromic?
- 2:51Speaker 1: I love that term. So wait, if I'm sitting down
- 2:53Speaker 1: to do like a calculus problem, my whole brain is firing,
- 2:56Speaker 1: not just the left hemisphere exactly.
- 2:59Speaker 2: Complex tasks like numerical computation or language processing, they require
- 3:05Speaker 2: both hemispheres to communicate and share the load. The source
- 3:08Speaker 2: material highlights a great statistical reality check here regarding language,
- 3:13Speaker 2: which is you know, traditionally deemed a left brain task right, well,
- 3:17Speaker 2: ninety seven percent of right handed people do use their
- 3:20Speaker 2: left hemisphere for language and speech processing.
- 3:23Speaker 1: Okay, so that sort of tracks.
- 3:25Speaker 2: But for left handed people, seventy percent use their right
- 3:28Speaker 2: hemisphere for those exact same tasks.
- 3:30Speaker 1: Oh wow, So you cannot just definitively say language lives
- 3:33Speaker 1: in the left brain because for a massive chunk of
- 3:36Speaker 1: the population, it physically doesn't.
- 3:38Speaker 2: Right, simply classifying programmers as left brainers and artists as
- 3:42Speaker 2: right brainers is not just a misnomer, it's actively limiting.
- 3:46Speaker 2: It leads to this really disturbing misconception that a programmer
- 3:49Speaker 2: couldn't possibly be good at art, or that an artist
- 3:52Speaker 2: is biologically incapable of understanding code.
- 3:55Speaker 1: What takes me wonder about Betty Edwards in her famous
- 3:57Speaker 1: nineteen seventy nine book Drawing on the Right Side of
- 4:00Speaker 1: the Brain, Because if the physical right brain thing is
- 4:03Speaker 1: a neuromith, why is her book considered this like foundational
- 4:07Speaker 1: text for learning how to draw.
- 4:09Speaker 2: What's fascinating here is that Betty Edwards's advice to use
- 4:12Speaker 2: your right brain to draw is purely conceptual, not physiological.
- 4:18Speaker 2: She isn't talking about the literal location of your neurons
- 4:21Speaker 2: or telling you to route blood flow to one half
- 4:24Speaker 2: of your skull.
- 4:25Speaker 1: So she's really just talking about a state of mind.
- 4:27Speaker 2: Exactly. She is asking the reader to see the visual
- 4:31Speaker 2: world in a completely different light. See, our brains are
- 4:34Speaker 2: highly adept at pattern recognition, so much so that we
- 4:37Speaker 2: create internalized symbols, essentially mental icons of the things we
- 4:41Speaker 2: see every day, like a shortcut. Yes, exactly, So when
- 4:44Speaker 2: someone asks you to draw a dog, you rarely draw
- 4:47Speaker 2: the actual biological animal sitting in front of you. You
- 4:50Speaker 2: regurgitate the generic dog pattern your brain has stored away
- 4:53Speaker 2: in its database.
- 4:54Speaker 1: The author gives a perfect visual example of this in
- 4:56Speaker 1: the book. Actually, she includes a drawing by her four
- 4:59Speaker 1: year old daughter, Tabitha.
- 5:00Speaker 2: Oh right, the castle drawing.
- 5:02Speaker 1: Yeah, it's a drawing of dogs in the yard of
- 5:04Speaker 1: a castle, and it is exactly what you would expect
- 5:07Speaker 1: from a four year old. You can absolutely recognize it
- 5:10Speaker 1: as a castle and dogs, but they are just icons,
- 5:13Speaker 1: like rectangles for the walls, triangles for the ears. It's
- 5:16Speaker 1: not a rendering of reality at all.
- 5:18Speaker 2: And what Edwards teaches in her book is how to
- 5:20Speaker 2: switch away from that logical symbol retrieving mindset and switch
- 5:23Speaker 2: into raw visual processing. She teaches you to forget what
- 5:27Speaker 2: you think a dog looks like and just draw the
- 5:29Speaker 2: specific lines, angles, and shadows you actually see.
- 5:33Speaker 1: It's a complete shift in perspective, just abandoning the shortcuts
- 5:36Speaker 1: your brain wants to take. Exactly well, if Edwards proves
- 5:39Speaker 1: that anyone can learn to draw simply by changing their
- 5:42Speaker 1: perspective and abandoning those internalized symbols, then the exact same
- 5:46Speaker 1: logic applies to programming. Anyone can learn to program. It
- 5:50Speaker 1: is just a different language requiring a different perspective.
- 5:53Speaker 2: That's a great way to put it.
- 5:54Speaker 1: I always compare a good programmer to Neo in the matrix.
- 5:57Speaker 2: Oh, in terms of seeing beyond the surface.
- 6:00Speaker 1: Yeah, think about the end of that movie. Neo is
- 6:03Speaker 1: looking at a hallway, but he isn't seeing walls and doors.
- 6:06Speaker 1: He's looking at a screen of vertically flowing green numbers
- 6:09Speaker 1: in text, pure logic and code. Right, But he isn't
- 6:13Speaker 1: just seeing math in his mind. He is visualizing a
- 6:17Speaker 1: fully formed, photorealistic three dimensional reality. He is seeing the
- 6:22Speaker 1: art through the code.
- 6:24Speaker 2: That is a very apt analogy. To be a capable programmer,
- 6:27Speaker 2: you have to know the syntax of the code, but
- 6:29Speaker 2: to be a brilliant one, you have to visualize how
- 6:32Speaker 2: that invisible logic is going to output visually on the screen.
- 6:35Speaker 1: So since anyone can learn this language, let's look at
- 6:38Speaker 1: how raw code and math can actually generate beautiful art,
- 6:41Speaker 1: because at the end of the day, a video game
- 6:43Speaker 1: is entirely made of code.
- 6:44Speaker 2: We can trace this idea back to Embardo Eco, the
- 6:47Speaker 2: creator of Opera Perda. He described the concept of art
- 6:50Speaker 2: as a series of mechanical relationships between features that can
- 6:53Speaker 2: be reorganized to make distinct.
- 6:55Speaker 1: Works, meaning taking the exact same basic mechanical pieces and
- 6:58Speaker 1: reorganizing them to create entirely different visual experiences.
- 7:01Speaker 2: The purest, most mind bending example of this is fractals.
- 7:05Speaker 2: Fractals are shapes made up of smaller, self similar copies
- 7:08Speaker 2: of themselves. The book uses the mantel brought set as
- 7:11Speaker 2: an example. It broadly resembles a complex infinite snowman.
- 7:15Speaker 1: Right, And as you zoom in closer and closer on
- 7:17Speaker 1: the edge of this snowman, you spot tens hundreds thousands
- 7:21Speaker 1: of smaller snowman shapes making up the boundary of the
- 7:24Speaker 1: larger one. And it just goes on forever.
- 7:26Speaker 2: And it is generated purely by a mathematical algorithm interpreted
- 7:30Speaker 2: as points and colors on a screen.
- 7:32Speaker 1: But we can take this out of the abstract and
- 7:34Speaker 1: look at something completely natural too, like the Barnsley fern leaf.
- 7:37Speaker 2: Oh, the Barnsley fern is a perfect demonstration of algorithmic
- 7:40Speaker 2: art because it doesn't require you know high level calculus
- 7:44Speaker 2: to understand. It is procedural generation in its most elegant form.
- 7:48Speaker 1: Okay, so how does it work?
- 7:50Speaker 2: Well? The algorithm takes a shape, literally any starting shape
- 7:53Speaker 2: you could begin with a simple square, and it applies
- 7:55Speaker 2: four strict mathematical transformations to it.
- 7:58Speaker 1: Walk us through those transformations, because I really want to
- 8:00Speaker 1: picture how this actually works.
- 8:01Speaker 2: Sure. Step one, the algorithm shrinks the shape and slightly
- 8:05Speaker 2: tilts it clockwise about five degrees.
- 8:07Speaker 1: Okay, I got it.
- 8:08Speaker 2: Step two it quarters the size of the shape and
- 8:11Speaker 2: tilts it approximately forty five degrees clockwise. Step three it
- 8:15Speaker 2: corters the size again, but tilts it forty five degrees counterclockwise.
- 8:20Speaker 2: And finally, step four, it has the size and squashes
- 8:23Speaker 2: it into an upright vertical line.
- 8:25Speaker 1: Okay, but if I do that on a piece of
- 8:27Speaker 1: paper with my starting square, I just have a messy,
- 8:30Speaker 1: overlapping blob of lines.
- 8:32Speaker 2: True, but if you tell a computer to take that
- 8:35Speaker 2: new messy blob and feed it back into those exact
- 8:38Speaker 2: same four rules again, and then take that result and
- 8:40Speaker 2: run it through the four rules again.
- 8:42Speaker 1: Just looping it exactly.
- 8:43Speaker 2: The book points out that after just ten iterations of
- 8:46Speaker 2: this mathematical looping, the math forces that blob into the
- 8:49Speaker 2: exact geometric shape of a natural, organic fern leaf.
- 8:53Speaker 1: That is wild. The code is literally growing a plant.
- 8:57Speaker 1: And this concept of procedural generation isn't just for make
- 9:00Speaker 1: pretty pictures of ferns in a lab. It's a foundational
- 9:03Speaker 1: tool in game development.
- 9:05Speaker 2: Oh absolutely. While developers use it to build massive forests
- 9:08Speaker 2: and mountain ranges before a game even ships, it really
- 9:11Speaker 2: shines during runtime, meaning while the game is actually being played.
- 9:14Speaker 1: Yeah. The book mentions the game Fracture by Day One
- 9:17Speaker 1: Studios for this exact reason. It features dynamically changing terrain,
- 9:21Speaker 1: like if you shoot the ground with a special weapon,
- 9:24Speaker 1: the code generates a crater right there on the spot, and.
- 9:27Speaker 2: That crater cannot be pre drawn or pre animated by
- 9:30Speaker 2: a traditional artist. A developer has absolutely no idea where
- 9:34Speaker 2: you the player are going to aim your weapon or
- 9:36Speaker 2: what angle you'll be standing at. Right It's totally unpredictable,
- 9:39Speaker 2: So the code has to dynamically calculate the physics and
- 9:42Speaker 2: reorganize the terrain mesh at the exact millisecond of impact.
- 9:46Speaker 1: Well, I have to play Devil's Advocate for you listening
- 9:48Speaker 1: right now, because I can hear the pushback. A computer
- 9:51Speaker 1: doesn't have an imagination. It is just a calculator doing
- 9:54Speaker 1: what it's told. Sure a crater appears, Sure the fern
- 9:57Speaker 1: is drawn, But does running a math out rhythm really
- 10:00Speaker 1: feel creative? Like? How is the calculator following orders making art?
- 10:05Speaker 2: Well, the computer did not invent the four steps to
- 10:07Speaker 2: make the Barnsley fern, nor did it invent the physics
- 10:10Speaker 2: calculations for the creator and fracture a human did. The
- 10:14Speaker 2: creativity does not lie in the processor executing the math.
- 10:18Speaker 2: The creativity lies in the human mind that designs the
- 10:21Speaker 2: algorithm to achieve a specific esthetic result. They are sculpting
- 10:25Speaker 2: with numbers.
- 10:26Speaker 1: Sculpting with numbers. I love that there is actually a
- 10:29Speaker 1: purpose built programming language designed specifically for this kind of
- 10:33Speaker 1: visual sculpting called processing.
- 10:34Speaker 2: Yes, processing is incredible.
- 10:37Speaker 1: The author notes that an artist named Casey Rheis uses
- 10:39Speaker 1: Processing to create code generated art that has literally been
- 10:44Speaker 1: exhibited in fine art galleries in Berlin. It is raw
- 10:47Speaker 1: code hanging on a gallery wall.
- 10:50Speaker 2: The wall between the two disciplines is entirely an illusion.
- 10:53Speaker 1: So if we accept that code can create art, we
- 10:55Speaker 1: have to flip the script. We have to look at
- 10:58Speaker 1: how art inside a computer is fundamentally just math and logic.
- 11:02Speaker 1: If the pixel is the building block of digital art,
- 11:04Speaker 1: how does the computer actually build a world out of it.
- 11:06Speaker 1: Let's break down the geometry of video game.
- 11:09Speaker 2: It all starts with a point on paper. It's the
- 11:11Speaker 2: first mark of a pen on a screen. It is
- 11:14Speaker 2: a mixel. Every pixel is defined by its Cartesian coordinates
- 11:18Speaker 2: an x and a y value.
- 11:20Speaker 1: But unlike the graph paper we all used in high
- 11:22Speaker 1: school geometry, where the coordinate zero zero is in the
- 11:25Speaker 1: bottom left corner, the default coordinate system for a digital
- 11:28Speaker 1: screen usually puts zero zero in the top left corner right.
- 11:32Speaker 2: And because pixels are physical, discrete little hardware squares on
- 11:36Speaker 2: your monitor, these coordinates always have to be whole numbers.
- 11:39Speaker 2: You cannot sell a monitor to light up half of
- 11:41Speaker 2: a pixel.
- 11:42Speaker 1: Which creates a massive headache when you try to draw
- 11:44Speaker 1: a simple diagonal line. If I draw a line with
- 11:47Speaker 1: a pen, it is a smooth, continuous streak of ink.
- 11:51Speaker 1: But a computer can't do that, No, it can't.
- 11:52Speaker 2: If a computer wants to connect point A to point
- 11:54Speaker 2: B diagonally, it has to figure out which specific blocky
- 11:58Speaker 2: pixels to color in to rate the illusion of a
- 12:00Speaker 2: straight line.
- 12:01Speaker 1: Enter the Bresenum line algorithm, invented back in nineteen sixty two.
- 12:05Speaker 1: Instead of just calculating the slope and forcing the computer
- 12:08Speaker 1: to do complex floating point division, which you know computers
- 12:12Speaker 1: back then were terribly slow at her, Jack Bresenham figured
- 12:15Speaker 1: out a brilliant hack.
- 12:16Speaker 2: The algorithm uses an error accumulation trick. It keeps a
- 12:20Speaker 2: running tallly of the error, meaning how far the true
- 12:23Speaker 2: mathematical line has drifted away from the center of the
- 12:26Speaker 2: pixel grid, and.
- 12:26Speaker 1: It only uses simple addition and subtraction.
- 12:29Speaker 2: Yeah, exactly. Once that error tallly hits a certain threshold,
- 12:32Speaker 2: the algorithm knows it is time to step up one
- 12:35Speaker 2: pixel on the y axis. So when you really zoom in,
- 12:38Speaker 2: every digital line is basically a tiny mathematical staircase.
- 12:42Speaker 1: But a video game isn't a two D line drawing.
- 12:44Speaker 1: It is a massive three dimensional world. So how does
- 12:48Speaker 1: the computer build three D.
- 12:50Speaker 2: Volume in three D computer graphics, the foundational building block
- 12:53Speaker 2: is the polygon, specifically the triangle. The triangle is the
- 12:57Speaker 2: undisputed MVP of three D gaming.
- 13:00Speaker 1: Wondered about this, Why the triangle? Why not build a
- 13:03Speaker 1: world out of three D squares or hexagon.
- 13:05Speaker 2: Because three points are the most mathematically efficient way to
- 13:07Speaker 2: define a perfectly flat surface in three D space. You
- 13:10Speaker 2: cannot bend a triangle. Wait really yeah, If you pick
- 13:14Speaker 2: any three points in the universe and connect them, they
- 13:16Speaker 2: will always form a single, perfectly flat plane. Software like
- 13:20Speaker 2: Autodesk's three DS Max or Blender automatically constructs three D
- 13:24Speaker 2: objects using these flat triangles as the base mesh.
- 13:27Speaker 1: The wireframe mesh. Yeah, and the number of triangles in
- 13:30Speaker 1: that mash is called the poly count. This is where
- 13:32Speaker 1: the tension between art and programming really flares up in
- 13:35Speaker 1: game studios, doesn't it.
- 13:36Speaker 2: Oh?
- 13:37Speaker 1: Absolutely, Because an artist wants a character to look incredibly lifelike,
- 13:41Speaker 1: which means a massive poly count millions of tiny triangles
- 13:45Speaker 1: to capture every wrinkle and fold of clothing.
- 13:47Speaker 2: But the programmer knows that the game engine has to
- 13:49Speaker 2: dynamically process and render every single one of those triangles
- 13:53Speaker 2: in real time, often sixty times a second. A polycount
- 13:57Speaker 2: that is too high will literally bring the computer's processor
- 13:59Speaker 2: to to its knees, causing the frame rate to drop
- 14:02Speaker 2: and making the game unplayable.
- 14:04Speaker 1: This is exactly why animated movies from Pixar or DreamWorks
- 14:07Speaker 1: can look so much more detailed than a video game.
- 14:09Speaker 1: A movie frame could take a server farm hours to
- 14:11Speaker 1: render just one single image, so they can use insanely
- 14:14Speaker 1: high polycounts a game have milliseconds to do the exact
- 14:18Speaker 1: same job exactly.
- 14:20Speaker 2: And game developers also need smooth curves for organic shapes
- 14:23Speaker 2: like a character's face, which are really hard to make
- 14:25Speaker 2: which just flat triangles, so they use mathematical curves, specifically
- 14:30Speaker 2: Bezier curves and n rbs.
- 14:33Speaker 1: Break down N you'r rbs first, because that just sounds
- 14:36Speaker 1: like a made up sci fi word.
- 14:37Speaker 2: It does, but it stands for a non uniform rational.
- 14:39Speaker 1: Be splends still sounds like sci fi.
- 14:41Speaker 2: Fair enough, but think of it this way. A Bezier
- 14:44Speaker 2: curve has a start point and end point, and these
- 14:47Speaker 2: invisible control points floating in space that act like magnets
- 14:50Speaker 2: pulling the line toward them to bend it. N RBS
- 14:54Speaker 2: curves take that further. The rational part means it uses
- 14:57Speaker 2: fractions to give different weights to those control points.
- 15:00Speaker 1: So some magnets pull much harder than others.
- 15:02Speaker 2: Exactly, allowing for incredibly precise organic swoops and bends entirely
- 15:06Speaker 2: dictated by math.
- 15:07Speaker 1: Just like sizing objects, when you want to make a
- 15:10Speaker 1: character bigger in a game, you are using the math
- 15:13Speaker 1: of scaling.
- 15:14Speaker 2: Scaling is trickier than it sounds, though. If an object
- 15:17Speaker 2: is sitting dead center at coordinate zero zero and you
- 15:19Speaker 2: scale it by two, it just gets twice as big
- 15:22Speaker 2: and stays exactly where it is.
- 15:23Speaker 1: But if a vertex of that object is sitting off
- 15:27Speaker 1: to the side, say coordinate three on the x axis
- 15:29Speaker 1: and two on the y axis, and you multiply the
- 15:31Speaker 1: scale by.
- 15:32Speaker 2: Two, the math dictates it physically moves three times two
- 15:35Speaker 2: is six and two times two is four. That vertex
- 15:38Speaker 2: moves to coordinate six.
- 15:40Speaker 1: Oh wow.
- 15:41Speaker 2: Yeah. Scaling an object that is off center physically pushes
- 15:45Speaker 2: it away from the origin point, and scaling by a
- 15:47Speaker 2: negative number actually flips the object upside down or backward,
- 15:50Speaker 2: turning it inside out. Mathematically, here's where.
- 15:53Speaker 1: It gets really interesting when we bring up UV mapping,
- 15:56Speaker 1: because how do we get the actual art, the vivid colors,
- 16:00Speaker 1: the fabric textures, the dirt onto these mathematical triangles. Right.
- 16:03Speaker 2: We use a technique called UV mapping.
- 16:05Speaker 1: I always fixture you UV mapping like wrapping a really
- 16:08Speaker 1: awkward present for the holidays. You have this flat two
- 16:10Speaker 1: D sheet of wrapping paper, which is your image file
- 16:14Speaker 1: or texture map, and you have to figure out how
- 16:16Speaker 1: to stretch, cut, and fold it perfectly over a three
- 16:19Speaker 1: D box of triangles so that the pattern lines up
- 16:22Speaker 1: without looking distorted.
- 16:24Speaker 2: That's a perfect analogy. The algorithm maps specific UV coordinates
- 16:28Speaker 2: on the two D image to the specific xyz vertices
- 16:32Speaker 2: of the three D polygon, essentially mathematically stretching the image
- 16:35Speaker 2: across the geometric gap.
- 16:37Speaker 1: But flat wrapping paper doesn't look like real life. Real
- 16:41Speaker 1: life has texture, rough stone walls, shiny metal armor with scratches.
- 16:46Speaker 2: And to achieve that illusion of depth without adding millions
- 16:49Speaker 2: more triangles and destroying your frame rate, developers use bump mapping.
- 16:54Speaker 2: It is a brilliant mathematical trick.
- 16:56Speaker 1: How does that work?
- 16:57Speaker 2: Light engines and games calculate shadows based on the norm
- 17:00Speaker 2: an invisible arrow pointing straight out from the flat triangle.
- 17:03Speaker 2: Bump mapping tells the light engine to maithematically tilt that
- 17:06Speaker 2: invisible arrow.
- 17:07Speaker 1: Even though the physical triangle doesn't actually move or get vented.
- 17:10Speaker 2: It remains perfectly flat, but the light bounces off it
- 17:13Speaker 2: at fake angles, tricking our brains into seeing bumps, grooves,
- 17:16Speaker 2: and depth that do not physically exist in the geometry.
- 17:19Speaker 1: It is literally hacking your eyeballs. And speaking of eyeballs,
- 17:22Speaker 1: we have to talk about color because the color in
- 17:24Speaker 1: the video game behaves fundamentally differently than the color on
- 17:27Speaker 1: the traditional painter's canvas.
- 17:29Speaker 2: Right they operate on opposite models. Traditional painting relies on
- 17:32Speaker 2: a subtractive color model. The physical pigments in the paint
- 17:35Speaker 2: absorb or subtract certain wavelengths of light, and whatever is
- 17:39Speaker 2: leftover bounces back to your eye.
- 17:40Speaker 1: So if you mix all the primary colors together on
- 17:43Speaker 1: a pallette, you get a dark, muddy black because almost
- 17:46Speaker 1: all light is being absorbed by the pigment exactly.
- 17:49Speaker 2: But digital displays use an additive color model. Your monitor
- 17:53Speaker 2: is emitting light directly into your eyes, not absorbing it.
- 17:55Speaker 2: It uses red, green, and blue light RGB, plus an
- 17:58Speaker 2: alpha channel for transparent and see, and the.
- 18:00Speaker 1: Alpha channel acts like a digital dimmer switch. A value
- 18:04Speaker 1: of two hundred and fifty five means the pixel is
- 18:06Speaker 1: a solid, opaque wall of light. A value of zero
- 18:09Speaker 1: means it is completely transparent like glass.
- 18:12Speaker 2: Yes, and if you mix full red, full green, and
- 18:15Speaker 2: full blue light together at full opacity, you don't get black,
- 18:18Speaker 2: you get pure white light.
- 18:20Speaker 1: So when an artist selects a specific shade of purple
- 18:22Speaker 1: for a digital game, they are literally programming the exact
- 18:26Speaker 1: intensity of microscopic red and blue flashlights embedded in your screen.
- 18:30Speaker 1: We have the art driven by math and the code
- 18:32Speaker 1: generating art. But how do these massive tectonic plates actually
- 18:36Speaker 1: lock together so I can sit on my couch, press
- 18:39Speaker 1: a button and play a game.
- 18:40Speaker 2: Well, that monumental task is the job of the game
- 18:43Speaker 2: engine and its core component, the main loop.
- 18:46Speaker 1: The game engine is really the unsung hero of the
- 18:49Speaker 1: entire medium. Penny Ball points out that it manages millions
- 18:52Speaker 1: of lines of complex real world physics and math under
- 18:56Speaker 1: the hood. It constantly calculates gravity, friction, collision detection.
- 19:01Speaker 2: It means a creative game developer doesn't need a PhD
- 19:04Speaker 2: in Newtonian physics just to make a digital basketball bounce
- 19:07Speaker 2: off a digital floor. The engine handles the heavy lifting.
- 19:11Speaker 1: Inside the engine, everything in your game world is categorized
- 19:14Speaker 1: as a game object. A tree is an object, a
- 19:16Speaker 1: character is an object. A rock rolling down a hill
- 19:19Speaker 1: as an object, but.
- 19:19Speaker 2: They don't all act the same. They are customized with components.
- 19:22Speaker 2: You can attach a graphics component, a sound component, a
- 19:25Speaker 2: physics component, or an AI component to any raw game object.
- 19:29Speaker 1: So a boulder rolling down a hill has a physics
- 19:32Speaker 1: component because it needs to fall with gravity, and a
- 19:35Speaker 1: graphics component because you need to see it, but it
- 19:37Speaker 1: doesn't have an AI component because it's not like a
- 19:40Speaker 1: smart rock planning a tactical attack.
- 19:42Speaker 2: Conversely, think about an auto safe checkpoint in a racing game.
- 19:47Speaker 2: It is a game object sitting right in the middle
- 19:49Speaker 2: of the track. It has a script that triggers the
- 19:52Speaker 2: safe state when your car drives through its coordinates, but
- 19:55Speaker 2: it has no graphics component attached to it, so it
- 19:58Speaker 2: is completely invisible the player.
- 20:00Speaker 1: All of these objects and components are kept alive, synchronized
- 20:04Speaker 1: and ticking by the main loop. This is the constant
- 20:07Speaker 1: heartbeat of any game. Walk us through a single beat
- 20:10Speaker 1: of that heart.
- 20:10Speaker 2: Okay, so it starts with initialization, allocating memory, and checking devices.
- 20:15Speaker 2: Then the loop truly begins. First, it processes your user input.
- 20:20Speaker 2: Did you press the jump button? Did you move the
- 20:21Speaker 2: joystick to the left.
- 20:22Speaker 1: Then it updates the game objects based on that specific input.
- 20:26Speaker 1: It changes their mathematical coordinates and states.
- 20:28Speaker 2: Next, it updates the environment and the physics engine. It
- 20:31Speaker 2: calculates if your jump caused you to collide with a wall,
- 20:35Speaker 2: or if gravity needs to start pulling your character back down.
- 20:38Speaker 1: Finally, it renders all of that new math, all those
- 20:41Speaker 1: millions of triangles, resent hemal lines, and additive RGB colors,
- 20:46Speaker 1: to the screen as a brand new frame.
- 20:49Speaker 2: And then it just does it all over again, right instantly,
- 20:52Speaker 2: over and.
- 20:53Speaker 1: Over, sixty times a second, until you quit the application.
- 20:56Speaker 2: That's exhausting to even think about.
- 20:58Speaker 1: But if we connect this to the bigger picture, the
- 21:00Speaker 1: main loop is what gives the illusion of a living,
- 21:03Speaker 1: breathing world.
- 21:04Speaker 2: So what does this all mean for you listening right now?
- 21:06Speaker 2: It means that every time you casually flick a thumbstick,
- 21:09Speaker 2: an invisible symphony of strict logic and boundless creativity executes perfectly,
- 21:14Speaker 2: and it.
- 21:15Speaker 1: Proves that the left brain versus right brain divide is
- 21:17Speaker 1: an entirely artificial limitation. By realizing that lateralization is a myth.
- 21:23Speaker 1: You are empowered. You are entirely capable of learning both
- 21:26Speaker 1: the strict logic of programming code and the expressive creativity
- 21:29Speaker 1: of visual design. Every modern video game you play is
- 21:32Speaker 1: a masterpiece of this synthesized holistic thinking, which leads us
- 21:36Speaker 1: with a pretty mind bidding thought for you to mull
- 21:38Speaker 1: over think about the most beautiful, on inspiring sunset you
- 21:41Speaker 1: have ever seen inside a video game. As we now
- 21:44Speaker 1: know that sunset is fundamentally just an additive RGB color
- 21:48Speaker 1: model mathematically stretched over a mesh of geometric triangles using
- 21:52Speaker 1: UV mapping, constantly refreshing in a relentless mathematical loop. Now
- 21:58Speaker 1: how different is that really from how our own biological
- 22:01Speaker 1: eyes absorbed the physical wavelengths of light and our brains
- 22:04Speaker 1: rapidly process that data in our own neural loops to
- 22:07Speaker 1: construct our perception of the real world? Are we just
- 22:09Speaker 1: running our own biological main loop, rendering the universe frame
- 22:13Speaker 1: by frame? Thank you for joining us on this deep
- 22:16Speaker 1: dive into the scene where art and code meet. Keep questioning,
- 22:18Speaker 1: keep discovering, and we will catch you next time.