– How come a game can have random glitchy moments if it’s all pre-written code?

907 views

I was playing FarCry Primal on PS4 and Mirror’s Edge catalyst – sometimes NPCs will get stuck in a wall or end up standing on the air. Sometimes I complete a quest on FarCry and the mission objective won’t go away until I re-spawn and an NPC will be standing 2 feet above the ground.

What causes weird minor glitches like these to happen ?

In: Technology

3 Answers

Anonymous 0 Comments

One good way to think about it is that programmers take shortcuts.

When you see a character running across a complex terrain in a game, it really creates a very immersive illusion – it looks like the character’s feet are really touching the ground, and the gun in the character’s hand is bouncing due to gravity, and the character’s hair is blowing in the wind. When the character gets hit, it falls over in a very realistic way, it makes you think that the game is really simulating all of the character’s arms and legs in precise detail.

In reality, the game is taking shortcuts because computers just aren’t fast enough to actually simulate every character’s physical interactions with the virtual world in real time.

So when the character is running, you’re mostly just seeing a pre-programmed animation that looks real.

Most importantly, when the game tries to figure out if the character is going to hit a wall or a car or another character, it’s actually looking at an invisible spherical bubble around that character to see if that bubble intersects some other object’s bubble. If so, then it starts doing more precise calculations.

That bubble is a shortcut, and it’s one that works really well – except for when it doesn’t.

Game programmers will try really hard to fix all of those glitches, but there are just too many possible ways things can interact, so some will slip through.

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