If people say a game is poorly optimized, what do they mean? And how do you “optimize” a game?

855 views

Edit: Really enjoy threads like this, because you learn and see so many Pov.

My favourite answer (not in this thread unfortunately) was:

*”If you write a story, the number of words you use can affect the reader’s experience.*

*Use too many words, and the reader takes a long time to get through the book, has difficulty remembering everything, and can’t separate what’s important and what’s not.*

*But use too few words and the reader will get an incomplete picture, make mistakes in understanding the story, and eventually become disinvested in the book.*

*A poorly optimized game is like one of these examples. Either too much goes in, making it difficult for the hardware to cope, or not enough goes in, making the game buggy and broken. (Sometimes both, but that’s beyond ELI5).*

*When it comes to optimising a reader’s experience, it is not about putting more or less words in but choosing the right combination of the right words at the correct time in the plot. Optimising a game is similar concept.*

*Most importantly, no matter how well you write a book, there are always people who will think it could’ve been written better, especially by them. “*

In: 404

25 Answers

Anonymous 0 Comments

Optimizing code means to make it use as little computing power as possible.

Say you have a code that’s supposed to add two numbers together X and Y.

Answer=[(2X)+(2Y)]/2+1453-256-1197 would be an example of non-optimized code. Maybe you ended up with that because those other numbers used to be important with a different part of the code or you thought about it the wrong way before the structure of the code was clear to you and you forgot to polish it.

So optimizing that code would be taking out all the unnecessary computational steps and changing it to

Answer=X+Y

Anonymous 0 Comments

Only so many things can be loaded at the same time. There are many ways to accomplish this. A lot of games only render things within a certain distance of the player or even better, only if the player is looking at them. Things farther away can be blurrier and objects can be hollow. You can individually load cities and houses when you walk into them. A million ways to do it. If you just load everything at once and don’t use tricks, the game is poorly optimized.

Anonymous 0 Comments

Gamedev Software Engineer here.
Imagine a game is a person performing a task: let’s say tidying a messy house.

In an an un-optimized game, they would find one thing out of place, pick it up, and then walk across the house to put it away, before returning back to where they started, picking up the next item, and crossing the house to put that away, etc.

You can think of loads of ways to optimize that: pick up lots of things at once before carrying them to where they live or you could look for the objects that live nearby and deal with them , before the objects that are from further away. Then, having crossed the house to put away the the objects from there, carry on tidying that area until you have to move again. In the context of a game, you could also just shove stuff out of sight – it doesn’t make it tidy: but it looks it. And of course – you could get a friend to help.

So here are some real things that we do, based on my example:

* Don’t process things that are off screen. For example, we may not need to animate a character that is behind you, or process NPCs that are in a different room. (In my example, that’s sort of shoving things in the cupboard). Games are all about what LOOKS right, not about what IS right
* Parallelize things: (get a friend to help) – in other words on a modern CPU we can get multiple cores doing some tasks. (this can be really hard to get right)
* It is slow to get data or code from memory to the CPU – but we can store small amount of each in the CPU (called caching). So we can try to batch similar jobs together so that it keeps using the same small amount code over and over, or we can keep reusing data for different tasks – or organize our data so that for a particular task, it all lives close together. (Gather up all the things that live together before going and putting them all away and/or once you’ve reached a new area stay there until you have to move again).

There are lots of other things we can – but my house tidying metaphor ran out of examples 🙂

Anonymous 0 Comments

It means the game runs poorly because some shortcuts have been made during the development process to finish things quicker.

For example, in Diablo IV when you see other players in game, the game loads their entire inventory and contents of their stash, even though you have no way to interact with it. This slows down the game and causes lag.

Anonymous 0 Comments

Imagine you need to go to the store to buy groceries but all of the things you need are at three different stores. Without much of a plan, you drive to a store halfway across town to buy a few things, then turn around to go to another store a bit closer to your home, before finally traveling even further across town to the last store. At this time you realize you are out of grocery bags and need to drive all the way back home anf back before headed home again.

Now, this route makes no sense. You could just as easily visit the closest store first and make your way outwards, or start at the very furthest store and make your way back. Both are valid options, and would save a lot more time and driving than what actually happened. And of course, making sure you had enough grocery bags would also save a lot of time.

Video game code can be thought of like a plan to buy groceries. If things are thought through properly, you can optimize it so that everything can be done as quickly as possible and save energy. When you have so many extra steps that need to be taken, and dont plan through how everything will execute, things will just get slowed down.