Config File Format

From EQUIS Lab Wiki

Revision as of 17:11, 7 May 2015 by Luke (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes the format of the configuration file used with HRPUManager and OverlayManager. A template of the file can be found at HRPUManager\HRPUManager\config.xml. Some of the configuration options in this file have been filled in with defaults that should work when running the program with the default directory structure from an SVN checkout, but others must be filled in before it will work.

The config file is written in XML and uses elements for configuration options instead of attributes. The root element of the XML document should be <config>, and within that the two main elements are <hrpuConfig> and <overlayConfig>, which describe the configurations for HRPUManager and OverlayManager respectively. Within each of these elements are the various configuration options for the two programs, which are described in the tables below.

It should be noted that the .NET class that's used to parse the config file (XmlDocument) does not trim whitespace from the text within XML elements. So, for example, instead of writing <elementName> value </elementName> in the config file you would probably want to write <elementName>value</elementName> instead, unless you need the whitespace for some reason.


TODO: reference Skyrim config file.


hrpuConfig (HRPUManager)

Element name Acceptable values Description
targetProcessName string The name of the process that you want to hook into. To determine this value I’d recommend finding the name of the executable in the program’s install directory instead of looking for it in Task Manager, since the name that shows up in Task Manager is not always the same as the executable name.

Note that this just needs to be the name of the program’s executable, and should not be the full filepath to it.

fireAntPath valid filepath The location of a FireAnt executable on your system. If you’re running HRPUManager with the default directory structure and FireAnt has been checked out from SVN then the value specified in the template config file should work.
minCadence positive integer The minimum cadence that the player must be pedalling at for the enableMovementKey to be sent to the target process.
targetHeartRate positive integer The minimum heart rate that the player must be at for the enablePowerupKey to be sent to the target process.
enableMovementKey positive integer The DirectInput key code that will be sent to the target process to enable player movement.

For a list of valid key codes see http://www.gamespp.com/directx/directInputKeyboardScanCodes.html. This value can be specified in either hexadecimal or decimal format.

Note that the program doesn’t check that this value or the value specified for enablePowerupKey correspond to actual key codes. So if you specify a very large integer then the results are undefined. (In other words, don’t do it!)

enablePowerupKey positive integer The DirectInput key code that will be sent to the target process to enable the heart rate power-up. See enableMovementKey for more detail.
powerupEnabled Boolean (“true” or “false”) Whether or not the enablePowerupKey should be sent to the target process when the player is at or above the target heart rate.

Even when this is set to false the target heart rate still gets sent to the target process which causes the heart rate overlay to be displayed by default. To control display of the overlay see overlayConfig -> enabled.

overlayConfig (OverlayManager)

I should note here that while this is listed as being the configuration for the OverlayManager, really only the heart rate overlay is affected. These configuration options do not affect the hooking behaviour of the library in any way.

Element name Acceptable values Description
enabled Boolean Whether or not the heart rate overlay should be drawn.1

Note: When this is set to false the remaining elements in overlayConfig become optional. Furthermore, they will not be validated even if they are specified.

imageDir valid directory path The location of the image files used by the heart rate overlay. This value is needed because the code for the overlay gets executed in the context of the target process, which means that it uses the working directory of that application and cannot find the image files on its own.

If you specify a relative path (i.e. the path does not begin with a drive letter or “\”) then this value will be concatenated onto the working directory of the host application (HRPUManager). If you’re running HRPUManager with the default directory structure then the value specified in the template config file should work.

xPos integer The x-coordinate of the overlay’s screen position. The origin (0, 0) is at the top-left corner of the screen.

This value, in conjunction with yPos, specify the position of the top-left corner of the overlay (as opposed to the centre). Negative values can be used to draw the overlay off screen.

yPos integer The y-coordinate of the overlay’s screen position. See xPos for more detail.

1Implementation note: After writing the documentation for these config options it occurred to me that when enabled=false, it is no longer strictly necessary for the OverlayManager library to be used at all since its primary use is to draw the heart rate overlay. Having said that, one small benefit of continuing to use the OverlayManager even when the heart rate overlay isn't being drawn is that it allows in-game notifications to be displayed. For example, it can be used to indicate to the user that FireAnt has failed.