The Game Configuration File is the first Resource read by Hatch after the game's resource files are loaded. It's used to configure engine-specific options, as well as define metadata for your game. For instance, you can set the game's name, its resolution, framerate, whether palettes are enabled, which scene file to load first, among others.
Hatch reads a file named GameConfig.xml from the root of the VFS, but it's not required to be present for the game to be able to start. All nodes must be under a root gameconfig node. The following is a list of all options read by Hatch:
Configures basic information about the game.
| Name | Type | Description | Default |
|---|---|---|---|
| gameTitle | string | The full game title. name is also accepted. | "Hatch Game Engine" |
| shortTitle | string | A shorter version of the game's title. | "Hatch Game Engine" |
| version | string | The version of the game. | "1.0" |
| description | string | A short description of the game. | "Cluck cluck I'm a chicken" |
| developer | string | The name of the developer. | |
| gameIdentifier | string | The game's identifier. If not set, this is generated from the short game title. | "hatch" |
| developerIdentifier | string | The identifier of the developer. If not set, this is generated from the developer name. | |
| useDeveloperIdentifierInPaths | boolean | Whether to use developerIdentifier in paths. | |
| savesDir | string | The name of the saves directory. | "saves" |
| preferencesDir | string | The name of the preferences directory. | |
| activeCategory | string/integer | Which scene list category to use when the game starts. | 0 |
| startscene | string | Which scene file to load first. When using a scene list, this is the name of the entry within the active category instead. If both startscene and startSceneNum are present while a scene list is loaded, this takes priority. | |
| startSceneNum | integer | Which entry in the active scene list category to load. | 0 |
The version option also accepts an alternative method of defining the game version:
This generates the following version string: 1.4.0-indev
Configures general engine options.
| Name | Type | Description | Default |
|---|---|---|---|
| framerate | integer | The rate of all fixed timestep updates. | 60 |
| useFixedTimestep | boolean | Whether to use a fixed timestep, instead of a variable timestep. | true |
| enablePaletteUsage | boolean | Whether to enable palette usage by default. | false |
| loadAllClasses | boolean | Whether to load all classes when loading the game. | false |
| useSoftwareRenderer | boolean | Whether to enable the software renderer by default. | false |
| disableDefaultActions | boolean | Whether to not add the default set of input actions. | false |
| allowCmdLineSceneLoad | boolean | Whether the game allows loading scenes from command line parameters. | false |
| settingsFile | string | The path to the settings file. | "config://config.ini" |
| writeLogFile | boolean | Whether to write to the logfile. | true |
| logFilename | string | The name of the logfile. | "HatchGameEngine.log" |
Configures display options.
| Name | Type | Description | Default |
|---|---|---|---|
| width | integer | The width of the screen. | 424 |
| height | integer | The height of the screen. | 240 |
Configures audio options.
| Name | Type | Description | Default |
|---|---|---|---|
| music | integer | The music volume. | 100 |
| sound | integer | The sound volume. | 100 |
To set the default master/music/sound volume, you must use the volume attribute. Example:
Configures the default keybinds.
| Name | Type | Description | Default |
|---|---|---|---|
| fullscreen | string | Fullscreen toggle. | "F4" |
| toggleFPSCounter | string | FPS counter toggle. | "F2" |
The following keybinds are developer mode keys:
| Name | Type | Description | Default |
|---|---|---|---|
| devMenuToggle | string | Opens and closes the developer menu. | "ESCAPE" |
| devRestartApp | string | Restarts the application. | "F1" |
| devRestartScene | string | Restarts the current scene. | "F6" |
| devRecompile | string | Recompiles scripts that have changed, and restarts the current scene. | "F5" |
| devPerfSnapshot | string | Logs the performance measurements taken during the frame. | "F3" |
| devLogLayerInfo | string | Logs information about the layers in the current scene. | "F7" |
| devFastForward | string | Toggles fast forward. | "BACKSPACE" |
| devToggleFrameStepper | string | Toggles the frame stepper. | "F9" |
| devStepFrame | string | Steps through frames. | "F10" |
| devQuit | string | Closes the application. | |
| devShowTileCol | string | Toggles the tile collision viewer. | |
| devShowObjectRegions | string | Toggles the entity update and render regions viewer. | |
| devViewHitboxes | string | Toggles the entity collisions viewer. |
See the Input Actions section of the Input page for more details.