James Randall Musings on software development, business and technology.
Wolfenstein 3D

You can play the game online here.

Back in early 2022 I’d been making one of my regular revisits to 90s videogaming and spent a fun couple of hours playing Wolfenstein 3D by iD Software. I still have vivid memories of downloading and playing this back in 1992 from a BBS. I lived with my parents at the time (I’d have been 16) and I remember running round the house proclaiming “this changes everything, this changes everything”. Nobody cared!

Inspired by the game I had a crack at figuring out what it was doing and writing a raycasting engine using Turbo C. I got something working but it ran at a snails pace and had a strange fisheye effect.

For whatever reason while playing Wolfenstein 30 years later the itch started to itch and I decided I have to have another go. I didn’t set off with the intention of recreating the game and first I just tried to write the simplest raycaster I could:

Simple raycaster

Just plain walls, nothing clever. The source for this can be found on GitHub: https://github.com/JamesRandall/fsharp-simpleraycaster

Next I moved on to adding textures:

Simple raycaster with texture

Again the source for this can be found on GitHub: https://github.com/JamesRandall/fsharp-simpleraycaster-textured

It was at this point that I decided to go a lot further and recreate the game for which the full source can also be found on GitHub: https://github.com/JamesRandall/fsharp-wolfenstein

If you want to learn more about how it works, including how to avoid a fisheye effect, I did a talk at JetBrains .NET Day 2023 which you can watch on YouTube:

I also began, but didn’t quite finish, a C# version using Blazor. There are a number of blog posts on this very website about that and you can find the source for that here: https://github.com/JamesRandall/csharp-wolfenstein