What are glitches?
Glitches are a common issue in a lot of games and can range from being problems with graphics, to gameplay itself. A glitch is a very broad term for the game behaving in an improper fashion. A behaviour that is not the one intended by the developers. Pretty much every gamer has experienced a variety of glitches in different games, sometimes obvious, sometimes subtle. Sometimes they are a hilarious occurance and othertimes a frustrating detour to the gameplay. It can even go so far as to break the game for you, preventing you from proceeding and just causing mental suffering.
Before I show some of the glitches that we gamers have encountered, let's just talk about why it happens in the first place. Games are all about code, and how code functions together. You have scripts, variables, classes, all functioning together to try and form the game for you. Each of these can rely on something else and if you did not program properly, alternating one variable, could affect another unintentionally. This can cause unwanted things to happen because your other variable was never intended to be changed at that point in the game.
An example of this would be, we have variable X, which is triggered by getting to a certain point in the main quest. We just defeated an ogre overlord. Now from here, we have two paths, one is SUPPOSED to be unreachable and you will unlock something to get up there later and leads to variable Z, the end game. The other path we head towards where we are supposed to be, to enventually defeat the next boss in line, which would trigger variable Y.
Now, in order for us to fully trigger variable Z properly, we need to have both variable X and variable Y already triggered. If we happen to accidently reach the path leading to variable Z when we aren't supposed to, we head towards the final boss area before even defeating the boss at variable Y. We reach the area for Z, but since variable Y wasnt triggered, the boss decides to go on an endless loop of dialogue because for some reason, his dialogue only worked properly when X & Z where both triggered properly. This is an example of one type of glitch. As well the fact that you were able to reach the path leading to Z so early is a glitch too, possibly a simple physics glitch to launch you high enough on the platform to reach that path, when you were supposed to unlock a jetpack or something that would let you get up there as a result of defeating Y.
This all sounds pretty complicated but honestly there are some many ways that glitches could occur due to games having such large scope and so many pieces of code that interact and rely on each other. The example above is a more complicated one (not actually) but there could be other glitches like wonky physics calculation from running into objects strangely, disappearing people, wonky hit detection, etc. Glitches could honestly be anything, just remember what games you've played anything that didn't seem quite right is a glitch.
Now on to the fun stuff.
Gameplay GlitchesThese ones can change how the game is played, these are usually known as exploits in some cases, it really depends on the game. Sometimes they become so powerful that they need to be patched, othertimes the company and community just embraces that glitch and molds it into their gameplay.
An example of a fully embraced glitch is wavedashing in Super Smash Bros Melee.
Basically a character jumps then dashings into the ground at an angle. This allows them to cover a lot of ground, and be very mobile while using attacks as they please. It gives more freedom to use any move you want as supposed to running and is much quicker too. This isn't easy to learn and became a fundamental to high level play in SSBM. The glitch was embraced.
A glitch that was patched out was the javelin glitch in Modern Warfare 2
This glitch was awful, essentially people could run around as kamikazes, holding out the javelin weapon. This weapon was only meant to take down aircraft or launch mortals from a far. However people found a way to exploit it so they could have it held out and if they died, it immediatly dropped a javelin missile under them, which had a pretty huge radius and kill anyone. So basically if you shot the javelin guy and he was somewhat close, even 10 feet, you would die. Eventually this was patched out because it was detrimental to the gameplay of MW2.
Level BreakersThese kinds of glitches are the ones that bypass portions of the level you shouldn't. THis can include clipping through walls to reach places you shouldn't, doing shortcuts that were never intended to be taken, and other things.
Gears of War 2 - Skipping portions of the campaign level
Othertimes you can also clip through levels in multiplayer modes too. This is however much worse as it ruins the balance in the mode.
Gears of War 2 - Out of the map in multiplayer
These aren't the worst glitches because usually the multiplayer can be fixed (or its too difficult to do when actually fighting others) and it's cool to get out of the levels and see what else is around in the levels. These are usually pretty fun glitches.
Okay I lied, these ones aren't fun, they are evil. These glitches are the ones you want to avoid like the plague, they corrupt save files, they prevent progress, they make your experience miserable and even make you restart sometimes. These are usually problems with triggers, kind of like my example above except even worse because it's usually not very obvious you can cause these kinds of problems or it's not even in your control.
Here is an example of a fairly recent game breaking glitch for Skyward Sword. Basically you could potentially lock yourself out of the main storyline by doing certain quests. This type of glitch is most likely a "variable glitch" where doing certain quests would trigger a function that would make it so you couldn't talk properly to a main quest giver properly anymore.
For this one, the Elder Scrolls V : Skyrim was having some issues involving lag. Basically the game's save files were getting so massive so quickly that it actually lagged the game and would make it unplayable the farther you got in the game. The amount of data being saved at t he beginning compared to later grew exponentially. This was for the PS3 issue however and they later sent out a patch that would fix it and a variety of other problems. All of those other problems are in fact, other glitches/bugs!
Yeah and then the patch also introduced new bugs, including very talented backwards flying dragons. I don't even know how they managed that but it would have to be related to them changing the orientation of the dragon or physics. Its really hard to identify how they managed to introduce an unrelated bug. This bug isn't game breaking but it happened as a result of a fix for the lag issues so... its staying here.
Backwards flying Dragons
They don't all have to be evil game-breaking, restart bugs. However they can still include bugs as simple as not rewarding you the gold you need, taking away your items, resetting your stats, and etc. These don't break the game but they alter your experience when they shouldn't.
Sometimes it's not so game breaking as it is strange or hilarious. These types of glitches may draw you out of the experience but sometimes they are a welcome sight because they don't actually harm the gameplay. These can honestly come in all sorts from graphical, to gameplay, to physics.
Fallout : New Vegas - Floating body parts
The problem in this glitch is most likely that the game is still rendering the object but the physics for it did not get calculated so the object itself remains but it's collision mesh, physics calculations are all gone.
Battlefield 3 Beta : the Worm
Here is essentially just a model not connected properly with its skeleton. The skeleton is all over the place and stretching the model to extremes. The skeleton must have been shifted from a weird calculation.
Skyrim - Space Launch
And Many More...
There are honestly way to many glitches to be counted. The ways they happen all depend on the engine being used and how they manipulated the code. It's pretty much impossible to tell how they managed to do it without looking at their engine but it can still be guessed. But the basic premise is, they are not supposed to be there!
But regardless of the way they happened, just pray they are fun ones and not the game breakers.