What Actually Is Happening When a Videogame Loads? (And is loading an offline vs. online game different?)

20 views

Hi All!

Was very curious what actually occurs when loading a game up to play! I also was curious if the process is the same for a singleplayer game versus a multiplayer game?

Thanks!

In: 15

It’s mostly the same.

When a game loads it basically reads all the required game files from your harddrive into the RAM to be quickly accessed during gameplay.

For online games you don’t get those files from an online server each time, that happens only when you update your game. The connection only gives you the position and actions of other players, and since that changes constantly it doesn’t have to be loaded before.

It’s the same as loading every software. You start the program, the program starts fetching the resources it needs to do its job. “Fetching the resources” here can mean different things.

For an offline game it’d be grabbing all the necessary files and setting them up to be used. Files are moved form slow storage to faster memory, data structures are initialized, compressed assets are decompressed (audio files, for example), etc…

For an online game it’d be all of the above, plus some communication over the network with a server to fetch more data to set more things up.

A game console is basically a computer. A good way to understand the parts of a computer is to think of it like a kitchen. Loading the game is like going into the pantry and fridge (storage) picking out all the food (game data) that you need, and moving it to the counter (memory) so you can work on it.

Consider a board game analogy…

When you chose to play a game and click on the ‘play’ button in Steam, you are grabbing a board game off your shelf. All the files are packed away in a nice compact box that holds everything, but you cannot really do much with it.

The game then loads. This is the process of opening the box, setting out the board and sorting out all of the playing pieces. In the computers case it means copying the relevant data from its home on a hard drive into the RAM and unpacking it in a way that the computer can understand, and allows it to call up the files and information it needs quickly and conveniently.

Then you play the game.

Can anyone further explain the impact of a game having an elaborate loading screen or a mini-game during loading? I’m thinking Mass Effect or sports games that let you take penalty shots while the stadium loads.

Computers operate out of memory, you have register memory, cache memory, and main memory. Then you have static (assuming you are not using persistent RAM) memory sources, so hard disks, tape drives, whatever.

The latter two are far to slow to be processed by the CPU efficiently, so most of a computer ‘loading’ is the system reading files associated with the program and loading them into memory. When you are interacting with the program it is happening in memory primarily. There are times when things are pressed to the disk, either through something called ‘virtual memory’ (where the contents of memory are placed on a special part of the disk) or to temporary files.

Even your operating system works mostly out of memory, when you boot up the computer besides all of the input/output stuff that has to load it loads your interface (CLI, GUI, web, whatever) and that is primarily run out of main memory. Some programs like databases have defined instances of when things are put to disk. Say you update a table in a database, and you do this all day every day if you are on the internet. Somewhere a database is collecting information off a website you are visiting. The first place it is written to is memory, then to a log file, then to the actual database file.

Back in *the day* when memory wasn’t as ubiquitous, you would retrieve information primarily off of tape. This was back in the days of storagetek robots. Because memory was hard to come by, basically every query was answered by a robot loading a tape and finding the information you were looking for. You would write a query and go grab some coffee. If you were lucky, someone else did that query very recently so when you went to grab it the information was still in cache memory and you didn’t have to wait minutes.

TLDR; regardless of what program you are running, if the program says ‘loading’ it is reading from the disk and putting it into memory.

There are two places things are stored for a game: Storage (Disk, Hard Drive, SSD, etc.) and memory (RAM). Storage (even SSDs) are slow compared to memory, so things need to be loaded from storage to memory to actually be used by the game. The GPU (graphics card) also has it’s own memory (VRAM) that 3D models and images need to be loaded into before they can be used so that takes some time as well.

There also might also be certain programming instructions like “take this one 3D model of a statue from storage and place 10 copies of it in memory,” or “generate this terrain based on random numbers,” that take processing time too.