Devlog #1 — Writing a raycaster in 2023

<p>Welcome to a devlog for a retro arena FPS I am working on. If you want to know more about the project, go read the&nbsp;<a href="https://medium.com/@nerudaj/devlog-0-embarking-on-a-new-project-948433ca7161" rel="noopener">first devlog</a>. Each Saturday, I am going to share project updates as well as more technical discussion on writing my own engine in C++. This week I want to talk about the core of my Wolf3D-inspired raycaster engine.</p> <p>As I mentioned in the first devlog, my goal is to have an engine that looks like something halfway through between Wolf3D and Doom. This means that while players will only move on a flat plane and everything will be right angles on a grid map, it will have a variable height ceiling to break the visual monotony.</p> <p>Naturally, my original idea was to take the raycaster from Wolf3D, scrap doors and secret areas (as those don&rsquo;t make sense in a fast paced FFA) and extend it a little bit to fit my needs.</p> <p>That is easier said than done. Wolf was created for a platform that supported direct pixel manipulation. I am working with abstracted OpenGL. While I can do software renderer with direct pixel manipulation, I would lose so much performance doing so. Plus if I chose to render vertical stripes, I would have to do a lot of extra computation for texture mapping.</p> <p>Thus I decided to run the raycaster as intended, store the results in a depth buffer of sorts and generate a list of faces out of it. For an untextured meshes, that worked rather well:</p> <p><a href="https://medium.com/@nerudaj/devlog-1-writing-a-raycaster-in-2023-44485b6e0ccc"><strong>Learn More</strong></a></p>