Feb 3, 2025

Blinded

Team of 5
March 2023 - June 2023
Skills Utilized: C++, OpenGL, GLSL, JSON5

Introduction

Blinded is a boss rush-focused souls-like action game where the player restores red, green, and blue to a colorless world by defeating powerful bosses.

In this project, I developed a fragment shader for dynamic color removal and restoration, eliminating the need for multiple textures. I also implemented data-driven enemy and level design, streamlining iteration and balancing. These technical solutions enhanced both the game's artistic vision and development efficiency.

Showcase












Technical Highlights

Data Driven

I have transitioned various game elements, such as monster AI parameters, collision boxes, and level layouts, to a data-driven system using JSON5. This allowed for easy modification and extension without strict formatting constraints. By declaring a struct, exporting its members, and calling a parsing function, we could seamlessly populate in-game data with minimal effort.

Defining enemy attributes and placements in external files eliminated the need for recompiling or relaunching the game, greatly accelerating our iteration cycle. This significantly improved efficiency when fine-tuning enemy behaviors and level layouts.

↑Example of a level layout

↑Example of an enemy's AI parameters

RGB Fragment Shader for Dynamic Color Removal


To optimize asset management, I replaced pre-drawn grayscale and partial-color textures with a fragment shader that dynamically removes red, green, or blue from a full-color image. This eliminated the need for multiple texture versions, significantly reducing asset workload.

A key challenge was ensuring colors were removed correctly rather than simply setting RGB values to zero, which would turn everything black. Instead, we needed to gray out the removed components proportionally.

To achieve this, we used the HSV color model, which represents color using hue, saturation, and value. The hue determines the color type. By measuring the hue's proximity to the removed color, we calculated how much of it should be grayed out. The closer a color was to the removed hue, the more it was desaturated.


Rather than directly desaturating the color, we shifted the hue outside the removed color range. This ensured that a pure yellow (which contains both red and green) would still retain some green when red was removed, preventing incorrect full desaturation.
The final result was an interpolated blend between the original color and a grayscaled version based on how much of the removed component was present.

↑ Part of the final shader

This approach not only streamlined asset creation but also enabled greater gameplay flexibility, allowing players to dynamically regain colors in a non-linear progression.

Conclusion

Through Blinded, I gained valuable experience in shader programming and data-driven design. The shader development process deepened my understanding of color manipulation in graphics programming, particularly when working with RGB components and HSV models. Additionally, transitioning the game’s enemies and levels to a data-driven approach taught me how to optimize workflows and speed up iteration cycles, greatly improving both development efficiency and gameplay balance. This project enhanced my problem-solving skills, especially when faced with complex technical challenges and the need for creative solutions.

No comments:

Post a Comment