Lesson 4 - game fix

From Bo3b's School for Shaderhackers
Revision as of 06:31, 7 September 2014 by Bo3b admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This lesson will show one way to go about fixing the entire game, getting it playable as quickly as possible.

Level of difficulty: Easy
Time required: 45 minutes

Video Walkthrough on YouTube
Video Walkthrough direct download link


Fix the entire game, all shaders that cause 3D glitches, making it playable.
Give each effect a constant, so each can be disabled or enabled.


Make a second key preset to toggle bloom independently from other effects.

Even with the tiny information that we have so far, we can still fix entire games!

Let's go through The Ball and fix every broken effect that we find. After we finish disabling all the broken effects, we will have a fully playable game in 3D.

There is a trade-off between fixing effects and simply disabling them. Naturally, we'd want to fix things instead of just disabling them, but fixing things is quite a lot harder and more time-consuming than simply disabling them.

There is an artistic balance to be struck between how much an effect is worth, compared to how bad it looks in 3D. This is simply a judgment call, and everyone will have a different opinion. In general, we try to lean toward fixing everything, but if you only have a little bit of time, it's far better to have a game that runs with effects disabled, than no game at all.

As we go through this Lesson, we'll get a chance to see how that balance plays out with different effects.

For this Lesson we are going to concentrate upon getting results quickly, not necessarily the best results. This technique also makes it easier to decide which effects to fix, and gives us a great working list of effects to be fixed when we have time.

Part of these Lessons is to present techniques that can lead to good working habits when fixing these games. It's very easy to try to go too fast and get lots of files open and get confused on what file affects which effect, especially if your experiments don't work. There are lots of different approaches to fixing effects, this will emphasize techniques that can save you time.

As a first pass, let's find and mark all the broken shaders. We'll still look for them one at a time, so we can easily keep track of what we need to do and to avoid getting confused.

In a later Lesson, we'll come back to these disabled shaders in order to actually fix them. Having them all in the same spot, with good comments will make it easy for us to find effects, and decide which are worth more time to actually fix. In a very real sense, this is a working ToDo list, but without us having to write a bunch of notes.

  • Creating a complete list of shaders.
    1. Since we want quick results, we can turn effects off with configuration UI instead of fixing or disabling them.
    2. First pass in game, finding broken shaders.
    3. Find and mark each broken shader.
    4. Alt-Tab out, and comment each new file for context.
    5. Relaunch at different saves to shorten active search list.

With all the broken shaders saved in the ..\Dumps\SingleShaders\ folder, we can now go through and disable each of them. We'll use our on/off mechanism so that we can decide how much of an impact disabling each effect has.

  • Editing shaders to disable effects
    1. Fix full game. All broken shaders disabled by default.
    2. Toggle key code to enable them on.
    3. With all shaders edited, run game and make sure they're fixed.

That's all there is to disabling effects in a game, and hopefully you see how quickly and easily you can fix an entire game. It can be improved, but isn't it already far better than when we started?

Time for the Quiz. Can you add a second key preset, so that we can toggle that heinous bloom effect independent from the more mild fog effects?

  • Save and show your DX9Settings.ini file.
    1. Edit the DX9Settings.ini file, and add second key preset using any key you prefer.
    2. Change the constants to allow the bloom or other terrible effects to be toggled without affecting others.
    3. Once you are satisfied with your changes, edit your personal page and add your DX9Settings.ini code to your page, in a <nowiki></nowiki> block.
    4. Check your page with Preview to be sure you like it.
    5. When you are satisfied, click Save Page.

Did you successfully disable every annoying effect? Did you just fix a complete game? Incredible!

If you have any questions or suggestions, please use the Discussion tab, and start a new topic.