Microcraft-Rat

Historical Context

Beginning in the summer right after high school graduation in July 2021 and spanning over three months, this project was a journey of rediscovery in coding. After a period of burnout and challenges in previous projects, inspiration struck from JDH's Minicraft remake, which seemed like a perfect fit for my skill set.

Technologies

Developed using C++ and SFML for windowing, input handling, and image file processing.

Challenges

  • Mastering bit manipulation and learning advanced C++ features for optimized CPU and memory usage.
  • Implementing runtime coloring and efficient storage of bitmapped sprites.
  • Utilizing Perlin noise for world generation and managing an infinitely expansive world in memory.
  • Animating sprites while maintaining code stability amidst growing complexity.

Achievements

I focused on low-level optimizations and achieving a retro feel. This included using bit manipulation for memory saving, employing C++'s constexpr for compile-time optimizations, and crafting a limited color palette software renderer for retro graphics. The project features infinite procedural world generation, animated sprites, and overall comprised 3.5k lines of well-documented, albeit architecturally imperfect, code.

The resulting demo is visually pleasing with detailed elements like flowers, trees, animated water, and a character, capturing the essence of a vibrant, living world.

The Story

Deeply inspired by jdh’s video on his Microcraft clone, I was convinced that I could program my own retro 2D survival game. With a love for retro games and survival games, I set out to be as authentic to both as I could. Following in suit of jdh I wrote my own retro limited color palette software renderer. This project had me delve into and think about some low-level concepts and optimizations which really excited me. I spent the better part of my summer developing it every day and learned a lot. It was the largest project I had written up until this point by around 50%, totaling over 3,500 lines of C++ (a lot for me). But what I failed to do was write clean and modular code. After deciding I wanted to redesign the level generation system to be more flexible, a refactor of over 1,200 lines of code burnt me out. Again, I had a great learning experience and created something new by building the groundwork for the game, but was never able to realize my vision as it just felt like the project was collapsing under its own weight.

Explore the world generation demo here: YouTube Video