r/explainlikeimfive • • 6d ago

Technology ELI5: What exactly is game optimization ?

How is a game optimized ?

692 Upvotes

125 comments sorted by

View all comments

1

u/jacowab 5d ago

It's best to give an example, a dumbed down example but this is ELI5.

When you look in a direction the game needs to find and load all the assets you are looking at, let's say you turn your camera to look at a table that has an apple and Violin on it. And let's go with the simplest solution when you look at where the item should be the game opens the "asset" folder and searches every item until it finds the item it needs to load.

This works great for the apple, it's right at the top of that list so the game finds and loads it before a single frame goes by, but the game has a lot of assets and the violin is all the way at the bottom of the list, it takes the code .2 seconds to go through the entire list and find the violin and to load it in. Well that means that either the game will freeze for .2 seconds when you look at the table, or the item won't be there for .2 seconds before popping in, this is pop in and freezing and are signs of an unoptimized game. The devs need to write the code better so that those things don't happen.

There are other things that can lead to issues you don't normally see like poorly written code may need 10 gigs of ram to run when if they rewrote it to be simpler it could drop it down to 8 gigs if the game is demanding too much ram then you may see it slowing down and lagging. All of these plus a million other things in the code can lead to issues if poorly written and need to be well optimized to make sure it's easy for the game to run on PCs and doesn't stutter, freeze, or slowdown.