John Carmack Tribute: Build a Wolfenstein Raycaster in JS + Doom BSP and Quake Source Explained
Back To Code
0:00 / 0:00
John Carmack Tribute: Build a Wolfenstein Raycaster in JS + Doom BSP and Quake Source Explained
44 просмотра · 6 дн. назад
Back To Code
276 подписчиков
44 просмотра · 6 дн. назад
A hands-on tribute to John Carmack, the programmer behind Commander Keen, Wolfenstein 3D, Doom and Quake. We look at his code style, his ideas and his contributions, write a Wolfenstein-style raycaster from scratch in JavaScript (live FOV and ray-count tweaks, click-to-build walls), split a level with a tiny BSP tree, and read real excerpts of the GPL Doom and Quake source.
Myth check: the fast inverse square root (0x5f3759df) appeared in Quake III Arena, but Carmack did not write it. Beyond3D traced it to Greg Walsh at Ardent Computer, building on ideas from Cleve Moler.
Code: [add link here]
Chapters:
0:00 Intro
0:26 The journey: Keen to Oculus
1:02 Commander Keen: adaptive tile refresh
1:39 Wolfenstein 3D: ray casting
2:12 Live code: the grid world
2:36 Player and DDA rays
3:02 One ray per column (fish-eye)
3:28 Fixing the fish-eye
3:51 Shading, floor and minimap
4:13 Tweaking field of view and ray count
4:38 Walking and editing the map
5:05 The shape of the program
5:39 Doom: binary space partitioning
6:16 Tiny BSP split demo
6:46 Doom source: R_PointOnSide
7:27 Quake: true 3D and QuakeC
7:58 Quake source: R_RecursiveWorldNode
8:44 id Tech and open source
9:17 Myth: fast inverse square root
9:55 .plan files
10:21 On inlined code
10:56 Functional programming in C++
11:40 Oculus VR
12:14 Lessons from Carmack's code
12:34 References
12:55 Thank you
References:
Masters of Doom, David Kushner (2003)
id Software source releases: https://github.com/id-Software (Wolfenstein 3D, DOOM, Quake, Quake II, Quake III Arena, Doom 3)
John Carmack on Inlined Code (2007 email, 2014 note): http://number-none.com/blow/blog/prog...
Functional Programming in C++, John Carmack (2012, AltDevBlogADay), reprint: https://www.gamedeveloper.com/program...
Carmack's .plan files and QuakeCon keynotes
Game Engine Black Book: Wolfenstein 3D and DOOM, Fabien Sanglard: https://fabiensanglard.net/gebb/
Origin of Quake3's Fast InvSqrt(), Beyond3D: https://www.beyond3d.com/content/arti... and https://www.beyond3d.com/content/arti...
Doom source code history: https://doomwiki.org/wiki/Doom_source...
Source excerpts shown are from id Software's GPL releases, credited on screen. All graphics are original.
#JohnCarmack #GameDev #Raycasting #Doom #Quake #JavaScript #Programming