Jump to content

What is "optimization"?

gouca

But what exactly is optimization? I find this amusing since nearly all forums and comments on fresh releases blame "bad optimization" when users' hardware fails to run the games in concern. 

 

Lots of people have mentioned a title, resolution and FPS in this post. Is there nothing else to it for you people? 

 

If I make a simple software with a 2d accelerated 4k video and loop it at 120 FPS on an i5-530, does that make the software well optimized? 

 

Different titles combine different assets on different engines and the graphics are always different, how do you justify calling something unoptimized and how do you think especially smaller companies could better scale their software for thousands of different hardware configurations out there? 

Link to comment
Share on other sites

Link to post
Share on other sites

Optimization is basically finding the sweet spot between quality and performance. And in games it's often done by reducing taxing graphics features like AO or lighting that are not that noticeable but give a lot more performance by lowering it a bit.

 

Here's one example: You can get 90% of the quality for 30% more performance if you set the lighting quality from ultra back down to high. (Red Dead Redemption 2)

Just a rough example...

If someone did not use reason to reach their conclusion in the first place, you cannot use reason to convince them otherwise.

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, gouca said:

But what exactly is optimization? I find this amusing since nearly all forums and comments on fresh releases blame "bad optimization" when users' hardware fails to run the games in concern.

Optimization is

  • The process of adding in Driver Specific code and moving away from Generic Code. A Driver implementation may be able to process a specific task 4x faster than a cross-compatible generic one due to certain hardware features.
  • Finding ways to achieve the same end result in a shorter path. The faster you can process data, the faster the Graphics Card can do it's job.
  • Finding ways to cut down on the end output without sacrificing quality. Whether it's cutting down frames in a Animation, Adjusting lighting, lowering vector counts, etc... Just because it's there, doesn't mean it's noticeable. You could for example remove half the data in a asset and it look visually the same, while significantly increasing the frame rate when looking at it.

 

20 hours ago, gouca said:

Different titles combine different assets on different engines and the graphics are always different, how do you justify calling something unoptimized

If a comparable title can achieve better results, then it's unoptimized. Whether it's the assets, engine, etc... The point is someone was able to make something of comparable quality perform better overall.  A Game also doesn't actually require a "Game Engine", it just makes the process of developing future titles much easier. For people using public Engines like Unreal, Unity, Godot, etc... your mostly at the mercy of the Engine Developers, but if you chose to use an unoptimized engine, that's still on you.

 

20 hours ago, gouca said:

 how do you think especially smaller companies could better scale their software for thousands of different hardware configurations out there? 

That's the point of Game Engines and reusing them. They are improved over time and where most of your efforts should go in development.

 

20 hours ago, gouca said:

If I make a simple software with a 2d accelerated 4k video and loop it at 120 FPS on an i5-530, does that make the software well optimized?

No, because if someone else can achieve the same visual output at a higher frame rate then your code is less optimized.

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, gouca said:

Different titles combine different assets on different engines and the graphics are always different

Because different titles work differently and have their individual needs. The engine for say Red Dead Redemption needs to be good at rendering open world environments. It needs to do it quickly so stuff load in on time for you to not see a gaping hole where the floor should be. On the other hand, if you take Resident Evil's RE Engine you may find it not to be suitable for those type of games as it is made for the constrained and semi-open world at best style games.

23 hours ago, gouca said:

how do you justify calling something unoptimized

I'll call your game (or my code for that matter...) unoptimised if it, for example, runs badly or similarly on both low end and high end hardware, won't scale with cores (where appropriate, e.g. Crysis Remastered) or if low vs ultra settings make no significant difference.

23 hours ago, gouca said:

how do you think especially smaller companies could better scale their software for thousands of different hardware configurations out there? 

You can't. That's the inherent complication with PC gaming. As much as we like to complain about the performance issues of games and all the problems they encounter at lauch, there is no way you will be able to account, let alone optimise, for every configuration when there are 100 CPUs, 50 GPUs and a dozen RAM configurations to choose from all spanning various generations with their own specific drivers. This is also why things like consoles or locked down ecosystems such as Apple's can be very attractive to develop for. There is one configuration and one configuration only, or at most a few. The more choice there is, the harder optimisation becomes.

 

Optimisation also comes in two parts:

  1. Actual optimisation -- this is making faster algorithms or hardware for certain tasks, for example.
  2. Increasing efficiency -- this is making sure the thing spends as much time doing what it needs to do and as little time as possible waiting on stuff to load, for example.

Not immediately related to engines, but an example of the first one is Nvidia developing RT cores to speed up calculations so we can do real time ray tracing. An example of the second one is stuff like DirectStorage or Resizable BAR support to make loading things less of an issue.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

I'll give you a very simple example:

 

I once wrote a Java program to play the game of go. One of the hardest parts was getting the board to remove captured stones. To make coding it relatively easy, I just had the program completely re-draw the board state every time a stone was played. That way, any removed stones would get removed, and there were never any mis-match between the way the board appeared and the actual board state.

 

That is un-optimized code. Yes, it works, but it works very slowly compared to what it could be, and this was noticeable. It was more noticeable on older computers, but it was even noticeable on my main desktop. The board would flash whenever a stone was placed, because the whole thing was being re-drawn from scratch.

 

So, I took the time to optimize it after the fact. I changed the code so that the program figured out whether stones were removed, where those stones were on the board, and then it would re-draw only those intersections, and no others. This took a decent amount of effort. I probably spent as much time on that as I did on writing the graphical board itself. However, the end result was that it ran much more smoothly, not just on older computers, but on every computer.

 

That's a simple example, but now repeat that for every single aspect of a AAA game, and you'll realize why a lot of games are released poorly optimized. They work, but they work in the easiest way possible, because they're on a time crunch and they have to release something.

 

If a game simply does the former a lot, it is poorly optimized. If it does the latter almost exclusively, it is well optimized.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×