How to add a new game to HLSW

From HLSW Wiki

Jump to: navigation, search

This is a small tutorial how to add a new game to HLSW. HLSW can be configured to support new games:

Contents

Prerequisites

  1. You need HLSW v1.0.0.51 or later
  2. HLSW must support the game server protocol. You can check this by adding the game server ip address and QUERY port to HLSW. If you see e.g. "GS Prot - serioussamse" the game server uses the Gamespy protocol.

Basic Support

Now start with the basic game support. Basic game support means that HLSW can detect the game and displays the correct game name.

Adding a new game to Games.cfg

The Games.cfg contains a list of all games and their parameters known by HLSW. You must add the new game to this configuration file by inserting the following lines:

	['_Custom:SS2'] = {
		['Name'] = 'Serious Sam - The Second Encounter';
		
		['Query'] = {
			['Protocol'] = {
				[0] = {
					['Protocol'] = 'GS';
					['Condition'] = 'None';
				};
			};
		};	
	};

SS2 is the game acronym. In this case SS2 is the short form for "Serious Sam 2". _Custom: means that this game is no official game is therefore not known by HLSW.

With ['Name'] you specify the long name for this game.

The ['Query']['Protocol'] part describes how HLSW can query the server. Which protocol it must use to get the game server information. In this case GS is the short form for the GameSpy protocol. If you don't know what you've to enter here, it is always a good idea to take a look at other games that are similar. Many games are based on the Quake or Unreal Engine so you can take a look at Quake 2, Quake 3 or Unreal Tournament 2003/2004 which protocol to add. Another use the protocol description of "GS Prot" that is displayed as game name in HLSW atm.

Adding game detection to Query.cfg

After you've added a small game description to Games.cfg you must told HLSW how it can detected that the game server is e.g. a SS2 server. Therefore a entry in the Query.cfg is necessary.

The Query.cfg contains the main section called ['Query']. In this section some query protocols have their subsections:

  • [UT2a]/[UT2b] for UT2003/UT2004 query protocol.
  • ['GS'] for GameSpy I/II query protocol
  • ['Q3'] for Quake, Quake 2 and Quake 3 query protocol
  • ['D3'] for Doom3 query protocol

Depending on the query protocol of the game you've to add the game acronym (e.g. SS2) to one or more sections.

['GS']

For any gamespy query protocol you've to add the following line to the section:

		['serioussamse'] = vector('SS2', true);

SSE is the game acronym previously used in Games.cfg.

serioussamse is the gamespy game name that was displayed as game name (GS Prot - serioussamse).

Set the second parameter of the vector always to true. If the rules flicker and contains some with gray background change this value to false.

['D3'] and ['Q3']

On games that use the Quake 3 or Doom 3 query protocol the game detection is more complex. There are two different mechanism, dection via the version and gametype variable.

Version

The most Q3/D3 protocol based games have a version rule that contains the game name and game version, e.g. Medal of Honor Allied Assault 1.11 win-x86 Mar 5 2002 for MoHAA or Q3 1.32b linux-i386 Nov 14 2002 for Quake 3. The first part of the version rule is important for the game detection.

['Query'] = {
	...snip...

	['Q3'] = {
		['Version'] = {
			['Medal of Honor Allied Assault'] = {
				['ChangeDir']['main'] = '';
				['ConnectPort'] = true;
				['Game'] = 'MoHAA';
			}; 

			...snip...
		};

		...snip...
	};

	...snip...
};

You see an entry for MoHAA. If HLSW finds an version rule that starts with Medal of Honor Allied Assault the game is detected as MoHAA and HLSW takes the version number that comes after the detection string. The default gamedir of MoHAA is main and indicates that it is no modification running. So if the gamedir is main it is replaced by an empty string.

GameDir

If HLSW fails to detect the game via the Version method it uses the GameDir method. On most games the gamedir indicates that active modification but some games have no version rule and there the gamedir indicates the game type.

['Query'] = {
	...snip...

	['Q3'] = {
		...snip...

		['GameDir'] = {
			['Call of Duty'] = {
				['Game'] = 'CoD';

				['GameDirVar'] = 'fs_game';
				['ChangeDir']['main'] = '';
			};

			...snip...
		};
	};

	...snip...
};

In that case HLSW detects the game Call of Duty (Cod) if the gamedir is equivalent to Call of Duty. The GameDirVar variable specifies that now the variable fs_game contains the gamedir. The gamedir main is automatically removed.

Finish

After you've modified the Games.cfg and Query.cfg you can start HLSW. The configuration files are parsed at startup and any error are shown in a dialog box.

If your configuration is complete HLSW should correct the game correctly and displays the new game name. If the game server goes after the first ping timeout, the query part of the new game in Games.cfg is incorrect.

Hint: You can reload the HLSW configuration files on runinng with File -> Advanced -> Reload Config Files.

Extended Support

After HLSW is able to detect the game type correctly you can start extending the support for this game:

  • Connect Support (Games.cfg)
    • Auto detection of Game Directory via remote registry
    • Special connect parameters (ParamList.cfg)
  • Map Listing (Games.cfg)
  • LAN Search (Games.cfg)
  • Colored Team Names (Games.cfg) (if the team names are displayed)
  • Rcon Support (Rcon.cfg)
  • Add-Ons (AddOns.cfg)

The big points should be implemented if possible. On the page Games.cfg nearly every possible parameter is explained.

If you've any problems or questions you can mail me: timo [at] hlsw.de . Feel free to extend or correct any articals in this Wiki to get a better documentation and help other people to support more games.

After you've completed your configuration please send the modifications to timo [at] hlsw.de . I'll use the configuration in the next release and try to support it on Gamers Search.

What is not working

You cannot setup everything of a game through the HLSW configuration files. Some things are still hardcoded in HLSW:

  • Game Icon
  • Player name detection
  • Displayed items on the player right click menu (especially in combination with rcon)
  • Most things about rcon
  • How HLSW interprets the rules (Version detection, Player display, Limits, Map, Friedly Fire, etc.)
  • You cannot add new types to Global Player ID Editor

It is a continuous process to make the configuration files more flexible and powerful. The big points are planned to be implemented in near future.

Personal tools
Developer