Skip to content

Commit

Permalink
Updated docs for gmc.config
Browse files Browse the repository at this point in the history
  • Loading branch information
avanwinkle committed May 21, 2024
1 parent b56ce94 commit 8b0c947
Showing 1 changed file with 97 additions and 9 deletions.
106 changes: 97 additions & 9 deletions docs/gmc/reference/gmc-cfg.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ title: GMC Configuration File

The *gmc.cfg* configuration file in your Godot project root contains options for customizing GMC behavior. It uses INI formatting and its supported features are documented here.

### Local Overrides

Any configuration options in *gmc.cfg* can be overridden with a local file *gmc.local.cfg* in the Godot User Data folder. This allows you to commit the primary configuration to version control while still having platform-specific configurations (e.g. MPF executable path and logging levels) on each machine.

## \[filter\]

The filter section configures a shader for the GMC window, applying effects universally to all displays.
Expand All @@ -24,7 +28,53 @@ Full documentation can be found on the [Window Effects Filters guide](../guides/

## \[gmc\]

The gmc section overrides the core GMC scripts for advanced customization of the GMC itself. Only for advanced users.
The GMC section contains settings related to the GMC itself, including logging.

### `content_root`

Single value, type `String`. Default `None`

In addition to mode subfolders, GMC will look for slides, widgets, and sounds in those respective folders in the Godot project root (e.g. */sounds*, */slides*).

You may wish to consolidate your content in a common subfolder rather than the project root. You can define a content root folder here, which will be prepended to the individual content folders (e.g. */content/sounds*, */content/slides*).

### `exit_on_esc`

If true, the GMC process will exit if the Escape key is pressed during runtime.

### Logging

Logging can be specified in the `\[gmc\]` section with the following components:

* `logging_global` for all components not otherwise specified
* `logging_game` for the MPF.game script, holding all game-related data
* `logging_server` for the BCP Server, with all comms between GMC and MPF
* `logging_process` for the MPF.process manager, running the MPF subprocess
* `logging_media` for the media controller (slides, widgets, and sound)
* `logging_sound_player` for the sound player specifically

``` ini

[gmc]
logging_global=20
logging_sound_player=10
```

Each core component's log level can be adjusted here, and any unspecified components will use the global log level. The log levels are stored as integers with the following values:

* USE_GLOBAL_LEVEL: 0
* VERBOSE: 1
* DEBUG: 10
* INFO: 20
* LOG: 25
* WARNING: 30
* ERROR: 40

By default, debug/editor builds will run at INFO while production builds run at LOG.

### Script Overrides (Advanced)

The gmc section can override the core GMC scripts for advanced customization of the GMC itself. Only for advanced users.

Full documentation can be found on the [Advanced Custom Code guide](../guides/advanced-custom-code.md).

Expand All @@ -34,6 +84,7 @@ Full documentation can be found on the [Advanced Custom Code guide](../guides/ad
GMCServer="custom_code/my_custom_bcp.gd"
```


## \[keyboard\]

The keyboard section maps key inputs to switches and events for simulating MPF behavior during development.
Expand All @@ -51,23 +102,60 @@ Full documentation can be found on the [Keyboard Setup guide](../keyboard.md).
m=["event", "start_mode_multiball"]
```

## \[settings\]
## \[mpf\]

The settings section is where general customization options are defined.
The MPF section defines parameters for the GMC-spawned MPF process. The full command for the process will be assembled thus:

``` ini
``` console

[settings]
content_root="content"
<executable_path> <executable_args> <machine_path> <machine_args>
```

### `content_root`
### `executable_args`

Single value, type `String`. Default `None`

In addition to mode subfolders, GMC will look for slides, widgets, and sounds in those respective folders in the Godot project root (e.g. */sounds*, */slides*).
Additional arguments to pass to the executable. For example, if the executable is a Python interpreter then the executable args may be `-m mpf` to load the MPF module.

Note that MPF-specific command line args should *not* go here, even if the executable is an MPF binary.


### `executable_path`

Single value, type `String`. Default `None`.

The path to the executable entry point for the MPF process. It can be a Python interpreter, a symlink to a virtual environment mpf executable, or a precompiled MPF binary.

### `machine_path`

Single value, type `String`. Defaults to the GMC project folder.

The path of the MPF machine folder, i.e. the root folder containing the */config* and */modes* folders for your project. If not specified, the GMC project folder will be used.

### `mpf_args`

Single value, type `String`. Default `None`

Additional arguments to pass to MPF after the machine path. Common values may include `-x` for virtual mode, `-vV` for verbose logging, or `-P` for production mode. Note that values defined specifically for virtal or verbose (see below) will supersede.

### `spawn_mpf`

Single value, type `bool`. Default `false`.

If true, GMC will spawn a subprocess to run MPF when the main project is run.

### `virtual`

Single value, type `bool`. Default `false`.

If true, the MPF process will spawn in virtual mode (i.e. `-x` will be appended to the `mpf_args`).

### `verbose`

Single value, type `bool`. Default `false`.

If true, the MPF process will have verbose logging (i.e. `-vV` will be appended to the `mpf_args`).

You may wish to consolidate your content in a common subfolder rather than the project root. You can define a content root folder here, which will be prepended to the individual content folders (e.g. */content/sounds*, */content/slides*).

## \[sound_system\]

Expand Down

0 comments on commit 8b0c947

Please sign in to comment.