Command Config by mbaske - 8

Extensions

A Unity editor window for managing command line and config file options with Unity Machine Learning Agents.

Unknown VersionApache License 2.0Updated 6 days agoCreated on March 9th, 2020
Go to source

Command & Config

Command & Config is a Unity editor window for managing command line and config file options with Unity Machine Learning Agents.

Features - Video

  • Clear UI with customizable colors
  • Python command line generation
  • YAML configuration file export
  • Extensive keyboard shortcuts
  • Type checking and formatting
  • Contextual help for every parameter
  • Full text search

Concept

Command & Config provides a convenient way of managing most training run options for an ML-Agents project. The editor lists groups of settings which come in two variants: command line and config file parameters. New settings are generated from JSON template files that contain default parameter values. You can stack as many groups as you like and store different run configurations/options in each one. Modified settings groups can be saved together or individually to serve as templates for other projects.


Installation

Copy the MLCC directory into your Unity project’s Assets/Editor/ folder. A new ML-Agents tab will appear in the toolbar.


Interface

While you’re modifying a settings group, it gets focus and the others are toned down. Some editor functions are context dependent and apply to the currently active group or selected parameter.
Most functionality is accessible with buttons, but keyboard shortcuts provide more extensive actions and quicker navigation.


Colors & Fonts

  • Grey text   ⯈   Disabled item
  • Italic text   ⯈   Default parameter value
  • Bold text   ⯈   Item has unsaved edits
  • Bold red text   ⯈   Missing value for required parameter
  • Bold blue text   ⯈   Search result
  • Grey sidebar   ⯈   Saved settings state
  • Black sidebar   ⯈   Group has unsaved edits
  • Red sidebar   ⯈   Group misses required values
  • Background colors can be set with the color picker tool

Foldouts

You can toggle folding by clicking on the arrows or on the (enabled) text fields next to them.

  • Alt + Click   ⯈   Expand/collaps all nested items
  • Ctrl + Click   ⯈   Expand/collaps all nested items with non-default values
  • Ctrl + Shift + Click   ⯈   Expand/collaps all nested items with unsaved values

Copy & Open (Menu)

  • Duplicate this group
  • Open settings from a JSON file
  • Open behavior config from a YAML file

New settings will be inserted after the currently active group.


Delete

Delete this group after you confirm a dialog.


Save (Optional Menu)

  • Save this group’s settings as a JSON file
  • Save all settings in one JSON file (disabled if only one group is present)

Info/Help

Toggle the context help for this item


Undo & Reset (Menu)

  • Undo unsaved parameter modifications
  • Reset parameter to default value

In the group header, this button reverts/resets all active settings after you confirm a dialog.


Command Line

Toggle the command line text for this group and copy it to the clipboard. The button is disabled if required parameters are missing.


Export Configuration (Optional Menu)

  • Save config YAML file for this group’s behavior
  • Save config YAML file for all configuration groups (disabled if only one group is present)

If you’re exporting multiple behaviors, the editor will group identical settings in the YAML default section and create individual behavior sections according to the names you have set. Export will fail with a warning if required values are missing or if there are duplicate behavior names.


Search is case-insensitive and looks for matches in the parameter names (e.g. buffer_size), the UI names (“Buffer Size”) and the current values of the active group. Type your search string in all caps to do a global search. Foldouts expand and collapse to display the found items.


File & Folder Selection Box

  • Click to select a file/folder
  • Alt + Click to clear the current path
  • Ctrl + Click on a YAML file path to open that file in the default code editor
  • Mouse over long file names in order to scroll them

Keyboard Shortcuts

Some of the common shortcuts are already used by the Unity editor, therefore functions like load and save have alternate ones. The apple command key should work wherever Ctrl is listed below. Unless stated otherwise, context dependent keyboard shortcuts apply to the currently active settings group or selected parameter.

Items

  • ⇧    ⯈   Select previous item
  • ⇩    ⯈   Select next item
  • Ctrl + ⇧    ⯈   Select item one level up
  • Ctrl + ⇩    ⯈   Select next item
  • Ctrl + ⇦   ⯈   Select previous item with non-default value
  • Ctrl + ⇨   ⯈   Select next item with non-default value
  • Ctrl + Shift + ⇦   ⯈   Select previous item with unsaved value
  • Ctrl + Shift + ⇨   ⯈   Select next item with unsaved value
  • Ctrl + H    ⯈   Scroll to selected item

Groups

  • Shift + ⇧   ⯈   Select previous group
  • Shift + ⇩   ⯈   Select next group
  • Ctrl + Shift + ⇧   ⯈   Move active group up
  • Ctrl + Shift + ⇩   ⯈   Move active group down

Foldouts

  • Alt + ⇧   ⯈   Collapse all foldouts (group)
  • Alt + ⇩   ⯈   Expand all foldouts (group)
  • Alt + Shift + ⇧   ⯈   Collapse all foldouts (global)
  • Alt + Shift + ⇩   ⯈   Expand all foldouts (global)

Undo

  • Ctrl + Z   ⯈   Undo last value change (global)
  • Ctrl + Y  /  Ctrl + Shift + Z   ⯈   Redo value change (global)

The undo buffer is cleared when a group gets deleted.

Reset

  • Ctrl + U   ⯈   Reset selected parameter to saved value (undo unsaved edits)
  • Ctrl + Shift + U   ⯈   Reset all parameters in active group to saved values (dialog)
  • Ctrl + R   ⯈   Reset selected parameter to default value
  • Ctrl + Shift + R   ⯈   Reset all parameters in active group (dialog)

Create / Delete

  • Ctrl + D   ⯈   Duplicate active group
  • Ctrl + Shift + D   ⯈   Isolate active group / delete all other groups (dialog)
  • Ctrl + T   ⯈   Create new command and new config group with default values, insert after active group
  • Ctrl + Shift + T   ⯈   Create new command and new config group with default values, delete all current groups (dialog)
  • Ctrl + Shift + X   ⯈   Delete active group (dialog)

Load

  • Ctrl + G   ⯈   Load settings from JSON file, insert after active group
  • Ctrl + Shift + G   ⯈   Load settings from JSON file, delete all current groups (dialog)
  • Ctrl + E   ⯈   Load behavior config from YAML file, insert after active group
  • Ctrl + Shift + E   ⯈   Load behavior config from YAML file, delete all current groups (dialog)

Save

  • Alt + J   ⯈   Save active settings JSON file
  • Alt + Shift + J   ⯈   Save active settings JSON file with dialog
  • Ctrl + J   ⯈   Save all settings JSON file (invokes “Save active” if only one group is present)
  • Ctrl + Shift + J   ⯈   Save all settings JSON file with dialog (invokes “Save active with dialog” if only one group is present)

Export Configuration

  • Alt + K   ⯈   Save config YAML file for active group’s behavior
  • Alt + Shift + K   ⯈   Save config YAML file for active grous’s behavior with dialog
  • Ctrl + K   ⯈   Save config YAML file for all behaviors (invokes “Save active” if only one behavior is present)
  • Ctrl + Shift + K   ⯈   Save config YAML file for all behaviors with dialog (invokes “Save active with dialog” if only one behavior is present)

Command Line

  • Alt + C   ⯈   Toggle command line text
  • Alt + Shift + C   ⯈   Copy command line text to clipboard (text must be visible)

Search

  • Ctrl + F  /  Alt + F   ⯈   Select search text input
  • Alt + ⇦   ⯈   Select previous enabled search result
  • Alt + ⇨   ⯈   Select next enabled search result

Info / Help

  • Ctrl + I   ⯈   Toggle context help

Default Values


Defaults are set according to the ML-Agents documentation. I tried to design the parameter layout in line with what I’ve gathered from the docs. Please let me know if anything doesn’t make sense or needs to be changed.

Command & Config stores a local backup (MLCC folder) of your current settings when you close its editor window, and loads those settings the next time you open it.

Tested with Unity 2019.3.3f1 on Windows 10.

If you find this project valuable, please consider supporting my work by making a donation. Thank you!

Show all projects by mbaske