Skip to content
Menu
Mob City
  • Home
  • Contact
  • About
Mob City
MOB CITY
Step into the 1920s, an era of speakeasies, smuggling, and syndicates. Manage your crew, bribe officials, and outmaneuver rival gangs in this crime empire management sim

Y-Sorting in Isometric Games

Posted on November 1, 2024

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…

Continue Reading

Moving to OpenGL: Instance Rendering with ModernGL

Posted on October 19, 2024

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…

Continue Reading

Rendering with SDL2

Posted on October 9, 2024

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…

Continue Reading

Non-linear relationship between FPS and frame-to-frame time interval (Δt)

Posted on October 6, 2024

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…

Continue Reading

Optimizing Rendering by Blitting Visible Entities Only

Posted on October 5, 2024

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…

Continue Reading

FPS and a Quick Map POC: Blitting Buildings, and NPCs

Posted on November 27, 2023

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,…

Continue Reading

Isometric Projection

Posted on November 20, 2023

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…

Continue Reading

Making My Own Gangsters Strategy and Management Sim

Posted on November 10, 2023

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…

Continue Reading

Recent Posts

  • Y-Sorting in Isometric Games
  • Moving to OpenGL: Instance Rendering with ModernGL
  • Rendering with SDL2
  • Non-linear relationship between FPS and frame-to-frame time interval (Δt)
  • Optimizing Rendering by Blitting Visible Entities Only
©2025 Mob City