7DRL Day 4: Exhausted


I lost a lot of sleep last night. I was up a couple of hours later than usual, writing and editing the latest entries of this dev blog. As I settled down to sleep a last, I heard the little Cheagle I'm caring for crashing around in her kennel. Worried, I investigated, found her panting rapidly, let her out, and watched her drink a little water before standing around the back porch. She seemed to be fine (even energetic) and had settled down a bit, so I put her back in her kennel and went back to bed. Then another round of crashing would begin, and this cycle happened a couple more times. Eventually, I concluded she was bored of being cooped up in the kennel. That little snot cost me an extra hour of sleep, and maybe I was a bit too wound up from working late anyway.

So this day began on the wrong foot. Despite getting out of bed at the usual time, I was so underslept that I didn't get to work on my project until about 11 am. After that, I managed a ten pomodoro day of game development anyway. But, if I knew how little progress I was going to make, perhaps I would have stayed in bed.

First up, I decided that I might as well switch over to the Kenney 1-Bit Tileset. I estimated it would take me about 5 minutes. Thanks to the need to find and catalog the right sprites, it took closer to an hour. But it does look pretty and should be more of an asset than a technical burden for the rest of the 7DRL event.


The next thing I did was make sure any fixtures were disposed of when I destroyed a map tile. On a lark, I ended up blissfully refactoring my roguelike characters, items, and such to be instantiated through a static function on the base class. This way, I can assure these things are assigned to the right places in the game and added to all the necessary handling classes. It's both preventing and begging for additional maintenance bloat.

I learned a couple of things. It turns out the Awake method triggers immediately on GameObject instantiation. Also, the pixel-perfect camera's zoom level is best set by changing the reference resolution. Who knew?

Shortly after 2 pm, I was ready to get spooky with the procedural generation. It seems simple enough to make a city spontaneously. Once you have a road, make sure they go in two directions or more. Spawn a building wherever the road doesn't go. The result should be a labyrinth that I can populate with whatever procedural mischief my heart desires, right? I intended to have that all tied up and finished within the first couple of hours of the day.

The mid-afternoon slump hit hard shortly after 3 pm. I shouldered on, sloppily rewriting my city block identity code to have all the logic it would need to pull off this scheme. I replaced my Perlin noise generation with random picks from terrains on a weighted tile list. I rewrote the generation algorithm to poll all components on the generating GameObject.

The eighth pomodoro came and went, and it was time for my second 15-minute break. I caught a second wind and decided to make a mad dash to complete my code and see how it looked. Two pomodoros later, I had my answer.


It looks terrible. Those are supposed to be orderly city streets with sidewalks and lamps around them. My chunk coordinates are overwriting each other, which suggests dividing them by global coordinate number isn't going to work. I think they're reflecting on the origin axis, which would explain why a one-tile-deep sidewalk can end up three sidewalk tiles thick when laid next to another chunk. Those buildings are supposed to be spawning on every corner but aren't.

Sometimes, code works perfectly the first time I write it, but this was not one of those times. I need a significant rewrite. If I had an infinite amount of time, this would be a laughable goof. A fun mystery to puzzle how Mr. Computer is getting it all wrong. However, this is a seven-day roguelike event, and I have three days left. I wanted to wrap up content generation today and focus entirely on the gameplay from here on out. Unfortunately, that's not going to happen.

Get Leerie

Leave a comment

Log in with itch.io to leave a comment.