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
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 🙂
Latest Answers