How does source code turn into PC games?

2.15K views

I understand that game developers type thousands of lines of code for a single game such as any version of a game anyone of us plays every day. How could their source code stored in many files of the game can be executed through a single application and I can play the game itself? What is their code’s journey to our PCs?

In: Technology

9 Answers

Anonymous 0 Comments

So the other answers seem to all be talking about compilers. At the end of the day, all a compiler does is translate code people can read into code computers can read. It doesn’t really explain what the code is doing.

Imagine each file is a person with a specific set of tasks and skills. When you start the game, you tell the “boss” to start working. But he doesn’t do everything himself. He goes around assigning work to other people. “You, play the opening cinematic.” “You, load the assets for the start screen.” “You, go look for the save data.” “You, find out if they’re using keyboard/mouse or controller.” “You, start tracking control inputs.” Etc, etc. It’s all these workers passing information around and delegating work that allows you to play the game.

Less ELI5 answer:
While the code is separated into many files, the programmer can reference other files and the code inside them. Each file has a unique name and each distinct section of code (a “function” or a “method”) will also have it’s own name. So using these names you can jump from file to file.

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