In isometric games, rendering order is crucial. Objects closer to the camera should appear in front of objects further away. This is where Y-sorting comes in—it ensures that when drawing sprites, the objects in the back are rendered first, and those in the front are drawn last. Without proper Y-sorting, objects can overlap incorrectly, breaking…

Moving to OpenGL: Instance Rendering with ModernGL
After trying blitting and SDL2 rendering in Pygame, it was clear that neither would be enough for large-scale NPC rendering. Even with optimizations like culling non-visible NPCs, FPS would drop too fast as soon as I started adding animations or game logic. So, I finally switched to instance rendering in OpenGL using ModernGL, and the…

Rendering with SDL2
As blitting in pygame turned out to be not enough, it’s time to see how pygame’s experimental SDL2 module compares. When comparing FPS between the two approaches, it’s important to keep in mind the non-linear nature of FPS. Also, worth noting that as of writing this SDL2 module in pygame is still in development/experimental. Pygame’s…

Non-linear relationship between FPS and frame-to-frame time interval (Δt)
Before I implement SDL2 rendering, it’s worth reminding ourselves what FPS actually is and how it is measured as this is the metric I’ll be using to benchmark performance. It’s important because you can’t compare FPS gain from 30 to 60 against a gain 300 to 330. FPS (Frames Per Second) refers to how many…

Optimizing Rendering by Blitting Visible Entities Only
A few months ago, I optimized blitting a lot. But wasn’t really satisfied with the results. I thought of giving up on pygame entirely. Yes, there is that experimental SDL2 wrapper to try but I was a bit disappointed with pygame’s rendering capabilities altogether so didn’t pin my hopes to it. I went looking for…

FPS and a Quick Map POC: Blitting Buildings, and NPCs
So, I threw together a quick map proof of concept and some mechanics for populating it with buildings and randomly spawned NPCs. Then I implemented a camera system with zooming, and honestly? It was way easier than I expected. Barely took any code at all. Python’s ability to iterate fast is an absolute game-changer. But,…

Isometric Projection
To get thst old school early 2000s isometric charm, I’ve been messing around with Pygame to render isometric tiles and buildings in orthographic projection. Isometric, and orthographic projections are ways to represent 3D objects in 2D. Orthographic means no perspective distortion, and isometric is a specific type of orthographic projection where the angles between axes…

Making My Own Gangsters Strategy and Management Sim
I first picked up a copy of Gangsters: Organized Crime in 1999, and it instantly clicked with me. Something about the mix of strategy, management, and that gritty 1920s underworld aesthetic kept me coming back to it every few years. Then, in 2016, I had a thought—what if I made my own version? Something that…