Eli5: How does a glitch happen?

236 views

How does a glitch happen in a video game and how do they fix it? If coding is what I think it is and that’s where the issue lies, how do you locate a glitch in endless amounts of code?

In: 0

10 Answers

Anonymous 0 Comments

In most cases, I wouldn’t say it’s *endless* amounts of code. There will probably be a lot, yeah, but it’s probably tenable with enough developers working together on it. And it’s not like the code is in one big shapeless heap, either; it will have a structure that will let the developer know what parts are broadly responsible for what behaviors.

If you’re a firefighter looking for fires to fight, and you see smoke, you aren’t going to dash all over town to search for the fire. You are going to go directly to where the smoke is coming from. The fact that there is smoke at all is a clue to where the problem is. These days, programmers have tools that can tell them which part of the code the “”smoke”” is coming from when a glitch is noticed.

Where the firefighter analogy breaks down is actually fixing the problem. In the case of an actual fire, the fire is the problem, and it will almost certainly be exactly where you see the smoke. But in software, even if you know exactly where the fire is, how the fire started and how you can prevent another one in the future may not be so obvious. At the site of the problem, everything may have been working perfectly as it was designed to, and things only broke because something you didn’t expect to find its way there somehow did.

Like, maybe the fire started because a tanker truck full of fuel took a really narrow turn, tipped over, and exploded. But the site of the fire was in a small residential neighborhood. The question you should be asking is probably not, “how do we make the homes in the neighborhood more fireproof”, rather, “what the hell was a fuel tanker doing here in the first place?” And now you have to go on a long detective mission tracing back why it was there, who sent it there, what are your options to ensure that it never ends up there again, etc. *Maybe* the fuel tanker did have a legitimate reason to be in that situation, as the road it was on was the only road available to get to a fuel station on the other side of the neighborhood. So maybe the fix is to redesign the turn so it’s not so tight. Or redesign the fuel truck so it won’t fall over on tight turns. Or build a new road to the fuel station that avoids the problem road altogether. Or move the fuel station somewhere else entirely. *Maybe* the truck driver just got lost in traffic and got dumped into that neighborhood by mistake. Perhaps the fix for that is giving all trucks better GPS so they don’t get lost. Or maybe there’s a really bad intersection that forces trucks to be kicked off onto exit ramps they didn’t want to be on, and it needs to be redesigned.

The point of all this being, finding what causes a glitch is often surprisingly easy. But finding the best solution to the underlying problem, even if you understand exactly what happened in the incident, can be quite challenging.

You are viewing 1 out of 10 answers, click here to view all answers.