'ohrrpgce_config.ini and gameconfig.ini are text files which contain remembered global configuration settings for both Custom and Game, such as the things you can edit in the Map Editor Settings menu, like cursor movement speed. There are also various settings that can't be changed except by manually editing the files with a text editor.
Game-specific settings and overrides for global settings are stored in a separate gameconfig.ini file for each game (which is documented in this article too). Also, Game stores some game-specific data in persist.reld.
If a file called ohrrpgce_config.ini exists in the same directory as the application (e.g. ohrrpgce-custom/ohrrpgce-game/custom.exe/game.exe/OHRRPGCE-Game.app, etc) then it's used. If it doesn't then settings_dir/ohrrpgce_config.ini is used instead, and created if it doesn't exist.
After loading <gamename>.rpg, Game/Custom check for a file named <gamename>_config.ini in the same directory as the .rpg (or next to the .app bundle on Mac when running a bundled game). If it doesn't exist, settings_dir/<gamename>/gameconfig.ini is used instead, and created if it doesn't exist.
If there are two ohrrpgce_config.ini files or two gameconfig.ini files (in the locations mentioned above), only one is used, the other is ignored.
Regardless of what the game-specific file is called, for the rest of this article it's referred to as gameconfig.ini.
In the in-game F8 Debug Menu and F9 Global Settings menu in Custom are options to view/edit ohrrpgce_config.ini and gameconfig.ini. That's the easiest way to access files in setting_dir.
Format and usage
Each line is a separate setting and takes the form key = value, where whitespace around the = are ignored (but not permitted before the key). Keys are case-insensitive. Lines in the file that aren't recognised (such as comments but also unrecognised key=value lines) will be ignored and preserved by the engine when modifying the file.
The type of a value can be either bool (true or false), int (integer), float (a fractional number), string (text), or special types. A bool can be any number (nonzero is true) or any of the strings yes, no, true, false, on, off (case-insensitive, e.g. Yes works too).
For organisation the key names are typically split into multiple components joined by ., such as gfx.gfx_directx.backend_screenshot. All the components must be included.
Each key may also include an optional prefix which makes the setting only apply to Game or Custom
- game. : applies only to Game
- edit. : applies only to Custom
The most specific setting found is used, regardless of the order it appears in the file.
For example, a file containing the lines edit.gfx.backend=sdl2 and gfx.backend = directx (in either order) causes Game to run with gfx_directx and Custom to use gfx_sdl2.
Any time a setting is looked up, gameconfig.ini is checked first, first for a app-specific value, and then for a global value. If neither are there, ohrrpgce_config.ini is checked, first app specific, then global. Finally, a default value is used.
For example, you can set gfx.screenshot_dir = screenshots in ohrrpgce_config.ini, to put all screenshots into a subdirectory called screenshots next to the current .rpg, while gfx.screenshot_dir = screenshots in a specific gameconfig.ini file only affects one game.
Note that a lot of graphics related settings like gfx.backend don't cause Game/Custom to do anything when loading that game, because they only check the setting when starting up.
When Game/Custom write a setting (most commonly after you edit it in a Settings menu) they usually look up the setting as described above, and then overwrite it, and if it doesn't exist they save it to ohrrpgce_config.ini as a global (maximally-general Game+Custom shared) setting. So if you manually create a more specific setting they will from then on modify that instead of writing a global value.
However a few settings, those documented at #Always game-specific are always saved in gameconfig.ini with the game. prefix.
Not all of the settings can be edited from within Game/Custom, requiring you to edit the text file manually (creating it if necessary) if you want to change them.
Note this list is sometimes out of date, and not all defaults are documented.
Settings respected by both Game and Custom.
- gfx.backend: The default graphics backend. Valid options currently include alleg, directx, fb, sdl, sdl2, console. Note that this is currently not re-applied after loading a game, so this setting is ignored in gameconfig.ini.
- gfx.gfx_$backend.backend_screenshot: bool (Default true.) Whether to take screenshots using the backend's own capability. Only offered by gfx_directx: takes a screenshot of the window as it actually appears, rather than what the engine presented. s
- gfx.gfx_sdl2.render_driver: Name of a render driver to use (see g/c_debug.txt for list of available ones). Likely possibilities include opengl, opengles, opengles2, direct3d, direct3d11, software. Affects vsync and startup time, but not actual rendering speed. (This is a WIP feature)
- gfx.screenshot_dir: Directory in which to put screenshots or .gifs. Can be a relative path (from the .rpg or whereever they're put by default) (This is a WIP feature)
- gfx.screenshot_format': File format for F12 screenshots. One of png, bmp, or gif. (Overridden by gfx.gfx_$backend.backend_screenshot
- gfx.resolution_w: int (default 480 in Custom, 320 in Game) Size of the window (remembered when quitting). In Game this is only used for the size of the .rpg browser. Like gfx.backend a game-specific setting is never read/written.
- gfx.resolution_h: int (default 320 in Custom, 200 in Game) See above.
- gfx.zoom: int (default 2) Scaling factor of the window. Like gfx.backend a game-specific setting is never read/written.
- sliceedit.show_positions: bool (default false) Show position of each slice in slice tree menu
- sliceedit.show_root2: bool (default true) Whether to show the collection root slice in the slice tree (replaces obsolete sliceedit.show_root)
- sliceedit.show_sizes: bool (default false) Show size of each slice in slice tree menu
Settings (currently) only used by Custom. They normally aren't written with an edit. prefix. Adding that prefix would make no difference.
- formedit.preview_music: bool (default false)
- idle_time: int (default 30). Number of seconds of doing nothing before Custom stops increasing the Editing Time in the game stats
- mapedit.cursor_follows_mouse: bool
- mapedit.draw_npcs_overlaid: int: 0: Never, 1: Always, 2: In NPC mode only
- mapedit.grid_color: Either RGB triple like rgb(100,255,127) or a master palette index like 14
- mapedit.mouse_pan_multiplier: float in range 1.0 to 5.0, default 1.0.
- mapedit.per-tileset_current_tile: bool
- mapedit.preview_with_minimaps: bool (default true)
- mapedit.shadows_when_skewing: bool
- mapedit.shift_speed_x: int
- mapedit.shift_speed_y: int
- mapedit.show_grid: bool Show the tile grid
- mapedit.show_hero: bool Show starting location of the hero in new games
- mapedit.show_npcs: int: 0: Off, 1: All, 2: Not Tag-conditional
- mapedit.show_overhead: bool (default true)
- mapedit.tile_animations_enabled: bool
- mapedit.wall_style: 0: ants, 1: outlined, 2: pulse
- mapedit.wall_thickness: int (default 2) pixels thickness to draw the walls
- show_quit_msg: bool (Default true). If false, do not pop up a warning message about saving the game when quitting.
- thingbrowser.enable_top_level: bool defaults to YES. If NO, don't use the graphical thingbrowsers for items, etc. Useful on very slow computers.
Settings only used by Game.
Currently, all Game-only settings are game-specific:
These settings are special in that Game will always write them to gameconfig.ini and with a game. prefix. (If a more general setting exists, e.g. without game. prefix it will be read the first time, then shadowed once Game writes the more specific one.)
- gfx.margin: int (default 8 on consoles, 0 elsewhere) Remembers the value of the TV safe margins option in the main menu. Interpreted as a percentage. Only used on consoles.
- gfx.fullscreen: bool Remembers the last fullscreen/windowed state of the game. If true, start the game in fullscreen. If missing, use the default specified in Custom.
- If "rungame fullscreen state: shared" is set, then only gfx.fullscreen from the gameconfig.ini file of the "master" (initially run) .rpg file is read/written, not the current .rpg switched to by run game.