• Cursed C: Catching access violations

    Demystifying SEGFAULT, and using standard C functions to catch and even recover from it… even if it may induce memory leaks and undefined behavior.

  • Hot reloading: dllimport

    In this deep dive: How do cross-DLL function calls work, what do dllimport and dllexport do under the hood, and why does my compiler keep producing .libs next to my .dlls?

  • Cursed C++: public_cast

    Ever needed to use some obscure library function only for it to be private? Meet public_cast, an abomination unto good code that can see almost everything. Did I mention it’s standard-compliant?

  • Hot reloading: bytecode analysis

    In this deep dive: CPU architecture basics, predicting function outcomes without calling them, and intercepting malloc.

  • Hot reloading: polymorphism

    The most fundamental problem of unloading and reloading code is that it can move–its contents, or the entire image. In this deep dive: vptrs, compiler design, and deducing object memory layouts.

  • Wave Function Collapse

    Wave Function Collapse is a procedural content generation algorithm that uses an extension of constraint solving. For example, a cell’s possible values might be constrained by the cells adjacent to it, or there might be a global limit like only allowing one boss room and 2-4 treasure rooms per floor. This is not to be…

  • Influence Maps, Ants, and Flocking

    An influence map is a grid-like data structure where each cell carries information about its surroundings. This is typically in terms of threat or safety, whether that be cover or line of sight on a target, squad cohesion or separation, range of potential attacks, or even emergency evasive action against incoming attacks. This makes it…

  • Flow Fields

    Flow fields are a technique applicable when many units need to pathfind to the same location. It is an extension of traditional pathfinding algorithms, but instead of only calculating one path per unit it calculates a path for every cell on the grid, reusing information from other known paths. This has a high immediate cost,…

  • Flocking and Context Maps

    An AI that flocks, explores its environment, and avoids collisions with static and dynamic objects.

  • Introduction to Context Maps

    An AI that explores its environment while avoiding collisions with static obstacles and other agents.

  • Platformer analysis: Generating graphs for pathfinding

    Overview To create this algorithm, I first looked at how NavMeshes work. We can’t add all possible points on the mesh, since those are effectively infinite, so instead we simplify polygons into single nodes, and connect those that have a common edge. After processing this with our pathfinder, we can interpolate the details. Simplifying this…

  • Devlog: Dialogue system in Unity

    Whether in games or more traditional media, it’s hard to tell a story without any verbal or written interaction. Oxford Languages defines a conversation as “a talk […] between two or more people.” To decompose this into something more technical: A conversation is a sequence of exchanged words between two or more participants. Unity provides…

  • Devlog: Physics-based character controller

    Like many systems, the systems by which a player moves have facets and layers of complexity, built on a layer of physics such as gravity and collision response. For the most basic implementation, the collision response facet is matched by a movement facet that turns input directly into in-world horizontal motion, after scaling by some…