Fixing Hidden and Dangerous 2 Multiplayer

Written by TechGremlin

Hidden and Dangerous 2 uses DirectPlay 8 for its multiplayer, this has been obsolete for some time and in Windows 8 and 10 it is not installed by default. When starting the game for the first time you will be asked to install the legacy feature DirectPlay, if you did not say yes however you can still install it by going to “Turn Windows features on or off”, checking DirectPlay under Legacy Components and clicking Ok.

DirectPlay needs to be installed for Multiplayer to work.

Joining a game

The GOG version of the game

GOG didn't intend for the game to go online, probably because they couldn't get it working themselves, added to this they left in CD key checking for people using duplicate keys on the same server and left in checking for invalid keys when starting the game, therefore you must change your CD key to something unique and valid to play a multiplayer game.

Note: If you installed the retail version of the game and kept it installed when you installed the GOG version then you will still have a valid and unique retail key and this will not affect you.

Unfortunately unlike the later parts in this guide there isn’t a simple download, you must fix it manually. The key is stored in a registry entry called key in the following:

64-bit Windows: "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Illusion Softworks\Hidden & Dangerous 2"

32-bit Windows: "HKEY_LOCAL_MACHINE\SOFTWARE\Illusion Softworks\Hidden & Dangerous 2"

To edit the registry, click Start and type in “regedit”, press enter and click yes. You can paste the address into the address bar in Windows 10, but in others you will have to navigate to it manually.

There are two options for making a unique key:

1) A keygen will give you a random key and it won’t be checked online as the only thing that is checked now are duplicate keys.

2) When starting, the game doesn't check the 4th value in the first segment, or the first in the third, but also doesn't check anything after the end of the key as well.

Change the key where the Xs are, leave the 0s as they were.

000X-0000-X000-0000XXXXXXXXXXXXXXXXXXXX

Make it random, make sure it's alphabetical or numbered to be safe, the chances of someone else having the same key after that is pretty low.

LAN

Joining a LAN game will work once you have installed DirectPlay and have followed the steps below in the “Hosting a game” section for the host PC.

Internet

Joining an Internet game requires you to use a service called Qtracker (http://www.qtracker.com), it is a replacement for the GameSpy master server that handles the in-game server listings.

Open up notepad as an Administrator (right click, then click Run as administrator) and open up “C:\Windows\System32\drivers\etc\hosts”. Scroll to the bottom of the file and add the following text, then save and close the file.

65.112.87.186  key.gamespy.com
65.112.87.186  master.gamespy.com
65.112.87.186  master0.gamespy.com
65.112.87.186  hd2.available.gamespy.com
65.112.87.186  hd2.master.gamespy.com
65.112.87.186  hd2.ms14.gamespy.com

Hosting a game

LAN and Internet

Regardless of whether you are hosting in-game or using the external dedicated server, in Windows Vista->10 the game will try to “listen” on an IPv6 address, this behaviour makes the server unreachable as the game itself only supports connecting to IPv4 addresses.

The following registry fix tells Hidden and Dangerous 2 and the dedicated servers to only use IPv4. Download the file below for Windows 32 bit or 64 bit, unzip the file, double click the file and click Yes, Yes and Ok when prompted.

You can right click the files and select edit to read what they do if you like.

DOWNLOAD 32-bit Windows

DOWNLOAD 64-bit Windows

Internet

If you are hosting an Internet game, then you need to have the following entries in your hosts file.

65.112.87.186  key.gamespy.com
65.112.87.186  master.gamespy.com
65.112.87.186  master0.gamespy.com
63.239.170.9  natneg1.gamespy.com
63.239.170.10  natneg2.gamespy.com
63.144.111.199  natneg3.gamespy.com
65.112.87.186  hd2.available.gamespy.com
65.112.87.186  hd2.master.gamespy.com
65.112.87.186  hd2.ms14.gamespy.com

The server does have UPnP support and will attempt to forward the ports for you, however if this is unsuccessful then you must forward the port that you have selected for the game plus the next 3, for example with the default port being 11001, you must forward UDP 11001, 11002, 11003 and 11004.

Firewall Issues

UPnP

Sometimes issues can arise with certain routers and firewalls that have UPnP support where the server doesn’t communicate properly with them the first time and every time it is launched afterwards it will crash shortly after starting with no error message. The following registry fix will turn off UPnP support for DirectPlay 8 games including Hidden and Dangerous 2 to avoid that crash, you will then have to forward the ports manually.

DOWNLOAD 32-bit Windows

DOWNLOAD 64-bit Windows

Port re-numbering

Certain firewalls such as pfSense change the port being used for sending out through a NAT, so when your server sends a message to the master server, the master server thinks the game is running on a different port and won’t be able to connect, resulting in the server never showing up in the server browser.

To fix this you need to go to the pfSense web administration page, go to Firewall / NAT / Outbound, change the Outbound NAT mode to “Hybrid Outbound NAT rule generation” and click Save directly underneath. Then click Add under Mappings, change Protocol to UDP, change Source to <server ip>/32 Port 11004 (or the 3rd port after your designated server port), change Destination Port to 27900 and check “Static Port” under Translation Port or Range, click save and finally click Apply Changes at the top of the page.