
https://reddit.com/link/1t3ot35/video/ld1n0nt3ebyg1/player
Hi everyone! 👋 [Download Shape Maze on Google Play]
I recently released my first solo project, Shape Maze (a 100% free, zero-ads polygon puzzle game), but instead of just dropping a link, I wanted to share the technical hurdles I faced while building it in Unity, especially regarding mobile rendering and architecture. I learned a ton from this sub, so hopefully, this post-mortem sparks some good discussion!
Here is a breakdown of how the project was built, the challenges I faced, and the techniques used to solve them:
- Rendering & Custom Shaders (The Biggest Challenge)
- The core of the game involves rendering infinite mazes made of various polygons (triangles, squares, pentagons up to octagons). Initially, my Draw Calls were through the roof (several hundreds on larger maps).
- The Solution: I used the Frame Debugger extensively and wrote a custom shader to calculate the shapes and wall combinations mathematically. Now, all maze types and shapes use the exact same shader (just different variants). This brought my Draw Calls down from hundreds to just around a dozen per frame, while still allowing for a completely customizable color palette system.
- The SRP Batcher Trap: While testing in the Frame Debugger, I realized my shader broke SRP Batcher compatibility because of some custom nodes and overly precise calculations I was using. Once I identified the bottleneck and fixed the compatibility, rendering speed improved massively.
- Mobile Hardware Limits: During device testing, I encountered a critical bug: the maze simply didn't render on some older Android devices. It turned out that older mobile GPU chips completely choked on the heavy trigonometry and high precision I was using in the shader. I had to go back and significantly optimize the math to make it friendly for older mobile architectures. Lesson learned: be very careful with heavy trig in shaders targeting low-end mobile!
- Architecture & Dependency Injection
- To keep my code scalable and follow best practices, I decided to dive into Dependency Injection. I used the Reflex framework for Unity. If you haven't tried it, I highly recommend it. It was incredibly easy to wrap my head around, extremely fast to set up, and it saved me from the usual "spaghetti code" trap that often happens in first projects.
- Audio Implementation with FMOD
- Instead of relying on standard Unity Audio sources, I took the time to learn FMOD. I implemented all the SFX and music within FMOD studio and hooked it up to Unity. It gave me so much more control over the audio mixing and event handling without cluttering my C# scripts.
This project was a massive learning curve, from design and optimization to the entire Play Store publishing pipeline.
I’d love to hear your thoughts! Have you guys run into similar mobile GPU limitations with custom shaders? Or do you have preferred DI frameworks over Reflex?
If you want to check out the results of this optimization, the game is completely free and ad-free:
[Download Shape Maze on Google Play]
https://play.google.com/store/apps/details?id=spellforge.shapemaze
[Watch the Gameplay Trailer here]
https://www.youtube.com/shorts/lEQnYZKI75Q
Thanks for reading, and I'm happy to answer any questions about the implementation!