Game Development Community

dev|Pro Game Development Curriculum

Your Windows registry and Torque

by Gonzo T. Clown · 10/25/2004 (8:06 am) · 26 comments

Whenever DirectX is utilized by an application, a registry entry is made for that program. In the case of TGE and TSE, each time you recompile your code it will see the .exe as a new program and make another entry. Over time this can fill up your DirectInput key with tons of useless entries that so far none of the registry cleaners I have used will even touch. When I discovered this problem I had over 400 useless TGE and TSE entries in my registry that I was more than happy to get rid of.

WARNING!!! If you are not comfortable with your registry STOP HERE!!!! I will not be responsible for any damage you do to your machine.

That being said, this is a really easy issue to clean up manually. Fire up your registry editor and navigate to the following key....

[HKEY_CURRENT_USER\Software\Microsoft\DirectInput]

When you expand it you should see something like the photo I submitted. The TGE and TSE entries will be very obvious. Click on the first TGE or TSE entry so that it's highlighted in blue, and then start rapid fire alternating your "Delete" and then "Enter" keys (if your PC is not set to default to the 'Yes' button, then use your mouse click the 'Yes') As you do this the entry below your deletion will move up and automatically highlight so that you can just hit "Delete" and then "Enter" again. Repeat this process untill they are all gone. Removing them all will hurt nothing because the next time you start TGE or TSE it will put an entry right back. It's no different than the very first time you started Torque.

I would not delete the "MostRecentApplication" key or the "DXDIAG" keys if you have them, no point in it, but the TGE and TSE are a definate cleanup.
Page «Previous 1 2
#1
10/23/2004 (1:19 pm)
Hmmm picture is to small, try this instead....

home.comcast.net/~kharvey86/TGE_reg.jpg
#2
10/25/2004 (8:48 am)
Thanks Gonzo. I had 73 entries on mine.... Could be the performance hit on my laptop that has came up in the last few months. Thanks!
#3
10/25/2004 (10:09 am)
I have about 400!!
#5
10/25/2004 (12:05 pm)
I had 0 :) oh wait, I run linux...
#6
10/25/2004 (12:43 pm)
I had 10 :P

Thanks Gonzo
#7
10/25/2004 (1:28 pm)
I lost count in the late 700s. =(
#8
10/25/2004 (1:38 pm)
I had to delete the whole directinput key. Far to many to manually erase. Let the other progs recreate their keys.
#9
10/25/2004 (2:23 pm)
After a quick search in the DX docs, I found this ...

Quote:
For every application that uses DirectInput 8.0 or later versions, DirectInput creates a key in the following registry.

This allows the independent hardware vendors (IHVs) to turn off their own device mapping for certain applications. During debugging, however, each build will generate a new key which contains a time stamp and the file size. To avoid generating multiple keys in the registry, use the binary value, AppIdFlag.

The following table lists the possible values for AppIdFlag.

1 The time stamp is ignored when generating the key.
2 The file size is ignored when generating the key.
3 Both the time stamp and file size are ignored when generating the key.

If AppIdFlag is set to 3, all builds of applications with the same file name will use the same key.

So, I'm assuming you let it generate the key the first time then add AppIdFlag to it with the binary value 0x03.

T.
#10
10/25/2004 (9:36 pm)
Fanx!
#11
10/26/2004 (5:20 am)
@ everyone - You're welcome. Glad to do it.


I'm by far more of a scriptor than an engine coder, so when I saw how many entries I had I just knew there were plenty of guys out there that were either worse off or on their way to being worse off than I was. So I figured I better get the word out on it.


@ Tom - I'm not to up on stuff like that, is this a problem that could actually be solved in the SDK or is this something I should be changing in the registry? Any help would be greatly appreciated.
#12
10/26/2004 (12:16 pm)
Edit: After some experimentation:

You just have to hand-hack the registry as follows:

Add a binary value called AppIdFlag to HKEY_CURRENT_USER\Software\Microsoft\DirectInput and set it to 03

Delete any existing duplicates and you're done. No duplicates will appear at all, but you'll still get one key per .exe that uses DirectInput.

A .reg file to do this automatically could probably be added to the SDK, but you'd still have to clear out the duplicates (or all of them, they get recreated automatically). The best you could do for that is write a little program to do it all for you, which would be pretty easy but probably a waste of time since the by-hand method is pretty quick.

T.
#13
10/27/2004 (4:53 pm)
I can confirm that your fix works for me on WinXP pro.

Thanks Tom.
#14
11/03/2004 (10:51 am)
It could be coded into TGE very easily too, to be written on startup.. but I'm not sure it's the same on all versions of Windows.
#15
11/03/2004 (10:58 pm)
Stefan,

That would be bad. There are warnings in the DX SDK about setting the key on non-development machines, it disables features of the DirectInput drivers that may be needed on some machines. Anyone setting the keys needs to know what they're doing and why.

T.
#16
11/04/2004 (12:52 am)
Tom,

No. It would be written once with the AppIdFlag key.
What's wrong with that? The application will still be able to use DirectInput like before.
#17
11/04/2004 (7:37 am)
It would disable proper functioning for ALL DX programs, not just the one you changed it for. If an application gets updates that needs to set new functionality for DX then it would be unable to do so because you made the change. The upgrades would fail to work and both the customer and the company that wrote the software would probably never be able to comprehend why. The end result would be a user that reinstalls their OS to correct some unknown problem that just started one day.
#18
11/04/2004 (2:33 pm)
248 Lore.exe
142 Lore-Debug.exe
20 Lore-Proto.exe
328 Lore-#.exe

Ugh. Too many.
#19
11/04/2004 (3:09 pm)
could explain my old dev laptop...

cool...
#20
11/05/2004 (7:56 am)
Gonzo: WELL :) Then just delete all the keys for and let it create a new one each time. This way only one key will be there each time.
Page «Previous 1 2