Menu
Sign In Pricing Add Podcast
Podcast Image

Lex Fridman Podcast

#467 – Tim Sweeney: Fortnite, Unreal Engine, and the Future of Gaming

Wed, 30 Apr 2025

Description

Tim Sweeney is a legendary video game programmer, founder and CEO of Epic Games that created the Unreal Engine, Fortnite, Gears of War, Unreal Tournament, and many other groundbreaking and influential video games. Thank you for listening ❤ Check out our sponsors: https://lexfridman.com/sponsors/ep467-sc See below for timestamps, transcript, and to give feedback, submit questions, contact Lex, etc. Transcript: https://lexfridman.com/tim-sweeney-transcript CONTACT LEX: Feedback - give feedback to Lex: https://lexfridman.com/survey AMA - submit questions, videos or call-in: https://lexfridman.com/ama Hiring - join our team: https://lexfridman.com/hiring Other - other ways to get in touch: https://lexfridman.com/contact EPISODE LINKS: Tim's X: https://x.com/timsweeneyepic Epic Games: https://epicgames.com/ SPONSORS: To support this podcast, check out our sponsors & get discounts: Notion: Note-taking and team collaboration. Go to https://notion.com/lex MasterClass: Online classes from world-class experts. Go to https://masterclass.com/lexpod Shopify: Sell stuff online. Go to https://shopify.com/lex AG1: All-in-one daily nutrition drink. Go to https://drinkag1.com/lex LMNT: Zero-sugar electrolyte drink mix. Go to https://drinkLMNT.com/lex OUTLINE: (00:00) - Introduction (08:25) - 10,000 hours programming (11:42) - Advice for young programmers (19:54) - Video games in the 80s and 90s (22:02) - Epic Games origin story (34:40) - Indie game development (40:34) - Unreal Engine (1:06:30) - Technical details of Unreal Engine (1:11:23) - Constructive solid geometry (1:17:21) - Dynamic lighting (1:21:51) - Volumetric fog (1:25:19) - John Carmack (1:27:05) - Evolution of Unreal Engine (1:33:21) - Unreal Engine 5 (1:44:32) - Creating realistic humans (1:53:41) - Lumen global illumination (1:58:11) - Movies (2:12:53) - Simulating reality (2:25:08) - Metaverse (2:27:44) - Fortnite (2:31:40) - Scaling (2:47:04) - Game economies (2:48:33) - Standardizing the Metaverse (2:56:46) - Verse programming language (3:18:19) - Concurrency (3:25:56) - Unreal Engine 6 (3:30:34) - Indie game developers (3:33:32) - Apple (3:48:12) - Epic Games Store (4:11:03) - Future of gaming (4:17:03) - Greatest games ever made (4:22:39) - GTA 6 and Rockstar Games (4:25:58) - Hope for the future PODCAST LINKS: - Podcast Website: https://lexfridman.com/podcast - Apple Podcasts: https://apple.co/2lwqZIr - Spotify: https://spoti.fi/2nEwCF8 - RSS: https://lexfridman.com/feed/podcast/ - Podcast Playlist: https://www.youtube.com/playlist?list=PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 - Clips Channel: https://www.youtube.com/lexclips SOCIAL LINKS: - X: https://x.com/lexfridman - Instagram: https://instagram.com/lexfridman - TikTok: https://tiktok.com/@lexfridman - LinkedIn: https://linkedin.com/in/lexfridman - Facebook: https://facebook.com/lexfridman - Patreon: https://patreon.com/lexfridman - Telegram: https://t.me/lexfridman - Reddit: https://reddit.com/r/lexfridman

Audio
Transcription

Chapter 1: Who is Tim Sweeney and what is his background in programming?

480.492 - 509.53 Lex Fridman

This is the Lex Friedman Podcast. To support it, please check out our sponsors in the description. And now, dear friends, here's Tim Sweeney. When did you first fall in love with computers, and maybe with programming?

0

510.287 - 529.174 Tim Sweeney

I had a brother, Steve Sweeney, who was 16 years older than me. At some point when I was a little kid, he went off to work in California for a tech company, and he'd gotten one of the first IBM PCs. So for one summer, I think I was about 11, I went to visit him in California. It was my first trip away from my family, just to hang out with him.

0

529.614 - 545.176 Tim Sweeney

He had this brand new IBM computer, and I learned to program over the course of a few days in BASIC. I was just blown away. with the capabilities of computers at the time. It was unbelievable what they could accomplish. And I was hooked from that point onward and very much wanted to be a programmer.

0

545.856 - 553.779 Lex Fridman

Do you remember what you wrote in BASIC? Is it a video game type thing? Is it like for loop, some numerical thing? Do you remember?

0

554.502 - 575.247 Tim Sweeney

Yeah, it's funny. I have a perfectly vivid memory of all of the first things I learned to program. I have a hard time remembering people's names, but code really sticks with me. Every step and every challenge, there were lessons learned. Some of which I've come to realize were just me getting over some learning hurdles, but other things were actually shortcomings of programming languages.

576.767 - 590.42 Tim Sweeney

And the realization that there are actually better ways. And when a programmer is learning to program for the first time, a lot of what they're facing isn't the challenge of learning a new art. It's the friction introduced by failures of programming language design.

590.46 - 598.148 Tim Sweeney

And so I've constantly come back to those early lessons there as I've progressed and done more and more things, including building programming languages.

598.564 - 621.928 Lex Fridman

Yeah, the friction and the pain is the guide to learning in programming. If I were to describe programming journey, that would be marked by pain. And that pain, you shouldn't escape the pain. The pain is instructive for you to understand programming languages. But do you remember what kind of stuff you were writing at that time, just the early programs?

622.296 - 641.79 Tim Sweeney

Yeah, in the early days, I wrote a little bit of everything. I wrote some games. The first game I wrote on the Apple II was, since I only knew how to program in text mode, the computer would throw asterisks across the screen. They'd flow from left to right, and you'd have a parenthesis on the right-hand side of the screen. It looked like a baseball mitt, and you're supposed to catch the asterisks.

Chapter 2: How did Tim Sweeney start Epic Games and what was the origin story of Unreal Engine?

1185.601 - 1193.328 Tim Sweeney

Our worry is increasingly going away as society is ever more protective and sheltering and makes it harder to get these experiences.

0

1194.589 - 1199.854 Lex Fridman

So on the video game side, when did you first fall in love with video games?

0

1200.574 - 1221.383 Tim Sweeney

I've had a funny relationship with games because my real aspiration was has always been to program cool stuff. I get more enjoyment out of programming than anything else in the world. And so my first really too formative experience with games were playing this game called Adventure for the Atari 2600.

0

1222.824 - 1239.511 Tim Sweeney

It was like, you move this dot around the screen and picked up objects like swords and fought dragons and invaded castles and solved puzzles. Very, very simple, iconic stuff, rather than realistic graphics. And then the other game that really got immersed in was Zork, which was a text adventure game.

0

1240.191 - 1257.418 Tim Sweeney

It would tell you where you are and what you see, and you'd type in commands like go north or pick up sword or open door and explore a world that way. So the game didn't have any graphics, but in your mind you had this elaborate picture of what you were seeing there, and it really brought in inspired imagination more than other things.

1257.898 - 1272.504 Tim Sweeney

And playing those games led me to often want to learn to program everything I saw there. And that drove a lot of my programming. I learned how to move a player around the screen. I learned how to, you know, build a design tool so I could build castles and save them off and play them in a game.

1272.544 - 1290.211 Tim Sweeney

And I realized there was a separation between the tools that you use to build a game and the game itself, and that the more powerful tools you had, the more creativity you could unleash in yourself or others. And I learned all the programming techniques that supported games, how to parse text, pick up sword and go north.

1290.231 - 1313 Tim Sweeney

How do you make that sentence into an actual series of commands on the computer? And that was really, really exciting. I have to say, until the time that Fortnite came out, I played video games primarily to learn what they were doing so that I could go off and do it myself. I'd sit down when Wolfenstein came out and then Doom came out. I'd go through and look at it pixel by pixel.

1313.04 - 1322.063 Tim Sweeney

I'd move the mouse very slightly and look at exactly what was happening to figure out what technique was being used there. That was puzzle solving at a grand scale, and it was so fun.

Chapter 3: What were the technical challenges and innovations in early Unreal Engine development?

2015.781 - 2031.229 Tim Sweeney

So we worked with a retail publisher, and they made a box, and they put CD-ROMs in the box, and... And then the world started transitioning back to digitally. And that transition didn't start well. The initial transition of gaming to digital was all bit torrent, all piracy.

0

2032.409 - 2053.323 Tim Sweeney

And there are horror stories about games that would sell like 100,000 copies but have 2 million users because most people pirated it. And then Steam came along and introduced digital distribution and made digital distribution of legit games so convenient that most players moved away from piracy towards that.

0

2053.484 - 2060.03 Tim Sweeney

And their practices were then followed by others, and the early digital industry took form.

0

2060.711 - 2080.37 Lex Fridman

Yeah, it's fascinating. I mean, pirates do lead the way for innovation. The same as the story of Spotify. Basically, I think most people, when they derive value from things like video games, want to pay for those video games. They just want it to be easy. And so the same thing with music with Spotify.

0

2081.811 - 2109.551 Lex Fridman

But maybe just staying on the 90s, there are going to be a lot of indie game developers who listen to us talking today. Can you go back to that mindset and try to derive some wisdom and advice to those folks when you were just a solo developer, maybe just a small group of people creating your early games that eventually became this huge gaming company? But in the early days, what...

2110.853 - 2116.912 Lex Fridman

What were you going through? What were the ups and downs? What did it take to sort of stay strong and persevere?

2118.442 - 2132.747 Tim Sweeney

Well, you know, one of the critical things that Epic always worked hard to do was to make something different that nobody else was doing and to try to satisfy a small audience rather than competing globally with the game juggernauts.

2133.168 - 2150.536 Tim Sweeney

You know, back in the 1990s, Epic was new, but Electronic Arts and Activision and the other big publishers had been around for a decade, and they were huge companies that had giant retail distribution networks If I tried to make a game and then convince them to publish it, I doubt I could have had a chance.

2150.837 - 2169.711 Tim Sweeney

And I doubt that even if I made a successful game, that I would have made much money from it, though they might have. And so the really unique angle to Epic then was shareware. And that was just the idea that if we distribute our game differently, then we can reach a much larger audience than these bigger competitors by virtue of this first episode of the game being free.

Chapter 4: How did Epic Games evolve Unreal Engine over 30 years with changing hardware?

3669.899 - 3691.135 Lex Fridman

And so Nanite is the system we'll jump around in time. That takes us to today with Unreal Engine 5. The system that does the geometry. Yeah. So rendering the world sort of geometrically. There's many layers to this. We'll probably talk, sneak up to each of those. But one, you have to actually create the geometry of the world around you and do that in real time and really efficiently.

0

3691.155 - 3695.679 Lex Fridman

There's a bunch of different ways to optimize that. Can you just speak to it?

0

3696.158 - 3714.754 Tim Sweeney

Yeah, you know, with the advanced art tools we have today, it's really easy to create a scene with billions of polygons. The hard part is how to render it efficiently because you can't render billions of polygons in a frame. Basically, you want to render an image that's indistinguishable from the full detailed geometry if you rendered it at ridiculous cost.

0

3715.555 - 3733.527 Tim Sweeney

And so the challenge is how to simplify every component of the rendering, the geometry, the lighting, and so on, down to real-time techniques. They're efficient. They capture a realistic view of what's around you. And so when an object is up close to you, you want to render it with a lot more polygons than when it's far away.

0

3734.067 - 3755.703 Tim Sweeney

But one of the cool principles of mathematics is the Nyquist sampling theorem. It says if you're trying to reconstruct a signal, there's a limit to the amount of data you need to bother capturing. If you want to render a texture at a certain resolution, then you never need more than twice the pixels in the texture that you have on the screen. And that's called the Nyquist limit.

3756.804 - 3770.633 Tim Sweeney

One of the challenges of computer graphics is given the need to render objects at extreme close-up distances and extreme faraway distances. You always want to be able to generate the right amount of geometry so that you have enough to be indistinguishable from reality, but not any more than necessary.

3772.254 - 3793.815 Tim Sweeney

And with geometry, the idea is that if you render two triangles per pixel, you should get an image that is indistinguishable from reality. thousands of triangles per pixel. If you render less than two triangles per pixel, you're going to start to see visible artifacts of the loss. And GPUs have this amazing hardware in a lot of different pipelines, but it's all very fixed function.

3793.856 - 3812.049 Tim Sweeney

There's pixel shader hardware, there's geometry processing hardware, and then there's triangle rasterization hardware. One of the limits of GPUs is that the triangle rasterizers are built for pretty large triangles. If you're building a triangle or rendering a triangle with 10 pixels, that's pretty efficient. But if you're building or rendering a triangle with one pixel, it's very inefficient.

3812.71 - 3832.345 Tim Sweeney

So one of the breakthroughs Brian made was to design an entire pipeline for avoiding the rasterization hardware in the GPU and just going straight to pixels and calculating what should be done with that pixel as a result of some ray tracing and geometry intersection calculations done in a pixel shader.

Chapter 5: What are the key features and breakthroughs in Unreal Engine 5 like Nanite and Lumen?

4225.557 - 4246.448 Tim Sweeney

But this was one of the critical things that kept Epic going through that three and a half years. We were starting to license our engine out to other developers. Microprose took two licenses, and we got in half a million dollars from that. And the company, GT Interactive, licensed our engine to build... another game, and we got paid for that.

0

4246.688 - 4263.186 Tim Sweeney

We had this revenue stream funding the development of Unreal Engine from other games that were being built by other developers. Because they were the lifeline for the company, we took the engine business very seriously from the start. We set up... mailing lists so that our partners could ask us questions.

0

4263.246 - 4282.696 Tim Sweeney

And all the developers and artists working on our games were participating and helping customers. Everybody took that very seriously because it was our funding source. And that's kind of set this dual spirit of Epic of building technology and supporting game developers simultaneous with building games and supporting gamers. It's continued onward and just grown over time.

0

4283.396 - 4308.552 Lex Fridman

Can you just go back to that, you programming? What are some interesting technical challenges you had to overcome? You mentioned dynamic lighting. Create this three-dimensional world and try to figure out the puzzle of how you actually do that at a time when nobody, Carmack and you, doing this kind of thing. It's a totally open wild west.

0

4308.652 - 4312.875 Lex Fridman

So what are some interesting technical challenges you had to try to solve?

4313.527 - 4340.562 Tim Sweeney

There's a lot. Some of them are visible on screen and some are behind the scenes and still require a lot of innovation. All the graphical techniques were really interesting challenges. An Unreal Engine in those early days went a lot further than the Quake Engine in building environments using constructive solid geometry with a real-time editor. That was a really interesting technical challenge.

4340.802 - 4357.389 Tim Sweeney

The idea is Building is extremely tedious if you are only adding objects to the world. If you want to build a door, then you need to add a dozen different pieces of door frames and add a bunch of different walls together to fit together in the right shape. It sure would be easier if you could just start with a wall and subtract the door out.

4358.951 - 4379.462 Tim Sweeney

And so we had this way of adding geometry to the world and subtracting geometry, and the engine would perform all the calculations on that. And this is something that I'd been anticipating was possible for a long time, but when I finally got around to it, it took this 30-hour coding session to figure out all the special cases of the code that needed to be implemented to make that work.

4381.243 - 4391.831 Tim Sweeney

In the course of 30 hours, I got constructive solid geometry up and running. I started doing, like handed it to James Schmaltz the next time we were together. And it's like, okay, I think you're cheating here.

Chapter 6: How are ultra-realistic humans created using MetaHuman and digital human technology?

4923.206 - 4944.857 Tim Sweeney

Yeah. Well, it's a funny thing. So this graphics hardware company had just started up in Finland, and they released a screenshot of what their GPU was doing, and they showed a scene filled with volumetric fog. So you had a foggy room with some light sources in it. And when that happens in the real world, what you see are glows around the lights as the light brightens the fog around it.

0

4945.257 - 4962.372 Tim Sweeney

But the brightening of the fog diminishes over time because the fog absorbs some lighting. And so the further you get away from the light, the more the more fall off there is. And, you know, you have a bunch of colored lights overlapping together in a space like that. The effect is just absolutely magical. You know, like being out on a foggy light with street lamps above.

0

4962.472 - 4975.126 Tim Sweeney

It's something that's surreal and just beautiful. So it's like, oh my God, they figured out how to do real-time volumetric fog. I have to figure it out myself. And so that was another 30-hour coding session. Nice.

0

4975.226 - 4992.171 Tim Sweeney

But at the core, I realized, OK, what's happening here is we have this lighting function saying that light at a particular point in space is falling off with the inverse square of the light, the distance from the light source. The inverse square is all from Isaac Newton, which applies to lighting.

0

4992.851 - 5007.455 Tim Sweeney

I had to realize was that the way the fog interacted with the light was that you calculate the view from your eye's position to a point on a surface in the world. It's going through fog and you're accumulating more and more light as a function of the amount of light illuminating the fog at that point in time.

5008.035 - 5022.339 Tim Sweeney

And so, well, you know, I'd studied that in mechanical engineering without even knowing it. That's the line integral. You know, you have an integral over a line of some function. Well, this is exactly what it's for. It's for accumulating values of a function over a continuous space and time. And

5023.379 - 5039.104 Tim Sweeney

You know, I did a bunch of math and realized that, oh wow, the integral, and then I looked in a reference book of all of the integrals, and thankfully people had solved them all, and I realized the integral of this transformed 1 over r squared turns out to be solved by the arctangent of r.

5040.544 - 5059.373 Tim Sweeney

And so, you know, if you calculate some parameters based on the position of the eye and the position of the surface point you're ultimately seeing, then you calculate exactly how much fog you can accumulate from that. Of course, you can't do that per pixel because that's hundreds of cycles of CPU time. And so what we had to do is calculate volumetric fog on...

5060.994 - 5086.528 Tim Sweeney

on something equivalent to a light map but uh calculating fog every square meter in the world um and so you know we had enough performance for that built uh volumetric lighting and gave it to the artists and they started building magically detailed levels with volumetric fog and in real time and then um you know decades later i was talking to one of the engineers who'd worked on that hardware and asked about their volumetric fog and told him how it inspired me to um uh

Chapter 7: What is the role of Unreal Engine in film production and storytelling?

5385.199 - 5411.992 Tim Sweeney

And Andrew Scheiderker, a longtime Epic luminary, wrote the core of the Unreal Engine 3 render around real-time pixel shading, real-time lighting, being able to do dynamic shadows using several different techniques, and multi-thread the render to support bits of the early dual-core CPUs that were starting to show up at the time. And it was a massive, massive graphical upgrade.

0

5414.073 - 5424.521 Tim Sweeney

Unreal Engine 4 made a number of improvements and just continued to add features to give artists more and more options for lighting and for geometry that created realism.

0

5426.522 - 5453.923 Tim Sweeney

But then I think probably our biggest single level of leap came with Unreal Engine 5 with Nanite micropolygon geometry solution and with Lumen, the global illumination lighting solution, which I think really bridged the gap from game-ish computer graphics to... total observable photorealism for artists who wanted to create that. And so that's been the evolution.

0

5453.983 - 5473.905 Tim Sweeney

And the progress on the graphics side is absolutely astonishing, as it is on the audio side in a number of other areas. But parts of the engine also haven't changed all that much since the version I wrote and shipped in 1998. You know, the file management system has been optimized a number of times, but it hasn't been completely rethought.

0

5474.906 - 5496.221 Tim Sweeney

And the networking system, the ways that clients and servers talk together and negotiate game state is still an evolution of the thing I wrote. And, you know, it's feeling kind of dated now. You still see networking bugs in Fortnite where, for some reason, when you're spectating, you're not seeing some parameters update. Well, that's because of the lossful nature of that networking model.

5497.342 - 5517.211 Tim Sweeney

And the biggest limitation that's built up over time is the single-threaded nature of game simulation in Unreal Engine. We run a single-threaded simulation. If you have a 16-core CPU, we're using one core for game simulation and running the complicated game logic because single-thread programming is orders of magnitude easier than multi-thread programming.

5517.971 - 5536.246 Tim Sweeney

And we didn't want to burden either ourselves or our partners or the community with the complications of multi-threading. And over time, that becomes an increasing limitation. So we're really thinking about and working on the next generation of technology and being Unreal Engine 6.

5536.326 - 5552.861 Tim Sweeney

And that's the generation where we're actually going to go and address a number of the really core limitations that have been with us over the history of Unreal Engine and and get those on a better foundation that the modern world deserves, given everything that's been learned in the field of computing in that timeframe.

5553.062 - 5576.884 Lex Fridman

That's a terrifyingly challenging engineering problem. And it seems like every version of Unreal Engine, the amazing teams behind it are willing to just throw away most of the code. Yeah. Or maybe I'm being a little bit too dramatic, but basically throw away the old approaches, like you mentioned with Carmack, and start again.

Chapter 8: How is AI expected to impact game development and creative processes in the future?

5829.607 - 5837.973 Lex Fridman

Watch when you add the objects. When you add the textures, the different layering, all the shadows that have to be computed, boy.

0

5838.653 - 5858.429 Tim Sweeney

That shadowing is an amazing thing, but the reason that works is counterintuitive. When somebody first explained it to me, I was like, that's really clever, but I don't think that will work. But it does work, because if you observe the positions of incoming light and you know the Z coordinates of the different pixels on the screen, you can figure out how...

0

5859.13 - 5881.551 Tim Sweeney

your geometry there is likely to include other geometry. And even though it's only an approximation and isn't perfect, it looks perfectly good to the human eye and gives you the subtle shadowing that you see in a scene like this that makes it look highly realistic. And the shadowing influences other things There's also some really interesting things happening with the color here.

0

5882.031 - 5905.536 Tim Sweeney

I'm not even sure what's causing it. It looks like color is bleeding from some parts of the snow onto other parts of the snow. It looks like there's some subsurface scattering going on. I'm not even sure if that's being used. in the scene. And then there's a material layering system for laying down layers of material, dirt and snow and other things, all making that work.

0

5905.576 - 5913.722 Tim Sweeney

And then there's the light bouncing off of the geometry, which is another system for lighting on top of the global illumination system.

5913.962 - 5927.632 Lex Fridman

What about reflections, too? Does that count as the light, so there's a light bouncing off of stuff to light it up in different interesting ways, but then there's also actually literal reflections in like, we're looking at a puddle in the dirt.

5928.294 - 5948.83 Tim Sweeney

Yeah, yeah, that's right. The engine supports a number of different reflection techniques. One is calculating basically textures that reflect, that capture all the lighting in the scene, and then bouncing that off of texture maps so you can see different lights bouncing off of different pixels in different ways. And then there's individual lighting casting reflections off of things too.

5948.91 - 5960.259 Tim Sweeney

And a lot of this is under the control of designers. And one of the things that's yet to do a problem for the future is... You don't just press a few buttons and this kind of scene magically appears.

5960.299 - 5973.73 Tim Sweeney

This is a lot of work from some highly skilled people, not only building out this particular scene, but in setting up the material layers so that you get the dirt with the ice layered on top and all the reflections working. And they had to make a number of technical art decisions to make this work.

Comments

There are no comments yet.

Please log in to write the first comment.