Tutorial 1 - Setting Up a Simple Graph

Tutorial 1 - Setting Up a Simple Animation Graph

Setting Up a New Graph

Step 1: Creating a New Graph

  • Open the Animation Graph Editor and choose File -> New from the Menu.

The Editor will create a minimum Setup automatically. The Graph needs at least one state and one input to run, and the input needs to be defined in the state's selection criteria. Upon selecting "New" from the menu, the editor will create this basic setup as a base to build the new graph onto.

The Default State is called "Idle", but it can be renamed to anything more fitting. After creation, it does not have an animation defined, but it is set to be looping. - The next step is to assign an animation to it that is selected from the Character Editor.

  • Type its name into the "Animation" field in the Node Details panel at the bottom, which becomes available when selecting the state.
Tip

Right Clicking on an animation name inside the Character editor will bring up the option to copy the name into the clipboard.
This name can then be pasted into the Animation Graph directly. This can avoid typing errors.

  • After the Animation is set up in the Node Details Panel, save the graph to export your changes. Choose a filename and remember it (for example "TutorialGraph.xml").
    The file saved is an xml file, and alongside a binary ag file will automatically be created.

The Animation Graph is now ready to work ingame.

Step 2: Telling the Character to use this Graph

The Graph you just exported needs a character that uses it. Which Animation Graphs a character is using is set up in his lua file.

  • For the Hero Character, this file is located in Game/Scripts/Entities/actor/player.lua.
  • Open the file and find the lines that define the Animation Graphs:

  • Change the entry for the fullbody graph to the TutorialGraph.xml (or whichever name you chose).
  • Save the file.
  • You will have to restart the Editor/Game for the changes to take effect.

Step 3: Setting a Preview Character

The Animation Graph Editor interface contains a Preview Window that lets you preview the animations assigned to a state (it is not used to preview transitions). After creating a new graph, this window will be empty. The graph needs to be assigned a base character to play the animations on first.

Note that this base character is only used for previewing animations. Make sure this character has at least most of the animations referenced in the graph mapped in his cal file, or the animation will not play. It has no further effect on which characters are using the graph in the game.

  • To set a base character, open the Default Settings Dialog over the Menu Settings -> Edit Default Settings.
  • In the dialog that opens up, choose a base character for your graph by selecting the "..." Button.

  • After clicking "Ok", the Preview window will automatically update.
  • When selecting a state with a valid animation assigned to it, the character in the Preview window will play the animation. To turn off this Preview, disable the Preview button on the top of the Interface.

Step 4: Testing in the Game

The character has a new Animation Graph set up now. When entering game mode with this character, it will play the Idle Animation selected before. You can move the character around and jump as before, since all these are mechanics implemented in the game code. But the character will never play a different animation, since the Idle is the only state set up in his graph.