How does game “optimization” work? Are people sitting there changing lines of code to more “optimal” ones? What is “optimized”?

1.97K views

The recent The Last of Us for PC made me realize I had no idea what’s meant by “optimizing” a game.

Same with optifine in Minecraft improving performance. How do these things work to just make games use fewer resources?

In: 158

105 Answers

Anonymous 0 Comments

Imagine you need to go buy groceries. You make a list of what you need, then you go down every aisle looking for those items until you have traversed the entire store. Easy right? But wait, this isn’t optimal. You know some aisles don’t contain any items you need from your list. So you can optimize your path by skipping the aisles that don’t contain anything on your list.

Optimizing a program is similar. You are looking for places where you are doing more work than you need to and find ways to skip over unnecessary work. One example is object culling. Instead of drawing everything in the game world, only draw the things in front of the player’s camera. You can optimize this even further by only drawing things in front of the players camera that are not completely occluded by another object! There are tons of little tricks like this that can make a program run faster or use less memory.

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