by Leon Rosenshein

Target Fixation

I spent way too much time with fighter pilots early in my career and learned a lot about how they think. Yes, they're typically confident (arrogant actually) and maybe a little boastful, but they're also very disciplined, particularly when it comes to their craft. And one of the ways that manifests is their ability to focus on a target while maintaining enough situational awareness to respond to changes in the situation.

For a fighter pilot, failure to maintain situational awareness can manifest itself in several ways, the most common is when the pilot gets so fixated on the target that they miss the target's wingman getting behind them or, like Maverick did in Top Gun, breaking the hard deck to get the shot.

The same kind of thing can happen during development or debugging. You have a goal and an approach, and you're smart, so damn it, you're going to make it work. Sometimes, maybe even often, that's a good thing. But not always.

Just because you're sure you know what the problem is and how to fix it doesn't mean you're right. It's a great place to start, and usually you can avoid wasting time by going with it. When you run into a method that seems to be giving you the wrong answers all of a sudden the problem is probably in that method, so look there. But don't get so fixated that you ignore any new information.

Back when I was working with those fighter pilots we didn't have artists to build us fancy models of different aircraft, but we did have basic engineering drawings, so we'd just do the best we could from them. We were doing some F-22 simulations and we kept getting some flickering on the left stabilizer. I was convinced that it was a z-buffer issue. I fought it for days. Isolated it. Added z-bias. Changed draw order. Wound polygons in different directions. Nothing worked. The flickering was still there. It wasn't until I let go of my bias towards z-fighting that I was able to solve the problem.

It turned out that the problem was in the texture. Somehow, and we never did figure out how, there was an alpha mask on the texture and the texture was oversized. Since this was before mip-mapping the combination of the two caused the texture engine to have bands of transparency moving across the stabilizer as viewing angle changed.

But, because I was fixated on the z depth I didn't look into anything else for a few days. If I had been more open to possibilities I could have found and fixed the problem much sooner. So what assumptions are you making that might need to be re-evaluated?