Learn how to use the GameDriver Recorder utility to capture input events directly from user actions
The GameDriver Recorder is used to help build test scripts. The Recorder captures mouse and keyboard input and enables you to input additional events during recording.
Getting Started
To view the recorder editor window go to GameDriver > Recorder.
User Interface
Record/Stop: Pressing Record will put the Editor into play mode if it isn’t already there.
Save: Prompts for a file location to save the generated code.
HierarchyPath: Choose "Relative" or "Absolute" path for the generated code.
Help: Links to this document.
Clear: Clear the current recorded event list.
Add Event: When pressed the option selected in the Event Selected will be added.
Event Selector: From here you can select from all available events
Quick Buttons for commonly used event types, visit the API for more information about functionality. Some event types require you to select a gameObject in the Unity hierarchy window.
Direct recording might not always be accurate. In such cases, Quick Buttons can be handy. For example, if a button click action is not aligning correctly while running the recorded code, you can get more precise control by using ClickObject to ensure the same behavior on every run.
With the HierarchyPath REPL section, you can run queries and it will highlight found Game Objects.
-
Help Button: Documentation help for the HierarchyPath query language.
-
Query field: Enter a HierarchyPath string here. Press enter to perform a search.
-
Search results: Displays how many items are found by the query.
Recording a Session
-
Press the Record button to start a recording session. Unity will enter play mode if not already. Alternatively, you can play the game to a point where the recording has to be captured and then start the recorder.
-
Perform your actions in the Game tab of the Unity editor.
-
Press the Stop button and it will end the recording session.
-
Press the Save button to save the recorded events to a file.
- Import your recorded actions into your test project.
Recording XR inputs
XR References section can be used to preserve the player's (HMD and controller) position and orientation at the start of recording. References can be added one at a time manually or dragged and dropped as a group of game objects.
Once the references are set up as required, press the record button and perform any action in the game such as moving or interacting with objects. The test script code will be auto-generated by the recorder.
Fine-Tuning Recording
You can fine-tune recorder thresholds to find the right value of frames, position, and rotation preferences for the recorder. Threshold values can be set in gdio.unity_agent.config.txt which can be found in the Asset directory GDIO\Resources\config\. The following values are used to tune the recording, which can have a significant impact on the replay output.
- frames (1-any number) is the number of frames to check whether a change has occurred. The default is set to 1.
- axis_angle_thres (0-180) and axis_mag_thres (0-1) are the thresholds for the joysticks to consider a new value based on the difference to the last joystick's angle, in degrees, and their magnitude.
- agg_buttons and agg_vec2 dictate whether to aggregate the inputs of buttons and vector2 input events. For buttons, leaving that as false seems better. Note that a level of non-aggregation will always happen due to the logic used to aggregate new values for buttons and vector2 as described further below.
- frames_or_time dictates whether the code generated will calculate the input duration as frames or time using GetLastFPS * time. Use it as either "time" or "frames". This is to try and increase accuracy.
- rem_vec2_time is a test option that will remove the specified amount of frames_or_time from the final input time of joystick inputs, if possible. Unless you are experiencing additional joystick inputs, leave this setting 0.0. Note that for frames, the value will be considered an integer.
- rec_physics dictates whether or not physics-related inputs will be captured, such as anything containing acceleration or velocity. This dramatically reduces the amount of recorded inputs.
- rec_all_eyes dictates whether or not other eyes other than centerEye will be captured, such as anything containing leftEye or rightEye. This dramatically reduces the amount of recorded inputs.
- use_action_callback is a test option for the Input System package. There are two different options to choose from to attempt to increase performance and accuracy. The default is an Event Callback that fires when any input event is made, regardless of whether an action map is on the scene or not. The Action Callback requires an action map to be used on the scene.