Creating a Doom-style 3D engine in C

Creating a Doom-style 3D engine in C

Creating a Doom-style 3D engine in C


In this tool-assisted education video I walk through the creation of a Duke Nukem 3D style software-rendering pseudo-3D engine from scratch.
Topics such as vector rotation and portal rendering are at the core. SUBTITLES ARE AVAILABLE.

This homebrew software-rendering 3D engine supports multistair architecture and non-Euclidean geometry, much like Duke Nukem 3D. The geometry can be tweaked at run time without performance penalties, to create things like ceiling crushers or rotating doors.
For rendering, it only supports single-color floors, walls and ceilings, with optional depth shading. Unlike Duke3D, it also requires that each sector is convex.
So far this engine does not support any dynamic objects, such as health packs or enemies. It also does not support sloped surfaces or parallax ceilings.


Music credits in order of appearance:
– Lunar: Silver Star Story – Lunar Traffic theme (Noriyuki Iwadare)
– Axelay – SPIDERS (Taro Kudou)
– Tales of Phantasia – Final Act (Motoi Sakuraba and Shinji Tamura)
– Tales of Phantasia – Ridge Racer (Shinji Hosoe)
All these video game songs have been transformed into OPL3 songs with homebrew tools and played through ADLMIDI.

Sorry about the fluctuating narration volume. I recorded pretty much every sentence separately over many days, and my microphone was positioned differently at different times, and sometimes it was day, sometimes night, sometimes I had morning voice, etc. I tried to compensate with both manual volume adjustment as well as running a compression filter over it all, but it was only after publication when I noticed how uneven it still is.

My typical workflow for recording the narration involves the following:
1. watching some of the video
2. writing into a text file what I would like to say (from this file, I also make the captions later). Much dialog in the text file comes from the directing script that I wrote before I began any video recording.
3. speaking that dialog and recording using Audacity. I honestly try to speak as naturally as possible. If I stutter or mispronounce some part, as happens many _many_ MANY times with English (that whole language is a frigging tonguetwister to me), I simply repeat the sentence or part of a sentence as many times as necessary until I get it right. Then I listen to it, and delete the flubbed parts until I’ve got the best takes for that text. Typically this involves about two minutes of recording for every 40 seconds of narration. Sometimes I leave a particularly difficult part in out of spite even if it doesn’t sound fluent, such as in this video when I say “particularly” or “it does not even need to be rendered”. In the former, the “rl” is a difficult consonant sequence for me to pronounce, and in the latter, it’s the successive “t” and “d” phonemes and words ending in clusives. Unfortunately having to do the recording in this manner tends to kill natural prosody. I do not use voice synthesizers for reference.
4. if the dialog is shorter or longer than the section of video I was planning this to be narration over, adjust something. From here the editing may branch anywhere, including things like changing the text, or adjusting the playback speed/length/order for clips, or even changing the source code (which requires a new round of video recording).
5. go ahead in the video with step 1

For the record, my native language is Finnish. It has a small set of phonemes similar to Spanish or ancient Greek, and a similar rhythm of vowels/consonants as Japanese. This background is quite a disadvantage for speaking English, considering that a person’s ability to distinguish and to reproduce a language’s defining traits, such as phonemes, rhythm, accent and intonation, is mostly determined by the languages they are exposed to as a toddler.
So, if my bad accent disturbs your harmony, I urge you to disable the sound and use the closed captions instead.

For More Information Watch This Video On Youtube

Tags: , ,