If a game has the same lines of code across all players, then why do some bugs only affect certain players?

720 viewsOtherTechnology

I was playing a game earlier when a friend was experiencing a bug. Wouldn’t it make sense for me to be experiencing the same bug since were playing the same game that’s coded with the same lines of code?

In: Technology

24 Answers

Anonymous 0 Comments

It depends on a lot of things.

First, we should understand that “the code” is more like a library than a single word. Especially when it comes to online multiplayer. There’s a bunch of code. Some of it effects both people at the same time and in the same ways (say, the enemy spawned and both players see it) while some code affects only that individual player (say you got hit and it took away your health).

So you could have code that only affects one player which has a bug in it and that gets triggered so it is only affecting that one player.

Next, we need to understand the everything a computer or console does is also based on code. So not only do you have the game’s code, you have the device’s code as well. So maybe one player’s device has a bug in it that the other does not. Or maybe, there is a bug BETWEEN the code of the device and the code of the game, since they have to talk to each other.

Lastly, we have to understand that code doesn’t run perfectly every single time. There are anomalous events such as cosmic ray bit-flips that make weird things happen with code when we didn’t even say it was possible for the code to do it. Code is dependent on hardware, and hardware is real physical materials prone to the laws of physics. Weird things can happen when you get physics involved.

Lastly, and this is more of a clarification to your question. It’s not necessarily that the -code- is different but that the -value- the code spits out, is different. The same thing that prevents you from walking through a wall, may very well be the same thing that caused you to glitch into the wall. Weird right? But here’s how it works in a hypothetical.

Code says your position is 0 on the map. You try to move through a wall which is positioned at 5 on the map. The game is constantly checking your position to see if you are moving to 5 and, if so, it says “nope” and reduces your position by 1 to 3 (4-1=3) to push you away from the wall and indicate you can’t touch the wall. But what if you could skip 5 and go to 6 and THEN you go to 5? Well, okay we said reduce position by 1 so 6-1=5 and…now we’re in the wall. The code did exactly what we told it to do, we just had no plan for if you approached the wall from the other side.

This is primarily how glitches occur. It’s usually that something happened in the code in a specific way that the developers did not or could not anticipate. These differences could be very nuanced and specific, to the level that you may not even see what caused it. So you could have the same code for the game on the same device and play it at the same time. But maybe one of you does something just a smidge different and seemingly unrelated that caused a glitch 3 hours later that you can’t explain.

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