I just made the most retarded programming decision in my life.
here's the problem:
I have a bunch of different kind of ramps. Basically, each "ramp type" is a combination of whether or not each top vertex of a cube is lowered into a ramp. So there are ~16 ramp types.
Supposing I have a bunch of these ramps all next to each other, how can I efficiently render them without rendering any non-visible faces? Basically, I needed a function that, given two ramps next to each other and a face, returned whether or not the face should be drawn.
After spending a lot of time trying to derive the solution to this problem and running into a bunch of corner cases, I got frustrated, gave up and decided to do it all by brute force. It turns out that combinatorically, this blows up to 784 cases.
So I just made an array that was 784 large. Then I wrote a script to loop through all the cases and prompt me on whether or not to draw the face in that situation. Looks something like this:
The red face is the face in question, and I press "t" or "f" to decide whether or not to draw it. It then loops through every case. The program spits out C# code which then runs in my game and fills the giant array.
After a few runs of this program, I finally made no mistakes and the thing works perfectly.
WTF was I thinking?