script-canvas-tests.md 39 KB

Script Canvas Workflow Tests

Testing in this area should focus on the functionality of Script Canvas editor.

Common Issues to Watch For

Test guidance will sometimes note specific issues to watch for. The common issues below should be watched for through all testing, even if unrelated to the current workflow being tested.

  • Asset processor errors when loading/saving graph files
  • Warnings or assets that appear in the graph validation log
  • Unresponsive UI elements

Platforms

  • Windows
  • Linux

Documents and Common Terms

Script Canvas Editor: Editing tool separate from O3DE's Editor used to create and modify script canvas graph files.

Script Canvas Graph: A collection of node objects that can be modified and saved to a file.

Script Canvas Editor Basic Tools: The 5 default tools opened and anchored to the main Script Canvas editor window; Node Palette, Variable Manager, Node Inspector, Minimap, Graph Validation.

Script Canvas Component: A component that can be searched and attached to an entity in O3DE editor.

User Function: A type of Script Canvas graph that has 2 special nodes: Entrance & Exit nodelings. User Functions are intended to give users a way to generate re-usable graph logic similar to a function in a standard programming language. When a valid User Function graph is created and saved it will appear in the Node Inspector under the 'User Functions' category.

Area: Opening and configuring the Script Canvas Editor

Project Requirements

Any project can be used, the Script Canvas gem and its gem dependencies are required.

Product: Visible and responsive Script Canvas editor.

Suggested Time Box: 30 minutes


Area: Default Script Canvas Editor tools

Project Requirements

Script Canvas editor opened with the complete list of tools which are:

  • Node Palette
  • Node Inspector
  • Variable Manager
  • Minimap
  • Graph Validation
  • Debugging
  • Bookmarks
  • Command Line
  • Interpreter

Product: Responsive Script Canvas editor with all its tools enabled. No Asset Processor warnings about invalid data or files, no warnings or errors in the Console Log.

Suggested Time Box: 60 minutes

Workflow Requests Things to Watch For
Script Canvas editor can be launched and configured
  1. Open Script Canvas editor by multiple ways including:
    • Tools menu
    • Script Canvas button in components
    • Keyboard shortcut ( a shortcut can be assigned via Edit > Editor Settings > Keyboard Customization > Customize Keyboard)
  2. Perform resize, maximize, minimize undock, dock actions with Script Canvas editor and its panes and drag them around the Editor.
  3. Close and reopen the Script Canvas editor.
  • Script Canvas editor not launching quickly or not launching at all.
  • Script Canvas Editor not retaining configuration settings on close/relaunch.
  • Script Canvas panes not rendering, having rendering issues after being altered.
  • Not being able to resize, dock or drag panes borders.
Script Canvas window pane renders a script canvas graph
  1. Create a new script in Script Canvas editor by multiple ways including:
    • Tools menu File > New Script
    • Using Ctrl+N shortcut
    • By dragging a node from the Node Pallete into an empty graph window
  2. Close the created script and save it when prompted.
  3. Open the created script.
  4. Create multiple new scripts in Script Canvas editor.
  • Modifying an existing file places am asterisk in the graph's tab.
  • An asterisk appears on the tab only if a change is made to the file.
  • User is always prompted to save a modified file when closing the tab.
  • Creating or opening multiple files generates multiple tabs in the main window.
  • Creating and having several graphs opened should not impact Script Canvas editor's performance.
  • A drop down menu for file selection appears when enough script canvas files are opened.
Script Canvas editor tools can be opened and configured
  1. Open each of the Script Canvas editor tools.
  2. Click and try to drag every UI item of the opened tool.
  • Script Canvas tools render properly.
  • Tools do not become unresponsive after configuring them.
  • UI elements in each of the tools respond when clicked or dragged.
Using basic Script Canvas graph controls
  1. Create a new script canvas graph file, add a few nodes and perform every action from:
    • View menu
    • Edit Menu
    • File menu
  2. Perform every control action located in Script Canvas graph window top left corner.
  • Every control action and action from Script Canvas menu bar perform corresponding actions.
  • Every control action and action from Script Canvas menu can be performed with associated keyboard shortcut.
  • Controls not responding or responding too slowly when used.
  • Controls gray out under appropriate circumstances.
  • Grayed out controls can not be interacted with.
  • A helpful tooltip is generated and rendered properly for each control.
  • Tooltips do not go away prematurely.
  • Script Canvas graph renders properly after Pan/Zoom actions.
Opening a Script Canvas graph from older version of the engine
  1. Obtain a script canvas graph file from an earlier version of O3DE , put it into used project directory and open it with Script Canvas editor.
  2. Following graph file OldGraphTest.scriptcanvas derived from older o3de development build can be used for this test.
  • Graph from the older version of the engine is processed by Asset Processor without errors and can be opened with Script Canvas editor.
  • If OldGraphTest.scriptcanvas was used and assigned to entity upon entering the game mode/simulation mode a message reading Old Graph test successful should appear in the console.
Opening a Script Canvas graph with deprecated nodes
  1. Obtain a script canvas graph file with deprecated nodes, put it into used project directory and open it with Script Canvas editor.
  2. Following graph file ontick.scriptcanvas derived from older o3de development build can be used for this test.
  • Graph with deprecated nodes is processed by the Asset Processor with errors reminding the user of the deprecated classes but the graph can still be opened with Script Canvas editor.
  • When the graph with deprecated nodes is opened in Script Canvas editor it runs validation check on itself and informs the user that listed nodes were updated in order for the graph to work.
  • When the graph is saved with proposed updates it is no longer displayed as processed with errors in the Asset Processor.
  • If ontick.scriptcanvas was used, updated and assigned to entity upon entering the game mode/simulation mode a message reading OnTick Event:The Sphere position did not change from previous position should appear in the console.

Area: Basic Script Canvas graph tests

Testing in this area verify basic functionality of script canvas graphs and more in-depth functionality of the default editor tools.

Project Requirements

Script Canvas editor opened with the complete list of tools which are:

  • Node Palette
  • Node Inspector
  • Variable Manager
  • Minimap
  • Graph Validation
  • Debugging
  • Bookmarks
  • Command Line
  • Interpreter

References

Default Script Canvas editor layout with the default tools enabled and highlighted.

SC graph editor and default tools

Product: Script canvas graph files with basic input and output when run through game mode or interpreter.

Suggested Time Box: 75 minutes

Workflow Requests Things to Watch For
Use and observe minimap behavior
  1. Open or create a graph with multiple nodes
  2. Drag the minimap view around.
  3. Switch between multiple graphs.
  • If the minimap does not render or update properly.
  • If dragging the minimap view does not cause the effect in main editor window and vice-versa.
Create a variable node with Variable Manager
  1. Use Variable Manager to create a variable of any type.
  2. Modify the properties of the variable.
  3. Drop the variable off the Variable Manager list onto a graph.
  4. Drag the variable off the Variable Manager list onto a node's input/ouput field (same type).
  5. Convert a node's input/ouput field to a reference and drag/select variables from the Variable Manager onto it.
    • If variable properties do not update when modified.
    • Variable Manager list refreshes and updates properly when variables are created, deleted or modified.
    • Node Inspector updates when variables are selected in the Variable Manager.
    View and Modify a node with Node Inspector
    1. Click a node on the graph.
    2. Modify node values through Node Inspector.
    3. Add and select different nodes and variables.
    4. Select multiple nodes at once.
    • Fields and values of nodes are displayed and properly labeled in Node Inspector.
    • Changes made through Node Inspector are reflected on the node and vice-versa.
    • Selecting multiple nodes at once is reflected in Node Inspector.
    Create a graph validation error and warning
    1. Drag several nodes onto a fresh SC graph and do not connect them.
    2. Run validation check on the graph.
    3. Connect nodes and run validation.
    4. Run the graph validation using dedicated button in Graph Validation pane (checkmark in circle).
    • If Highlighting & Dimming of failing nodes is not updated.
    • If warnings and errors are not removed when issue is resolved.
    • If conditions that produce an invalid graph do not trigger a warning or error.
    Use the Node Palette to find node types
    1. Search the Node Palette for a specific node type.
    2. Use the scrolling view controls to browse nodes.
    3. Drag a node off the palette onto a new SC graph.
    4. Use right click context menu on a SC graph to search & browse for nodes.
    5. Mouse over a node in the palette to display a tooltip.
    • Node palette renders properly when entering/deleting text in search field.
    • Node categories can be expanded and collapsed.
    Modify Global Preferences
    1. Open Global Preferences and adjust the time required for certain actions to take place. (for instance Node Coupling, Drag Node Splicing).
    2. Modify Styling Settings of connections.
    3. Modify Edge Panning Settings.
    • If nodes are not visually distorted.
    • If modification of time requirement for certain actions to take place is not applied.
    Using File Menu
    1. Create a new script.
    2. Open an existing script.
    3. Use Save script / save script as... functions to save the script.
    4. Close script.
    5. Use available keyboard shortcuts to perform above mentioned actions.
    • If creating a script does not return error in Console.
    • Recently saved/created scripts are displayed in "Open Recent" menu.
    • Scripts can be saved.
    • No errors are printed in the console after saving a script.
    • Closing unsaved script displays a message reminding of unsaved changes.
    Using Edit Menu
    1. Undo and redo various actions.
    2. Manage nodes, groups, notes via Edit Menu by performing following actions:
      • Cut
      • Copy
      • Paste
      • Duplicate
      • Delete
    3. Take a screenshot of the graph.
    4. Select all, inputs, outputs, connected, and clear selections.
    5. Disable and enable selected nodes.
    6. Align nodes in various directions.
    7. Remove unused variables and nodes.
    8. Use available keyboard shortcuts to perform above mentioned actions.
    • If nodes are not visually distorted.
    • Undoing or redoing actions does not cause an assert or errors to be printed in the console.
    • Copy-Pasted nodes do retain their modified properties.
    Using View Menu
    1. Zoom graph in and out.
    2. Show selection:
      • individual node
      • multiple connected nodes
      • group
      • notes
      • entire graph
    3. Use "Go to" option to navigate to start and end of the chain (graph must have multiple nodes connected with each other).
    4. Restore default layout of Script Canvas tool.
    5. Use available keyboard shortcuts to actions mentioned above.
    • Show selection or show entire graph options are displaying graph accurately.
    • Default layout can be restored.
    Using Tools Menu
    1. Open and close tools available in Tools Menu.
    2. Use available keyboard shortcuts to open and close all tools.
    3. Perform resize, maximize, minimize, undock and dock actions with all of Script Canvas editor tools and drag them around the Script Canvas editor.
    • Tools are opened after selecting them in Tools Menu.
    • Shortcuts can be used to open/close tools.
    • The user is able to resize, minimize, maximize, undock, dock or drag Script Canvas editor tools around the Script Canvas editor.
    Using Script Events [Preview] Menu
    • This menu is soon to be deprecated and reworked, until its updated its ommited from testing.
    • O3DE User Guide: Script Events can be followed for the current state of the functionality.

    Area: Advanced Script Canvas graph Tests

    Tests in this verify more advanced core features of script canvas.

    Project Requirements

    Script Canvas editor opened with the complete list of tools which are:

    • Node Palette
    • Node Inspector
    • Variable Manager
    • Minimap
    • Graph Validation
    • Debugging
    • Bookmarks
    • Command Line
    • Interpreter

    References

    Main Script Canvas editor view with advanced control buttons highlighted.

    SC graph view and basic controls

    Product: Organized and annotated Script canvas graph files that produce verifiable outputs when attached to entities and run through game mode or interpreter.

    Suggested Time Box: 150 minutes

    Workflow Requests Things to Watch For
    Create and save a new script canvas graph with basic input and output
    1. Use any method to create a blank script canvas file.
    2. Use the node palette or right click context menu to add and connect multiple nodes.
    3. Create a logic sequence that will occur on graph start or on the activation of an entity.
    4. Use the Variable Manager to create one or more new variables.
    5. Change a field on a node to a reference and use the newly created variable.
    6. Click on a variable you created and use the Node Inspector to modify it. Change its name, default value and scope.
    7. Run the game mode or load the graph in the Interpreter.
    • If saving the file causes asset processor errors or warnings.
    • If repeatedly running the game causes the graph to produce no results or inconsistent results.
    • If any console warnings or errors regarding Lua appear.
    Create a 2nd script canvas graph file and use a script event to make the two files communicate during gameplay
    1. Use the O3DE Asset Editor to create a new script event.
    2. Add a new event to the script event asset. Give it a unique and recognizable name
    3. Add input parameters to the event and save the asset.
    4. Search the Script Canvas editor's node inspector for the new event asset. Filtering Node Palette for a script event. Dragging the node onto the graph
    5. Create a Send and Receive signal nodes for the new event.
    6. Configure two or more script canvas files to send and receive signals from each other.
      Examples:
      • Attach a send signal to a timer node so every other second the receiving script changes a light's color.
      • Send multiple different script events and a script canvas file that has different logic predecated on receiving each of the different signals.
    • If there are any tool display issues/unusable portions of tool.
    • Saved event asset appears in the directory in which it was saved.
    • Events can be used to send and receive signals from two or more script canvas files which can be proven by debug output or working graph logic.
    Animated behavior and visual language of Script Canvas.
    1. Create and hover one node above another, so the nodes are partially transparent.
    2. Hold Alt key and left click on node to instantly delete it, square particles will appear.
    3. Insert a node between two connected nodes, the cursor need to point onto connection, which will change to dashed line. The node-nudging is enabled by default, the nodes will move aside to accommodate new node.

    • If nodes are not dimming/partially transparent when hovering one node over another node.
    • If node is deleted without particles visual effect when using Alt + LMB delete method.
    • If nodes are not nudging aside to accommodate new node.
    • If nodes are not connected after inserting node between two connected nodes.
    Nodes behavior
    1. Add nodes with various data value types to the graph and modify their values.
    2. Attempt to connect two different value type pins.
    3. Add input and operand to the node (e. g. Print/Add (+) nodes).
    4. Hide/show unused slots on the node.
    5. Convert value to reference and reference to value by clicking RMB on data pin.
    6. Disable and enable nodes.
    7. Insert long string into node string value field to extend the node.
    • If data values cannot be modified.
    • If nodes with long strings are visually distorted.
    • If disabled nodes are not grayed out.
    Connections behavior
    1. Create a connection between nodes by dragging connection from output pin onto input pin.
    2. Drag a connection over empty space in graph and release LMB, in context menu search for desired node to be created and connected to.
    3. Connect two nodes by using Node Coupling feature, mentioned feature is enabled by default in Global Preferences. Hover one node over another and hold it above until nodes connect.
    4. Delete connection by selecting the connection and pressing Del key.
    5. Delete connection by dragging one node and shaking it, shaking de-splice feature is enabled by default.
    6. Delete connection by holding Alt key and clicking LMB on connection.
    • If connection is not created.
    • If node is not created after selecting it from context menu.
    • If connection cannot be deleted.
    • Wwise project is setup.
    • Wwise Audio Engine Gem is enabled.
    1. Create an entity with Script Canvas, Audio Trigger, and Audio Proxy components.
    2. In Audio Trigger component assign Play trigger.
    3. Create a script with Execute Trigger node that will execute after short delay and assign it to Script Canvas component.
    4. Enter Game Mode.

    Workflow Requests Things to Watch For
    Creating a user function and calling its input/output from another graph
    1. Use Script Canvas editor to create a graph file with enter/exit nodelings. (An instance of such graph and buttons used to create nodelings can be seen in the picture below)
    2. Place complex logic or entity behavior between the enter/exit nodelings.
    3. Give the graph file a unique recognizable name and save it.
    4. Call the user function from another graph by finding it in the node palette or right click context menu. Calling a user function from another graph
    Example Functions:
    1. Two color parameters and returns a blended color.
    2. Entity parameter and returns the number of child entities.
    3. No parameters or output but triggers behavior.
    • Recursive functions are NOT supported at the moment.
    • Modifications to the user function file should require scripts calling the function to also be modified.
    Generate and modify translation data
    1. Select any node in Script Canvas Node Pallete and right click it.
    2. Select a Generate Translation option.
    3. Open the generated .names file and modify in with any text editor by for instance changing the node name.
    4. Save the file and drag another instance of the corresponding node into the Script Canvas graph.
      • Generating translation data does not cause major performance dips, however please note that generating translation data takes about 3-5 seconds.
      • Non-english characters render properly in SC graph.
      • Translation data modifications are reflected in Script Canvas editor.
      Use groupings
      1. Create groups of all available types grouping nodes of an existing graph.
      2. Move the groups around in the Script Canvas editor.
      3. Resize groups and grab more nodes into them.
      4. Open Node Inspector and select one of the created groups.
      5. Perform all available actions found in Node Inspector for selected group (Enabling as Bookmark, Collapsing Group, Changing all Font settings, etc...).
      6. Double click the groups in graph to collapse/expand them.
      7. Perform actions from group edit menu by right clicking on a group in Script Canvas graph window (Copy/Paste, Duplicate, Collapse, etc...).
      • If groupings are not rendering when placed on the graph.
      • If nodes are not "Sticking" to a grouping when size or position is changed.
      • Modifications to groups are maintained when graph is saved/loaded.
      • Groups can have their all corresponding menu and Node Inspector actions performed.
      • Different fonts can be assigned to groups with Font Settings.
      Use annotations
      1. Create a comment on an existing graph.
      2. Move the created comment around in the Script Canvas editor.
      3. Input strings into comment input field.
      4. Open Node Inspector and select the comment.
      5. Perform all available actions found in Node Inspector for selected comment (Comment, Background Color, etc...).
      6. Double click the comment in graph to enter its edit mode.
      7. Perform actions from comment edit menu by right clicking on a comment in Script Canvas graph window (Cut, Copy/Paste, Duplicate, Delete, Edit comment, etc...).
      • Comments can be created on the graph and strings can be written in their input field.
      • Comments size scales depending on the length of written string.
      • Different fonts can be assigned to comments with Font Settings.
      • Comments can have their all corresponding menu and Node Inspector actions performed.
      Use bookmarks
      1. Create a bookmark on an existing graph.
      2. Move the created bookmark around in the Script Canvas editor.
      3. Open Node Inspector and select the comment.
      4. Perform all available actions found in Node Inspector for selected bookmark( Bookmark Name and Color).
      5. Open Bookmarks tool and perform available actions:
        • Double click bookmark to enter its name edit mode
        • Right click bookmark and select Go to Bookmark action
        • Right click bookmark and select Delete Bookmark action
        • Double click Shortcut section and select a number shortcut for a bookmark
      6. Select a Script Canvas graph window and click a shortcut number associated with one of the bookmarks.
      7. Perform actions from group edit menu by right clicking on a group in Script Canvas graph window (Cut, Copy/Paste, Duplicate, etc...).
      • Bookmarks can be created on the graph and are assigned with random color and a shortcut when available.
      • Bookmarks can have their color and name changed via Node Inspector.
      • Bookmarks can be edited with Bookmarks tool.
      • Clicking a number shortcut associated with one of the bookmarks finds and focuses the Script Canvas graph view on the selected bookmark.
      Create and use presets
      1. Create a comment and a group.
      2. Change their font settings and colors with Node Inspector.
      3. Right click them in Script Canvas Graph pane and select "Create Preset From" option.
      4. Save the selected comment and a group as separate presets.
      5. Create a new comment and a group.
      6. Right click them in Script Canvas Graph pane and select "apply preset".
      7. Apply created presets and default presets to groups and comments.
      8. Open the Presets Editor tool.
      9. Switch between Node Group and Comment Construct Types.
      10. Set various presets as default.
      11. Remove various presets.
      12. Click the Reset Button.
      • Presets can be made out of different comments and groups.
      • Presets can be applied to comments and groups and retain their assigned values, fonts and colors.
      • Presets can be viewed and removed in Presets Editor tool.
      • Using the Reset option in Editor Tool, resets presets to default, removing newly created presets and readding removed default presets.
      Use the Debugging tool to generate script logs
      1. Create a simple graph with On Graph Start -> Delay -> Print nodes.
      2. Create an entity with Script Canvas component in the viewport and assign it with previously created graph.
      3. Open the Debbuger tool in Script Canvas Editor and select the created debug targets from dropdown.
      4. Enable and disable Auto Capture and Live Updates options.
      5. Run the Script Canvas Debugger with Capture button.
      6. Run the Script Canvas Debugger by entering Game Mode in the main Editor window.
      7. Examine captured data, expand and collapse lines with dedicated buttons.
      • Created entity appears in Entities tab of Debugging tool.
      • Existing script files are displayed in Graphs tab of Debugging tool.
      Use Interpreter tool to execute script
      1. Create a simple graph with On Graph Start -> Delay (5s) -> Print nodes.
      2. Open the Interpreter tool in Script Canvas Editor and assign previously created script to it.
      3. Click Start button to execute the script.
      4. Click Stop button during script execution.
      • Interpreter tool can be assigned with scripts.
      • Scripts can be executed with Interpreter tool.
      • Execution of scripts by the Interpreter can be stopped.
      Create a script to handle inputs
      1. Create an Input Bindings file in Asset Editor tool and configure it as shown in the picture below.
      2. Create a script with Input Handler node, set Event Name to match previously created input bindings file (Print).
      3. Create an entity with Script Canvas and Input components, assign previously created Input Bindings file and script to corresponding components.
      4. Enter Game Mode and press space key to print message in console.
      5. Assign various keys in Input Bindings file.
      • Various inputs can be assigned to Input Handlers.
      • Script Canvas receives and handles assigned inputs.
      Create a script for Audio playback Prerequisites:
      • Audio triggers can be triggered by Script Canvas.
      • Audio output can be heard when triggers are playing.
      Using Command Line
      1. Open the Command Line tool with tools menu and Ctrl+P shortcut.
      2. Type ? in the command line text bar.
      3. Select a command.
      4. Click the Enter key.
      5. Type in working command directly into a text bar and click the Enter key.
      • Command Line Tool can be opened and input can be written into its text bar.
      • Commands can be searched for by typing ? into the text bar.
      • Found commands can be entered and corresponding actions such as creating new nodes in Script Canvas graph are executed by the command.
      • Commands can be manually typed into the text bar and executed.