BLOOD BOY


Notes/Post-Mortem

Blood Boy is, of course, based on Super Meat Boy, an extremely difficult 2D platformer. This originally was the first game project that I completed when I started coding in 2013. My goals for this project were to update the old code, use a software renderer, and keep everything in a single executable file. Using a single executable file for everything means that no external files are being read for assets or anything. The art only consists of 2D polygons, squares mostly, so this was pretty easy. I packed two fonts, one large and one small, for drawing the text to screen. This did not cause any problems for development until much later (see Basketball post-mortem). The game uses a simple software renderer, which is loaded with SIMD. The game is rendered to an offscreen backbuffer of a constant resolution, and then stretched to the size of the monitor. The first pass used win32 StretchBlit(), but caused the text to appear kinda choppy. One moment I was proud of: I removed StretchBlit() and was able to write a bi-linear stretch routine to size the backbuffer to the screen while still looking nice. The biggest example of my growth as a developer is the replay system. The original replay system would overflow after about 20 minutes of replay and crash the game. In my thinking, there was no way of knowing how much memory was needed for the system. The Handmade Hero lesson on back-of-the-envelope calculations was very helpful in improving that. Fast forward to today: What's the highest number of attempts I can reasonably expect on a level? 8192. What's the highest amount of time spent I can reasonably expect on a level? 2 hours. Replay information is just a 8-Byte Vector2, so: 2 h * 60 m/h * 60 s/m * 60 fps * 8 bytes/frame = about 3.5 MB, which is a tiny, tiny amount of memory for the whole system. What should happen when we run out of replay time or attempts? At 8192 attempts, no person could possibly care or see the avatar for any of the early attempts, so let's just wrap the counter. And now the replay system is crash free.