How do studios lose the source code of games, when there are full copies of games out there?

440 viewsOtherTechnology

I hear often that games can’t be remade because the source code is lost. Silent Hill 2 remake had only partial source code. Wouldn’t any old physical CD have the entire code on it?

In: Technology

13 Answers

Anonymous 0 Comments

Why don’t they just remember it all? All it is just 15 lines of code right?

Anonymous 0 Comments

People here don’t quite grasp what eli5 means.

Say you’re cooking a cake, your ingredients are the code. Once you bake everything (make the disc) you can’t revert it back to the ingredients.

Game studios do the same, they compile the code and once compiled it can’t be reverted. If they happen to lose the code, it won’t matter how many copies are out there

Anonymous 0 Comments

A program called a compiler (combined with some other related programs) will drastically change the code to help make it run faster. Included in this is any comments the programmers might have made as well as names of variables.

The original code a programmer wrote might say “add the number of cards in the player’s hand to the number in their discard pile”, while the compiled code will just say “add X and Y”. If another part of the code says “add the players health from to the health granted by the potion” which *also* becomes “add X and Y”, but with a different local meaning of “X” and “Y”. Without really deep dives, you cannot easily figure out what “X” and “Y” mean. To make this even harder, the compiler might see that you have two “add X and Y” functions and merge them into a shared function. Naturally, the real-world cases would be much more complex, but this gives a basic idea.

Comments will often include reasons *why* the code does stuff, however this is completely irrelevant to actually running the code and thus get stripped out in an early pass. These are often less valuable than the names, but generally still make the code much easier to understand. Its not uncommon there might be additional levels of documentation stored outside the code that give differing levels of explanation of how and why parts work.

Even art assets will lose a lot of data. Most likely artists will work with programs like Photoshop that include layers and other details that are irrelevant to the running game that get stripped out. A lot of the data, notably textures, audio, and movies, will also get compressed with lossy (eg, non-reversible) methods that reduce quality. Losing all of this data makes editing the art *much* harder to do.

Overall, a good analogy is to compare it to cooking or baking. The source code and original assets are the recipe and ingredients used. If given a fully baked cake, you can probably deduce a lot about the recipe and ingredients, but its a lot of work if you want to try and actually write out the recipe from a baked cake. You are likely to miss steps or ingredients and need to experiment a lot to get a good result, and it probably *still* won’t be perfect.

A video game is the same basic idea: from the shipped game, you can deduce a lot about how the game was created, but its basically impossible to truly replicate the original source from it.