Mise en place

In anticipation of putting all the different rooms into my building, I realized that my map size is way too small. Even more so if I want to make some pretty “background” art around the label building. So I naively just raised the room size and thought that was all I had to do. But when testing the game, it was suddenly extremely choppy. Performance just tanked by doubling room size. But it weirdly made sense to me at that point. The (entire) map gets drawn every frame, so if the map is bigger, there are much more calculations going on every frame. So I needed a solution to raise performance. I confirmed my suspicion, that the issue was less the drawing of the map, but rather the calculation behind the scenes, which transfers the tilemap into an isometric rendering. So I had to limit the number of tiles that get “isometrified”.

After fiddling around for a few hours, I managed to introduce “culling”. Now only the tiles that can actually be seen are checked for their value by the renderer and are consequently drawn. I’m pretty proud that I managed to come up with a solution for this by myself :) Now I can make the map much bigger without losses in performance. I sadly haven’t got the zoom-out-feature working yet, but this culling-approach might need further optimization for zoom-out to work out anyway.

Over the last week I created 1’532 individual (still placeholder) sprites to make up all the rooms and give me the flexibility to make them all look distinct later on. It’s quite mundane work, but I feel like I’m going through it in an efficient way, that let’s me focus on the programming of all the interdependencies soon. I’m very much looking forward to that now… Also, things are prepared now, so that I can create prettier sprites for the rooms in the future.

I made my life worse, but the game better, by having variety in the room shape and size: