Category Archives: C/C++

Timeslicing Batched Algorithms in Games

This post is part of my Game Programming Series. The source files for generating the animations in this post are on GitHub. A very useful technique to improve the performance of batched algorithms (multiple instances of the same algorithm) is … Continue reading

Posted in C/C++, Gamedev, Programming | Leave a comment

Game Math: Precise Control over Numeric Springing

This post is part of my Game Math Series. Source files are on GitHub Check out this post if you want to see more visual examples of numeric springing. Numeric springing is a very powerful tool for procedural animation. You … Continue reading

Posted in C/C++, Gamedev, Math | 9 Comments

Safe Scope-Based Instrumented Profiler

Let’s say we have an interface for an instrumented profiling library that looks like this: The argument you pass to BeginBlock is a custom block name for you to identify the block in the profiler output. You call BeginBlock at … Continue reading

Posted in C/C++, Gamedev | 2 Comments

Scope-Based Resource Management (RAII)

This post is part of my Game Programming Series. It has been 4 months since I graduated from DigiPen and started working at Naughty Dog as a Game Programmer. Since then, I have been too lazy to write anything big … Continue reading

Posted in C/C++, Design Patterns, Gamedev | Leave a comment

Intrusively Linked Lists with Safe Link Destruction

This post is part of my Game Programming Series. My current game project at DigiPen greatly benefits from “smart” intrusively linked lists that support multiple links per object and automatic link removal from lists upon destruction. My implementation was inspired … Continue reading

Posted in C/C++, Gamedev | 5 Comments

Memory Management part 3 of 3: STL-Compatible Allocators

This post is part of my Memory Management Series. In part 1 and part 2 of this series, I showed how to implement a fix-sized memory allocator and a C-style interface. Part 3 will demonstrate how to make an allocator … Continue reading

Posted in C/C++, Gamedev | 1 Comment

Memory Management part 2 of 3: C-Style Interface

This post is part of my Memory Management Series. In part 1 of this series I showed how to implement a memory allocator that allocates fix-sized pages and blocks. Part 2 is going to cover how to implement a C-style … Continue reading

Posted in C/C++, Gamedev | Leave a comment

Memory Management part 1 of 3: The Allocator

This post is part of my Memory Management Series. Why Bother Building Your Own Memory Management System? Memory management is crucial for game development. It is even more important for console game development, since consoles have hard memory limits. Many … Continue reading

Posted in C/C++, Gamedev | 5 Comments

My Mutex Implementation

There are already lots of well-known and popular libraries out there that provide mutices. But I wanted to try implementing it myself for the sake of just making it. Hey, it’s summer session at DigiPen and I don’t have to … Continue reading

Posted in C/C++ | 1 Comment

Signal System using Delegates

I introduced how to build your own C++ delegates in the previous post. Now I’m going to show you the first practical (and probably the most common) usage of delegates: signal/event systems. To clarify the terminology, the mapping between the … Continue reading

Posted in C/C++ | 3 Comments