I have a number of game-related projects, many of which are either small tools or prototypes. Below, I will try my best to detail the nature of my most notable code samples.
CSG to MeshInstance
- This is an addon I've written for the Godot game engine. Using existing functionality in the engine, I've written a tool that lets you consolidate composite shapes built with CSG polygons into one big shape. This comes in handy for baking level geometry without putting too much burden on the engine to perform the boolean operations on individual shapes.
pat2raw
- This is a tool I wrote in Python that reads an obscure sample format made for old Gravis soundcards from the early '90s for MIDI playback. It doesn't export WAV files yet, but it does export raw audio files and outputs the sample rate information to the console.
pyBlockmap
- This is a library written in Python that provides spatial hashing functionality for use in 2D games. All it requires is that the locus vectors passed to its functions contain an X and a Y field.
TypeCaster
- This is a raycaster written in TypeScript. It is mostly an adaptation of Lode's raycasting method, using the concept of a camera plane and vector math to facilitate calculating the perpendicular distance between the camera and the point of intersection, avoiding extra calculations in trying to fix the fish-eye effect.
Wolfenstein 3D Adlib Sound Player
- This is less of a tool, and more a functional prototype to see if I can read and play sound effects that were designed for the Yamaha YM3812 chip, as heard in games such as Wolfenstein 3D, Blake Stone, and Duke Nukem II. Implemented in really non-idiomatic C++, it utilizes the SDL-Mixer and DosBox OPL libraries to handle playback.
WolfMapLib
- Another Wolfenstein-3D-related project, this C# library allows one to read Wolfenstein 3D map files from any Stream object.
aw3dc
- This is a WIP attempt at creating a Wolfenstein 3D clone in pure C99. It uses Raylib for rendering and multimedia, and The Nuked OPL3 emulator for music playback. To my knowledge, I am the first one to have hooked up the Nuked OPL3 Emulator to Raylib's audio interface. It took a couple tries, as data-munging-heavy tasks and low level audio streaming do, but it works with no stuttering or weird stuff.
KinematicBody++
- A class for Godot 3 that fixes a couple issues with the KinematicBody node. The most important of which was stopping the physics body from slowly sliding down slops when not moving, even if the checkbox "don't slide on slopes" was checked in the node inspector. Much of this was done by studying Godot's C++ implementation of the KinematicBody node, porting it over to GDScript, then adjusting where I needed to. This issue no longer occurs in Godot 4, thankfully.
pyUDMF2JSON
- A tool written in Python that converts UDMF (Universal Doom Map Format) map files to JSON. This was originally going to be used for my personal game project as a means of describing level geometry. Instead of writing a parser for UDMF, I thought that it would be smarter to convert them to JSON offline, as JSON parsers are either built into standard libraries for many languages, or are very common as third-party libraries, therefore allowing me to read Doom maps described as UDMF/JSON in any project of my choice, so long as I have a JSON parser.
GZDoom Palette Shader
- A collaboration with lead GZDoom co-developer Rachael Alexanderson, this is a postprocessing mod for GZDoom that downmixes the truecolor viewport to a palette of 256 colors using your choice of ordinary color matching, Bayer dithering, or HSL blending. Written in GLSL and ZScript , what sets this mod apart from the others is that it exploits a trick in GZDoom that automatically downmixes graphics to the Doom palette before palette swapping. When a meaningless/empty palette swap is given to a texture, it is still downmixed. Feeding a 24-bit truecolor LUT to GZDoom's texture compositor using this trick will essentially offload the color matching to the CPU instead of the GPU. The end result is a retro-feeling effect, with the color banding and color quantization happening much more gracefully.
Footstep Mod for GZDoom
- A mod that adds footstep sound effects to GZDoom.
Bullet Tracer Library for GZDoom
- This library, using GZDoom's particle system, adds functionality for bullet tracers. Featured in mods such as BulletZBorn, Scalliano Shuffle, and an untold amount of other mods.