It’s modifying the game’s code in order to make it run faster. The first phase of development would focus on making something work in the first place. Later you can go back and find where the CPU is busiest and rewrite the code to make it faster, find where the GPU is busiest and change what gets displayed to make life easier, etc.
You know how when you play games the quality of distant objects gets worse? In early versions of the game during development that probably didn’t happen – everything would always use the same version of objects no matter how far away they are. But this would make the game slower because there’s more detail to draw at all times. Switching to low quality models at long distances is such an “optimization”.
If you are going to make a cake but do not know everything you need then you may go to the store to get eggs then come back. Then you go for flour and back. Then you get sugar and come back etc.
This seems like an obviously slow and dumb way to do things but if you do not know the whole process then this is likely what you will do. Optimizing your video game is what you do after you finished the first cake and now you (the game) can change the process so you get all the ingredients at once to speed things up.
This is one example and may refer to how a game loads textures and how that can be improved.
Hi, I’m a hobbyist Unity developer and computer science student. I am definitely not an expert but for the sake of this sub I can give some examples of optimization I have personally used that should be fairly easy to understand.
There’s a lot you can do to optimize a game, but basically it’s a term to refer to modifying a game in order to make it perform better.
You can optimize your code in a lot of ways. If you can reduce the number of instructions being run every frame that will generally be beneficial to your processor. Let’s say you have a game with AI controlled units. The object associated with that unit will have a script governing its behavior. You might write the script to check what it should be doing, and execute that, once every frame. If your target frame rate is 60 FPS, that means that those instructions will be run every frame. But the player likely won’t notice a unit making decisions 60 times a second. What if, instead of 60 times a second, we tell it to check what it should be doing every OTHER frame? That’s 30 times a second, which is still super frequent. What if we halve it again and check what it should be doing 15 times a second? You can experiment with executing those instructions as few times as possible without negatively impacting the player experience. You can also tell the game to turn off the enemy AI when the player is a certain distance away, or if they can’t see them, or both. No point in running those instructions if it isn’t going to do anything. There’s about a million and one ways to optimize code. If you’re using a language that has manual memory allocation, making sure to get rid of variables after you’re done with them will avoid memory leaks.
You can often optimize 3D models or the textures / materials on them by reducing their poly counts or how system-intensive their shaders are. Nowadays increasing poly counts often result in highly diminishing returns. A lot of the time you can halve the number of polygons in a model and passive observers won’t notice the reduction in quality at all. Other times you can prioritize where detail needs to be higher and reduce it elsewhere. It’s unlikely that far off buildings in your skybox need to be particularly detailed since the player will never go near them. You can also get rid of geometry that the player will never see, duplicated vertices and other things that either won’t be noticed or are so negligible that keeping them isn’t worth the performance hit.
Latest Answers