RSSAmplifier

Blog

Randy Gaul’s Game Programming Blog

C++ and Games development discussion and ideas

randygaul.github.ioRSS feed ↗10 posts

Latest posts

AI Assisted Coding

I recently had an AI implement a brand new lighting algorithm from a 2025 white paper, one-shot, producing visible soft-shadows and constant-time global illumination on the first try. Before that it one-shot an entire compute shader backend for my game engine. Tasks that used to take months took under an hour.

2D Rendering with SDF’s and Atlases

Sprite Packing

Data Structures in C and Allocating

I’ve been researching ways to make C more ergonomic. After years of trial and error, I’ve found that the most maintainable code is typically pure, portable C. However, one major pain point keeping me in C++ is simplifying user code when dealing with data structures. While C++ allows defining classes with custom semantics, C lacks that kind of flexibility—or so I thought.

Game Math 101, Writing your Own 2D Math in C++

Do you want to make a game but don’t know any math? Do you want to skip endless hours of reading arcane math texts and go straight to the useful stuff? Good! Me too. Let’s just skip straight ahead to the useful stuff. Sit back, grab yourself a lunchable, and get ready to become a wizard.

Datastructure APIs in C++

Designing a great data structure API is mostly a grey area with lots of room for opinions. Why care about my opinion? Well, take a peek at some of my headers on GitHub. If you think they might look useful or interesting upon first glance, then read on, as all those headers were written with the ideas here in mind. Here are my major priorities for a data structure API to tackle, listed with the…

Collision Detection in 2D or 3D – Some Steps for Success

These are my personal opinions about recommended readings for collision detection in either 2D or 3D. This post is intended to act as a jumpstart in order to avoid endless swaths of outdated, poorly written, or otherwise incorrect information.

Base64 Encoding in C

Base64 encoding has this nice feature where the encoded information is safely copy-pasteable and stored as plaintext in files. It uses numbers represented in Base64 with a limited character set. Here’s the table from RFC 4648.

Error Codes and Error Handling

There is a longstanding and ongoing debate in the industry on whether exceptions or error codes are superior when it comes to handling and report errors. I will share my opinion.

Hash Tables, Sorting, and Security

I’d like to recommend Mattias Gustavsson’s hash table he has open sourced on github. The implementation stores a few arrays, the most interesting one is a layer of indirection between mapping hashes to key/value entries.

Virtual File Systems in Games!

After a particularly elucidating conversation with Mattias Gustavsson on Twitter, I came to the delightful realization that a well utilized virtual path system can be make writing games a lot more fun. This blog post describes some basic, but strong, benefits in favor of using a virtual file system, as opposed to using the OS’s native file system alone.