Overview

Skill Studio is a code generator for unity. All you have to do is design your AnimationTree, BehaviorTree in designer without writing any code and Skill Studio generates all codes for you, then you can use generated class in your game code.

Create new Project

When you create a new project Skill Studio ask you for two directory one to save project files, and other for somewhere in your unity game project assets directory (like : c:/MyGame/Assets/Scripts /). All codes will generate in this directory. The code files are in tree like you define in Skill Studio ProjectExploer tree. Each class separated in two partial class, one in designer folder and other same as you defines in ProjectExploer tree.

For example if you project tree be like this :

clip_image002

The code generated will be like this :

clip_image004

In this example you can write your code in “PlayerAnimTree.cs” file because code file “PlayerAnimTree.designer.cs” will be overwrite by Skill Studio whenever you build PlayerAnimTree.

If you choose to hook an event of some node in AnimationTree or BehaviorTree, the appropriate method will generated at the end of partial class then you can write body of method and do what you want.

1- From file menu select “New” (or from toolbar select clip_image006

2- A new project dialog appears

clip_image008

3- Enter valid project name and valid directories and press ‘Ok’

4- Skill Studio create a project for you

Now you are ready to add AnimationTrees and BehaviorTrees to your project.

AnimationTree

The idea of AnimationTree comes form Unreal Engine. You can find more here http://udn.epicgames.com/Three/AnimationNodes.html

To create an AnimationTree

1- Right click on ProjectNode or a FolderNode in ProjectExplorer and select ‘Add->AnimationTree’

2- Enter valid name and press ‘Enter’

3- To modify AnimationTree double click on it’s Node in ProjectExplorer

4- After designing your AnimationTree Right click on it’s node and select “Build”

All nodes like Unreal AnimNodes with less ability.

Use AnimationTree in code

To use generated animation tree, create your character controller class :

public class PlayerController : Skill.Controllers.Controller

(the Skill.Controllers.Controller class is one I reserved for next features)

In Awake or Start method

void Awake()

{

base.Animation = new PlayerAnimTree();

base.Animation.Initialize(animation);

}

by now calling Update method of AnimationTree is on yourself

void Update()

{

// set AnimationTree parameters here

this.Animation.Update();

this.Animation.Apply(animation);

}

In section // set AnimationTree parameters here

You have to set valid parameters for AnimNodes you defined in AnimationTree

For example :

this.AnimationTree.StandingIdle.IsIdle = !Player.IsMoving;

where “StandingIdle” is of type AnimNodeBlendByIdle

you can find more about AnimNodes parameters in Api Reference Documentation

SkinMesh

Each AnimationTree needs to assign a skinmesh witch containes AnimationClips and Skeletom hierarchy. Creating SkinMesh is easy. To import SkinMesh data from unity.

In unity from skill menu select Skill->Export To Skill Studio

clip_image010

A window like this will show

clip_image012

Drag root bone of your model to ‘Root’ Field and click copy. The entire list of bones will copied in memory, now you can go to Skill studio and paste skeleton to SkinMesh.

To import AnimationClips do the same way for animations.

BehaviorTree

BehaviorTree help you to create ai for your game components. You can find lots of information about BehaviorTrees around the world. just search it.

To create an BehaviorTree

1- Right click on ProjectNode or a FolderNode in ProjectExplorer and select ‘Add->BehaviorTree’

2- Enter valid name and press ‘Enter’

3- To modify BehaviorTree double click on it’s Node in ProjectExplorer

4- After designing your BehaviorTree Right click on it’s node and select “Build”

Use BehaviorTree in code

To use generated animation tree, create your character controller class :

public class PlayerController : Skill.Controllers.Controller

(the Skill.Controllers.Controller class is one I reserved for next features)

In Awake or Start method

void Awake()

{

base.Behavior = new PlayerBehaviorTree(this);

}

by now calling Update method of BehaviorTree is on yourself

void Update()

{

this.Behavior.Update();

}

SharedAccessKeys

Contains access keys that used by ‘AccessLimitDecorators’. All behavior trees in project can access these keys and you can limit some actions.

For example you have many types of enemies but you want just two of them attack to player at same time. Just create a Shared ‘CounterLimitAccessKey’ and assign it to an AccessLimitDecorators witch Attack ‘Action’ is child of it and limit attack action.

Last edited Jul 2, 2012 at 4:57 PM by Hamed_1984, version 4