Hellu, and welcome back to another weekly update for our Game Studio project! 👾
This week was incredibly code-heavy. I dove deep into the algorithms behind our procedural map generation, experiencing both the highs of solving complex math and the lows of debugging UV coordinates for hours on end.
The Foundation: Octaves and Custom Chunks
I started the sprint by implementing octaves into our noise generation, which went fairly smoothly thanks to Professor Jimmy's guidance. This added the necessary granular detail to our terrain.
However, I severely underestimated the effort required for the next step: the chunking algorithm. Instead of following the standard approach of generating perfectly squared maps with squared chunks, I decided to implement a custom solution to support rectangular maps. This meant that certain chunks could have different widths and height values depending on the map's overall dimensions.
I spent an entire day wrestling with the math for this. While Professor Jimmy was intrigued by the approach, the initial result was pure "spaghetti code", clunky and hard to read, but functionally working. When I cross-referenced my logic with Sebastian Lague's highly regarded procedural chunking tutorials, I found that while our foundational logic was similar, adapting it to a rectangular, variable-dimension grid required a uniquely tailored approach.
The 8-Hour UV Battle & Refactoring
The next day was dedicated entirely to refactoring that spaghetti code and fixing the mesh generation. The chunks were generating, but the colours and mesh UVs were completely broken.
I spent 8 continuous hours trying to understand exactly how the UV coordinates were being calculated across the divided mesh. It was a gruelling process, but finally cracking the math and understanding how UVs map to dynamically generated vertices was a massive technical victory. The connections (seams) between the chunks are not yet 100% perfect, but the system now flawlessly supports both square and rectangular maps.
Architecture and Polish
For the remainder of the week, I focused on architectural polish and adjustments:
- Procedural Gradients: I completely changed how the terrain calculates colour, shifting from a static list of colours to a dynamic gradient system for smoother transitions.
- Separation of Concerns: Drawing on standard software engineering practices, I divided the monolithic generation code into distinct, single-responsibility scripts. The architecture is now much cleaner and highly scalable.
- Destructible Integration: Finally, I integrated the destructible terrain system to work seamlessly with the new chunks. It is not fully optimised for performance yet, but the core functionality is there.
Reflective Practice: The Cost of Custom Solutions
This week reinforced a hard truth about game development: custom solutions are time-consuming. Straying from standard, squared-chunk tutorials to build a flexible, rectangular system cost me days of debugging complex math and UV rendering issues. However, the architectural payoff, having a highly modular, decoupled system, was worth the initial frustration. It highlighted the importance of balancing rapid prototyping with clean code principles.
Action Plan for Next Sprint
While I would like to focus more on the terrain generation, I will be investigating how to implement the multiplayer functionality into our game.
Thank you so much if you made it this far into the technical weeds!
See you next week for another update! 🛼🤟🏽
References:
- Lague, S. (2016) Procedural Landmass Generation (E07: Endless Terrain). Available at: https://www.youtube.com/watch?v=WP-ZiClmqWE (Accessed: 7 March 2026).
Top comments (0)