Key Moments

John Carmack: Doom, Quake, VR, AGI, Programming, Video Games, and Rockets | Lex Fridman Podcast #309

Lex FridmanLex Fridman
Science & Technology9 min read315 min video
Aug 4, 2022|1,811,833 views|43,520|3,937
Save to Pod
TL;DR

John Carmack discusses his programming journey, game development, VR's future, and the quest for AGI.

Key Insights

1

Early programming was driven by resource limitations, fostering innovative 'hacks' to achieve desired performance, a skill still relevant in cutting-edge tech like VR.

2

Carmack views programming as problem-solving for user value, stressing deep understanding of the full tech stack over pride in specific architectural choices.

3

C++ remains his preferred "serious programming" language, despite Python's convenience for AI/ML and the surprising robustness of simpler languages like C and Go for long-term projects with large teams.

4

The 'hacker ethic' of sharing knowledge and celebrating others' accomplishments deeply influenced Carmack, leading to the open-sourcing of id Software's game code.

5

Wolfenstein 3D pioneered immersive 3D experiences by leveraging clever technical shortcuts (ray casting, compiled scalers) that profoundly impacted player psychology.

6

Quake represented a bold leap into true 3D, network multiplayer, and moddability, but Carmack regrets not splitting its ambitious innovations into two separate games for a more pragmatic development cycle.

7

The metaverse, as envisioned by Carmack, is built by creating compelling, beloved experiences that incrementally expand capabilities, drawing parallels to Minecraft and the early modding communities of Doom and Quake.

EARLY PROGRAMMING AND THE MAGIC OF COMPUTERS

John Carmack's fascination with computers began in childhood, ignited by the simple act of writing "10 PRINT John Carmack GOTO 1" on a TRS-80. Lacking interaction with established programming cultures, he learned by devouring books and articles, driven by the magical idea that a computer would execute commands precisely. His early programming was almost exclusively focused on making games, inspired by arcade machines and Atari. This pursuit led to his first major technical 'hack' on Apple II computers, creatively manipulating hardware to achieve vertical screen scrolling, a technique that foreshadowed later innovations in id Software.

THE PHILOSOPHY OF PROGRAMMING AND LANGUAGE PREFERENCES

Carmack emphasizes that programming's ultimate goal is to generate user value. While acknowledging the joy of "code golf," he stresses that the real metric is creating products that genuinely improve users' lives or provide entertainment efficiently. He cautions against over-abstracted C++ and highlights the long-term maintainability challenges in large projects. Despite Python's convenience for AI/ML, C++ remains his choice for serious programming. He appreciates the simplicity of languages like C and Go for their ease of onboarding and broad utility, especially in large organizations like Meta where diverse programming backgrounds are common.

THE PERILS AND PITFALLS OF GO-TO STATEMENTS

The infamous 'goto' statement, often reviled in programming, finds nuanced use in Carmack's philosophy. While acknowledging its potential for spaghetti code in early BASIC programs, he posits that it can be the correct solution when language features are missing, such as nested breaks. Carmack, though, rarely uses 'goto' in his current codebases, finding its necessity to be a symptom of missing language capabilities. He suggests that the closer one gets to machine code or hardware-level programming, the more these 'hacks' become practical due to limited high-level features.

OPTIMIZATION: THE ART OF MAKING THE IMPOSSIBLE POSSIBLE

For decades, Carmack's programming work revolved around making desired functionalities happen "two to ten times faster" than straightforward approaches. He notes that modern computers have largely nullified the need for extreme low-level optimization in many contexts, allowing developers to create ideas naively. However, he believes that pushing the limits of current systems, particularly for immersive experiences like VR, still demands operating at the edge of performance. Carmack is willing to sacrifice efficiency in one area for significant gains in another, viewing resource constraints as a catalyst for radical innovation, much like in his early work with game scrolling techniques.

DEVELOPER TOOLS AND THE POWER OF INTROSPECTION

Carmack strongly advocates for robust developer tools, particularly debuggers and static analyzers, contrasting their utility with the 'hostility' towards them in some large tech companies relying on command-line editors. He considers a debugger an essential window into complex systems, allowing for iterative exploration and rapid problem-solving, even before recompilation. His own experience of rigorously scrubbing id Software's code with static analysis tools revealed numerous hidden errors, cementing his belief that automated guardrails are crucial, as human programmers inherently make statistical mistakes. This mindset extends to using asserts for maintaining code integrity and flagging worldview shifts within a program.

WORK ETHIC, BALANCE, AND THE PURSUIT OF MASTERY

Carmack consistently maintained a dedicated work ethic, often working 60-hour weeks for decades, believing that sustained hard work is essential for significant accomplishment. While he never experienced burnout, he acknowledges that his multi-faceted interests and ability to switch tasks contribute to his sustained enthusiasm. He prioritizes eight hours of sleep but dismisses the notion that productivity sharply declines after 40 hours, arguing that increased effort, when driven by passion, leads to greater output. He views deep dedication as a path to true craftsmanship, where sustained effort not only produces more but also refines one's skills, making one better in the long run.

NUTRITION, RITUALS, AND THE PROGRAMMING ENVIRONMENT

Carmack admits to a pragmatic, rather than meticulous, approach to nutrition. His defining marker of financial success in earlier days was the ability to buy pizza whenever he wanted, leading to a daily pizza delivery tradition at id Software for years. Beyond food, his personal programming ritual centered around Diet Coke, the act of opening a can signaling a shift into focused work. His physical setup is relatively modest, favoring triple monitors for screen real estate over exotic keyboards. He values an IDE with powerful debugging and visualization tools, asserting that an interactive environment aids deep code understanding more effectively than mental simulation or command-line debugging.

THE PLAN FILE: A PREMONITION OF BLOGGING

During his time with NeXT systems, Carmack adopted the Unix 'plan file' tradition – a simple text file in a user's home directory visible to others via the 'finger' command. He transformed this into a detailed daily worklog, interspersed with technical insights and philosophical essays. This became an accidental 'proto-blog,' attracting a dedicated following who tracked id Software's progress. Looking back, Carmack sees flaws in his early thinking regarding business and team management but remains proud of his technical foresight. The plan files ultimately served as a historical record, revealing the evolution of his ideas and the challenges of early game development.

THE BIRTH OF ID SOFTWARE AND THE SHAREWARE REVOLUTION

Carmack's journey to id Software began with contract programming at Softdisk Publishing, where he met John Romero and Adrian Carmack. Inspired by Romero's extensive game development experience and a shared passion for programming, they were drawn to Scott Miller's Apogee Software and its innovative 'shareware' model. This strategy offered the first episode of a game for free, with users paying for the full trilogy. This approach, though initially met with skepticism, proved immensely successful, generating substantial revenue and passionate fan engagement, fundamentally shifting their perception of indie game distribution.

COMMANDER KEEN AND THE SCROLLING GAME BREAKTHROUGH

Driven by a desire to bring console-style scrolling to PC games, Carmack developed two distinct scrolling techniques. The first, 'adaptive tile refresh,' redrew only changing portions of the screen, making action games viable on limited hardware. This led to an all-night coding session to clone the first level of Super Mario 3, a demo so impactful it convinced the team to form id Software. A later, simpler 'page-flipping' technique, which cleverly exploited hardware memory quirks, dramatically improved scrolling speed. While brilliant, this unconventional approach led to compatibility issues with newer Super VGA cards that didn't behave as expected, highlighting the risks of pushing hardware limits.

WOLFENSTEIN 3D: IMMERSION THROUGH INNOVATIVE RENDERING

Wolfenstein 3D revolutionized gaming with its immersive first-person perspective, largely by building upon the 2D map and character logic of earlier games like Catacombs. The shift from a God's-eye view to an 'inside' perspective, even with limited 3D (scaled sprites, no true pitch), elicited unprecedented visceral reactions from players. Carmack's solution to the complex textured wall rendering in Catacombs 3D was a highly optimized assembly-level 'ray casting' engine for Wolfenstein, which, though not the fastest, provided rock-solid performance. The other key innovation was 'compiled scalers,' pre-optimized routines for drawing character sprites at various sizes, ensuring smooth performance even for large, close-up enemies.

DOOM: UNLOCKING CREATIVE FREEDOM AND MODDING

Doom marked a significant leap beyond Wolfenstein's creative limitations. Carmack implemented "binary space partitioning" (BSP) trees, learned while porting Wolfenstein to the Super Nintendo and working on an RPG for Raven Software. This technology allowed for free-form geometry, sloped floors/ceilings, and arbitrary angles, breaking free from the 90-degree tile grid. BSP trees provided efficient object ordering for rendering, crucial for Doom's dynamic lighting and complex environments. Doom was also designed from the ground up for user modding, with 'WAD' files allowing non-destructive content additions, fostering an explosion of community-created levels and modifications that extended the game's life and impact.

QUAKE: AMBITION, STRESS, AND THE METAVERSE PRECURSOR

Quake represented Carmack's most ambitious project, aiming for a true 3D, six-degrees-of-freedom engine with advanced lighting (surface caching), a dedicated scripting language (QuakeC), and internet-enabled client-server multiplayer. This grand vision pushed the team to its limits, causing significant stress and delays. Carmack later regretted not splitting these innovations into two separate games. Despite the challenges, Quake's technical prowess, particularly its graphics and moddability, made it a groundbreaking title. It solidified id Software's vision of an interconnected virtual world, echoing concepts from Neil Stephenson's 'Snow Crash' and setting the stage for future metaverse discussions.

HUMAN DYNAMICS AND THE LEGACY OF ID SOFTWARE

Carmack reflects on the early animosity with John Romero, attributing it partly to id Software's initial equal partnership structure, which didn't account for differing work ethics. He admits to immaturity in handling these tensions, acknowledging that a different framework might have allowed more people to contribute effectively. Despite the professional parting, Carmack expresses admiration for Romero's polymathic talents in programming, design, and art. He maintains a cordial relationship, highlighting their shared love for game development. He also celebrates the success of former colleagues like Tom Hall, who is now creating successful VR games, affirming the enduring impact of id Software's original vision.

FROM GAMING TO THE FUTURE: VR AND AGI

Carmack believes the metaverse will be built by creating compelling, widely loved experiences, expanding on the successes of games like Minecraft and Fortnite, rather than by a top-down, capability-first approach. His work at Oculus VR (and later Meta) was driven by this vision, aiming to create increasingly immersive and accessible virtual worlds, particularly on mobile chipsets. Looking ahead, Carmack is now shifting his focus to Artificial General Intelligence (AGI), acknowledging that achieving it will likely involve a combination of strategic 'smoke and mirrors' (like early game development techniques) and fundamental theoretical breakthroughs, emphasizing a pragmatic, problem-solving approach over philosophical debates.

Common Questions

John Carmack's first program was '10 print John Carmack' on a Radio Shack TRS-80 computer. He then learned to use 'goto 1' to make his name scroll off the screen, which sparked his love for programming.

Topics

Mentioned in this video

Companies
id Software

Co-founded by John Carmack, notable for revolutionizing gaming technology with titles like Commander Keen, Wolfenstein 3D, Doom, and Quake.

Meta

The company formerly known as Facebook, where John Carmack worked on VR/AR and still consults as CTO, investing heavily in the metaverse vision.

Radio Shack

Electronics retailer where John Carmack first encountered computers and wrote his first programs on TRS-80 systems.

SpaceX

Aerospace manufacturer founded by Elon Musk, admired by Carmack for its ambitious goals and Elon's deep technical involvement.

Microsoft

Carmack discusses Microsoft's initial 'terrible' D3D API, which later improved, and acknowledges their growth track and role in the industry.

Softdisk Publishing

An early employer of John Carmack, a unique company with a monthly subscription software model before widespread internet, where Carmack did contract programming.

Apogee Software

A game publisher known for its successful shareware model in the early days of PC gaming, which partnered with id Software for Commander Keen.

Google

Mentioned in the context of efficiency challenges in large tech companies and their tendency to cancel projects.

Armadillo Aerospace

John Carmack's personal aerospace company, which he funded with his own money, contrasting his commitment level with Elon Musk's all-in approach.

Neuralink

Elon Musk's neurotechnology company, suggested by Carmack as a potential avenue for linking animal intelligence with human communication.

DeepMind

An AI research laboratory notable for its general learning progress in game situations and breakthroughs like AlphaZero and protein folding.

Roblox

A game construction kit aimed at kids, cited as a successful capability-first play in the virtual world space, achieving significant scale.

Tesla

Elon Musk's electric vehicle and clean energy company, mentioned in the context of self-driving car development and its pragmatic approach to AI.

Twitter

Social media platform, mentioned as one of Elon Musk's many ventures, raising concerns about him being stretched too thin.

OpenAI

An AI research organization that attempted to recruit John Carmack, and whose early progress greatly influenced his interest in AI.

Waymo

A self-driving technology company, noted for its interesting progress in autonomous driving, though with a different approach than Tesla's data-hungry method.

Software & Apps
Quake

A highly influential first-person shooter by id Software that introduced a true 3D engine, advanced lighting, in-game programming, and client-server multiplayer.

C++

John Carmack's preferred language for 'serious programming', often used in a 'C-flavored' style, appreciating its ability to build large systems despite its complexity for handovers.

Python

A language John Carmack uses for AI/ML work, acknowledging its convenience and quick development capabilities but noting its significant performance inefficiencies for raw computation.

Go

A language developed by Google, praised by Carmack for its simplicity and ease of use, similar to C, making it popular for rapidly onboarding programmers.

Rust

A modern programming language mentioned by Carmack, which he has limited experience with but is widely discussed for its safety and performance features.

JavaScript

A widely used language that runs much of the world, whose underlying engineering is phenomenal despite its non-optimal aspects for large applications due to lack of type systems.

Visual Studio

Microsoft's integrated development environment, preferred by John Carmack for its powerful debugger features which he considers crucial for understanding complex systems.

GDB

A command-line debugger on Linux/Unix platforms, which Carmack notes is often only used by programmers at their wits' end due to its unfriendly interface.

NextStep

An operating system developed by NeXT, founded by Steve Jobs, which id Software adopted for its stable UNIX-based development platform and amazing graphical interface.

Objective-C

The programming language used by NeXT, which had elements that later became part of macOS development and its tools.

OpenGL

An open standard graphics API championed by John Carmack, crucial for mobile industry acceleration before the rise of Metal and Vulkan.

Direct3D

Microsoft's proprietary graphics API, initially 'terrible' but later improved, which competed with OpenGL.

Google Cloud

A cloud computing service offering GPUs, which Carmack used for his AI experiments, but found he was underutilizing due to psychological barriers.

Minecraft

A highly successful modern game with massive user-generated content, an example of a 'Turing complete design' space.

Zoom

A video conferencing software known for its usability and high-quality experience, which VR meeting platforms aim to surpass.

People
Elon Musk

Founder of SpaceX and Tesla, whom John Carmack respects for his deep technical involvement and willingness to commit entirely to ambitious projects like space exploration and electrification.

Steve Jobs

Co-founder of Apple and NeXT, admired by Carmack for his passionate leadership and micro-management in design, although Carmack noted his technical limitations.

John Romero

Co-founder of id Software, regarded by Carmack as a polymath with skills in programming, design, art, and sound, but also notes differences in work ethic which led to their parting ways.

Tom Hall

An editor at Softdisk publishing and later co-founder of id Software, credited by Carmack as the main creative mind behind early id Software games like Commander Keen.

Scott Miller

Founder of Apogee Software, who saw the potential in id Software's games and championed the shareware model, initially contacting John Romero via 'fan mail.'

Richard Garriott

Founder of Origin Systems, mentioned as one of the game hackers from the formative book 'Hackers'.

Bruce Naylor

One of the original researchers who developed BSP trees, whom John Carmack later met while working on Quake.

Michael Abrash

A strong programmer and graphics expert hired by Carmack at id Software, instrumental in optimizing Quake's challenging graphics engine.

Ilya Sutskever

Co-founder and Chief Scientist of OpenAI, who provided John Carmack with a reading list that helped him kickstart his understanding of modern AI.

Joe Rogan

Podcaster and comedian, who considers Quake a definitive part of his life, and whom Carmack mentioned discussing martial arts with.

Jeff Atwood

Co-founder of Stack Overflow, with whom John Carmack has a $10,000 bet regarding the widespread adoption of level 5 self-driving cars by 2030.

Sam Altman

CEO of OpenAI, who attempted to recruit John Carmack, inspiring his deep dive into machine learning literature.

Andrej Karpathy

Former Director of AI at Tesla, admired by Carmack for his programmer-centric approach to machine learning, blog posts, and educational work, whom Carmack has offered to work with.

Carlos Machado

A Jiu-Jitsu instructor with whom John Carmack trained for years, noted for his fluid, 'flow like water' style of grappling.

More from Lex Fridman

View all 159 summaries

Found this useful? Build your knowledge library

Get AI-powered summaries of any YouTube video, podcast, or article in seconds. Save them to your personal pods and access them anytime.

Try Summify free