Thursday, January 23, 2014

Learning how to fix games

You want to fix some games, and help out. But where do you start?  It seems impossibly complex and there are so many discussions.

This is a list of bookmarks that I compiled while I went down this path.  This list is to help anybody just starting to try to understand how to fix games. This cuts through the miles and miles of text and discussion to hit most of the important pieces for learning. These are sorted in a rough order of importance, but there is some overlap.

I think I've read nearly everything posted publicly about fixes, but if I've missed something, please let me know in the comments and I'll update the list.  If you just can't work something out, you should ask for help in the main Helix thread.

NVidia whitepapers on how 3D works and underlying principles

NVidia whitepaper on how 3D works, and how they create 3D.  Really need to understand this to make any fixes. Slide 49 gives the fundamental formula for how things become 3D.

NVidia whitepaper on 3D Vision Automatic, with background on how the driver automatically creates 3D, and some things that can go wrong.

NVidia whitepaper talking about the stereo unprojection problem, and how to fix it.  This is typically what goes wrong with shadows.

Starting point for learning to use Helix debugger and create basic fixes

Where it all began, first link with details on how to use HelixMod. Includes details on how to use the debugger to find shaders, and how to change the keys used.

eqzitara's guide for how to remove broken effects. Removing effects is easier than fixing them, and is often all that is necessary.

Helix tutorial on how to apply a fix using the stereo texture to get separation and convergence.

Helix's extensive update to the dlls, to add the ability to separate textures out, and thus be able to fix shaders without impacting other pieces like the HUD. Also details how to save Presets that can then be used in shaders with if statements.

Mana84 tying together the details into how we are applying the NVidia formula using the code that Helix provided. Explains how the separation and convergence come from the stereo sampler as a 'trick' by the driver.

Examples of how to do some basic fixes

eqzitara tutorial on how to convert from shader model 1.1 -> 3.0, and apply the texture fix.

Chiz1 question about getting an error in the log, and Helix's answer for how to fix it.

eqzitara comment for how to properly kill a shader.  Can't be empty or it will crash.

3d4dd working through a fix for Miasmata with eqzitara and DHR to fix sky and push HUD into screen. Also set up for Helix presets to allow for aiming to change depth.

eqzitara comment on how to use Helix Lua script to autofix a lot of UDK games:

mana84 description of how to make something more transparent. This is a good example of how UI can be tweaked without exactly being a fix.

Helix comment on using the profile setting feature. Doesn't work well, but might be useful.

DirectX Tutorials to understand underlying code

Good starting tutorial for DirectX. Really starts with the basics.

One of the best tutorials because it's so extensive.  Goes into shadow mapping, and projective textures.

Excellent HLSL tutorial.  You don't get any assembly here, but this is written like a text book and is much easier to understand than most.

Nice HLSL tutorial, more clearly written than a lot.

Good refresher on transformation matrices and the math involved.  You don't really need to know the math, but reviewing this makes it easier to spot transformations.

Another excellent description of the projection matrix and how the transform math works to get an image on the screen.

DirectX11 Tutorial, but still applies to DX9.  Good descriptions of different lighting effects and how textures work. The LightMaps was particularly helpful.

Interesting mix of HighLevelShaderLanguage and the asm versions.

Examples and discussions of advanced fixes

Mana84 comment for setting up the InverseMatrix feature in the ini file.

mike_ar69 question and Helix response about how to use surface creation mode feature, to fix some shadow maps.

Helix adding some details on using the new feature to add presets to autofixed shaders. This can allow automatic preset changes when menus come up or for cutscenes.

mike_ar69 giving some tips on how to fix shadows by using inverse matrix, and a little later an example fix using that technique.

DarkStarSword giving us some great detail on the different coordinate spaces, and how to apply a shadow fix.


  1. Nice one bo3b! I have been meaning to write something up myself for ages. I wrote about 15 pages of top tips while I was off work sick last week, but there is no real structure to it, just stream of flu-like consciousness. I'll try and get it into a form that would be more presentable but it might take a couple of weeks.

  2. Nice, wish I could sit down and focus and help, but anyway, want to say thanks for organizing! Amazing what you guys have accomplished over the past couple of years. I appreciate it.

  3. Thank you, bo3b, for posting this. Also, the old Helixmod site has some examples of code fixes, before & after ( ).

    1. Thanks for reminding me of that link. Unfortunately most of the links there were broken by that big forum outage. But, I do have links of almost all the examples there.

  4. Good deal, glad it was worth doing. I'd been meaning to make a list for a long time. I'll add the Coding Fixes to the list, and also a reference to a shader tutorial for background on how shaders work.

  5. Thats great idea. HLSL is assembler like code and many programmers from other areas (VB and C# for example) could be learn how to fix shaders in short time

  6. I have fix Assassin Creed (skybox and UI) - how I can add my fix to the list of games ?

    1. Fantastic! Glad to hear it. You should contact eqzitara via PM from the nvidia forums and let him know.

  7. Hi there! Hey I ran across this page while running down any site that might still be hosting the content that was previously on


    Would you happen to know where I can find this article, if anywhere at all? I'm trying to locate it as part of the suggested prerequisite reading material for


    which I'm reading as an intro to Babylon.js :) If you've read it yourself, can you tell me anything about the contents? Are there any core-concepts from there I can easily learn about in some other article? I'm just not sure what I would have discovered in there, and am loathe to miss anything. Thanks!

    1. Hi Albert,
      Not sure what happened to that website. It's not a lot of info, but has some good matrix background, presented well.
      You can find an archive here:

  8. 2010_GTC2010.pdf is linked to twice in the nVidia whitepapers section - was one of those links supposed to be ?

    1. Good catch. Updated to correct pdf. Thanks.

  9. This comment has been removed by a blog administrator.

    1. Sorry about deleting your comment, please add text for your links (we get a lot of spam).

      JPG with alternate approach using dominant eye:

  10. Are somebody knows how to disable compute_shader via 3D Migoto not in hunting mode. Placing it hash to [ShaderOverride1] section of d3dx.ini is not disabling it. Which of two files hash-cs_reasm.bin or hash-cs_reasm.txt overrides it? How can I get hash-cs_reasm.bin from hash-cs_reasm.txt ?

    1. Neither. You want to use the hash for the HLSL CS itself. The ASM is only used if you want to change the code. The .bin file is just a cached version and should be ignored. The _reasm.txt indicates you are using an old and worse version of 3Dmigoto. Use the latest.

      Disabling a CS is generally a problem, and will sometimes crash the game. Usually you disable a specific texture instead.

      Best bet for learning how to do ShaderHacking is to start with my class, if you haven't already. Shader School Then, go to the NVidia 3D forums, and there a bunch of people there that can help. Look for the giant 3Dmigoto thread, and post there.

    2. I've used 1.2.56. In HLSL section of hash-cs_replace was many "Known bad code for instruction (needs manual fix)". So how I should get name to file for overriding CS ? Which section HLSL or ASM should I change to disabling it? Is there enough adding "discard;" at the begin of "void main(){discard;" section of HLSL and "cs_5_0" as first stirng and "ret" as second string in ASM section to disable CS. This strange shader has neither input dcl_ strings nor outputs o0,o1,etc on my opinion

    3. Could you give url link to "giant 3Dmigoto thread" ? I've found only 3Dmigoto

    4. All, I understood. If 3dMigoto loads bugged_by_shaderhacker shader to override it ignores rest of shaders in ShaderFixes folder - so i can't neither to disable nor to fix any vertex shader because of loading bugged compute shader - so you should fix them step-by-step or in other words one-by-one