Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Sage: Anim Graph Editor -- Control your Animations Visually!

Discussion in 'Assets and Asset Store' started by AlteredReality, Jan 19, 2012.

  1. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Yeah and as a bonus, you might get a job offer too ;)
     
  2. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Nice to see two goods developers share this kind of talk.. ;)

    JP
     
  3. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    LoL, I love doing this stuff as a side project. But I don't think I'd ever want to leave professional game development as a gameplay programmer to do tools work. :p
     
  4. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  5. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    Hello,

    I just purchased Sage and it looks really good. I have a question:

    I have an Idle state which consists of a main looping animation and every now and then I want to play a couple of other one-shot idle movements like the character looking at his watch. When the random idle has finished it should go back to the main idle animation.

    What would be the best way to do that using the sage editor?

    Thank you
     
  6. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I would recommend doing the following...

    1. Create an "idle" state node, this can be an Anim List state or Blend Graph state. Set the play mode to loop.
    2. Create an "occasional" state, use an Anim List state. Put all possible occasional animations in this state. Connect to "idle" state. Set the play mode to once.
    3. In the update function for the "idle" state (in the automatically generated scripts), put a timer in there that randomly checks if it should go into the "occasional" state. If so, transition to the "occasional" state.

    This would cause the idle state to run, and occasionally play a different animation, then transition back into the idle state.

    Does that help? Let me know if you'd like me to make a basic graph and take some screenshots to show you. If so, I can do that later tonight.
     
  7. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    Hello,

    Thanks for writing back. Yeah that works fine!

    Is it possible to apply movement on a character controller ( as an option ) instead of changing the object's transform? If a character is walking and Move is checked then the character does not collide with objects at the moment..

    Also if I have a Blend Graph that contains a Walk and a Run animation and a Speed that controls the blending, how can I synchronize the animations so that the character does not for example stop by flipping his legs depending on when the user stopped pressing the move button? Would calling animation.SyncLayers at the Start function of the animation script work?

    Thanks for your help
     
  8. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Happy to help!

    For the movement question, do you mean to feed movement into a secondary script that handles movement? Or to apply an impulse to a physics body for the character? Please be more specific so I can better answer your question.

    For the Sync question, I'll have to look into it more tonight. But a bit more clarification as to how the SyncLayers works in Unity would help. Does it simply adjust the playback speed of the animation so that all animations on that layer take the same amount of time to play through once? This seems like it would be a feature i'd have to add to sync animations in a blend graph, so more input as to how it should work would be awesome. Thanks!
     
  9. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    For the first part:

    Characters usually move by calling the Move function on a CharacterController component. That makes them collide with objects and it provides some other utilities as well. Your move function probably directly changes the transform of the animated character thus the character does not collide with anything.

    So I was wondering if you could add an option to apply the movement to a charactercontroller instead. Perhaps next to the Move checkbox there could be another checkbox that said Apply To Character Controller and when it is ticked your code would call the Move function on the character'c CharacterController component.

    For the second part I am not really sure how SyncLayer works. Apparently if the animations on a layer are similiar it normalizes their speed and makes them play better together when they are blended. I think there is a Character Animation video that explains it.
     
  10. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Cool, thanks for the clarifications. I'll try to look into both of these later tonight, and hopefully release an updated version of Sage in the next few days to address these issues. Thanks for the feedback! :)
     
  11. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    So you know, I've implemented a solution for the movement thing. By default, Sage will attempt to move using the CharacterController first, second by moving the rigid body, and third by changing the position on the transform. However, you can now also set a delegate function on the SageController to handle movement custom for your game. When auto generating scripts, this will automatically create a ApplyMovement function that can be overridden in the game version of the controller to handle movement specific to your game. This should give the easiest use and most flexibility.

    I'll try and look at the SyncLayer thing tomorrow. :)
     
  12. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    One question: does it work with locomotion? Or only on flat terrains? Did you build in an alternative to locomotion?
    I know everybody is demonstrating there functionality with flat terrains but actually the world isn't flat ;-)

    I'm loving this product but before I can replace our in house solution I need to know the answer to non flat terrains. Know we are using locomotion but that solution is using Animation Groups so I don't know if it's compatible with Sage.
     
  13. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    Hi again,

    Another 'feature request' would be to add copy-paste functionality on nodes and state machines. It would be really useful if we could duplicate a state machine or a state!
     
  14. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I assume you are referring to this? http://unity3d.com/support/resources/unity-extensions/locomotion-ik.html

    If so, I've not tried Sage with it yet. I will give it a go and see how it works with it.
     
  15. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    That is definitely something I'd like to add at some point! I'll make sure it gets added onto the list of todo's!!!
     
  16. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    I did not see this post! Awesome man thanks a lot!
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Wow... this looks very promising... I have a ton of animation to do on my models, and this will save my bacon :)...
     
  18. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Yeah, bacon, that can clog your arteries lmao. Now i'm thinking of purchasing this for my fighting game project... will I also be able to sync up hit reactions and throw reactions with this?
     
  20. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    It could definitely handle hit reactions. Handling animations synced between two characters, such as picking up a character and throwing them, is beyond what Sage is built to do. The sort of thing you would need to use some other system to handle. However, Sage would still work with a system that can do this. You would simply need to stop or suspend the SageControllers for each character involved in the synced animations. And then resumes or start it again when the animations are done.
     
  21. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I looked into this a bit, and it looks like it would take quite a while to fully understand everything this system is doing. It appears to be mainly focused on animating the lower body, but it may be doing more than that. I think theoretically, Sage would work with it, as long as you don't have your Sage library trying to play the same animation clips as the Locomotion system, otherwise they would conflict with each other. But as mentioned, it looks like it would take alot of time to really figure out how well they work together. Hopefully that helps!
     
  22. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Ok, thanks. We'll stick with our current solution and see how it evolves knowing Unity has some great plans for animations in future.
     
  23. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.4 has been submitted to the asset store! (And is released on my website at www.alteredr.com/sage) The changes are as follows...

    • Added a Sync Anims feature to Blend Graphs to allow animations to blend together better. This works like Animation.SyncLayer, except only applies to anims in the blend graph.
    • Added ability to apply rotation from an animation in a state graph or blend graph, in addition to movement.
    • Added a delegate for applying character movement that can be overridden in a custom controller. This allows games to handle movement in their own way.
    • Refactored how character movement works to work better with a Character Controller.
    • Fixed a bug where certain prefab layouts would cause Sage to not properly find the Animation component.
    • Misc bug fixes.

    I'll post again once it has been approved in the asset store.
     
  24. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Last edited: Mar 19, 2012
  25. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage v1.4.1 has been accepted in the asset store. This is a small update that address a few specific issues as follows...

    - Added Threshold to Input Variable of type Stick. This controls the magnitude the stick must be pressed in order to update the variable.
    - Fixed an issue that prevented Input Variables from working in debug mode.
    - Updated demo input scripts.
     
    Last edited: Mar 19, 2012
  26. loki72

    loki72

    Joined:
    Aug 17, 2011
    Posts:
    13
    also posted in the A.R. forums to breath some life into them :)
    http://alteredr.prophpbb.com/topic6.html

    hi

    just purchased SAGE and have been going step by step over the demo. it seems when i use WASD to move.. all is nice and smooth. however when i use W A to move N.W. or S D to move S.E. the animation blend for strafe is playing backwards... though while using W D to move N.E. and A S to move S.W. work fine.

    any ideas why its doing this or how to fix it?

    thanks
     
  27. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Cool, I'll reply over on the Altered Reality Forums then. :)

    And as a quick explanation, it is because those animations were not created to correctly blend together. They were animations that came with the model in the boot camp demo, but I haven't been able to get an animator to fix them for me yet! :p
     
    Last edited: Mar 21, 2012
  28. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.4.2 has been released in the Asset Store!

    Patch Notes:

    - Added Direction Blend node which makes it easier to blend directional movement animations.
    - Added optional "and" to condition nodes.
    - Added SuspendAndPlayAnimations function to SageLibrary to take a list of animations to play while suspended.
    - Fixed a bug when a node slot has multiple output ports.
    - Fixed a bug where blend graph syncing wouldn't work when an animations speed was negative.

    http://u3d.as/content/altered-reality-entertainment/sage-anim-graph-editor/2AS
     
  29. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I am not sure if i can use this for mobile game making mainly for ios together with playmaker.
    I read that it uses and export c# scripts but will one infinite state machiene will work with another?
    Any infos about that?
     
  30. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    As far as I am aware, Sage works just fine with both iOS and Playmaker! I have talked with a company using Sage who only releases iOS games, and they seem happy with it. And I've been talking with another person who asked me Playmaker with Sage as well, and he has not indicated any problem working with Sage using Playmaker. As long as you can create custom nodes to interact with a SageLibrary, it should be no problem at all! The only platform I know of that Sage does not work with is Flash, which is due to Flash not supporting C# generics at this time.

    If you run into any snags at all with anything while using Sage, please feel free to contact me, and I'd be more than happy to help! :)
     
  31. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.4.3 has been released....

    Patch Notes:

    - Updated Soldier animations and SoldierSL Sage Library to ensure the movements blend better.
    - Fixed a potential issue where, when adding a node, it isn't immediately visible in the editor.
    - Fixed an issue where certain nodes would push unneeded commands at times that would break interrupt proper undo/redo support.
    - Fixed an issue where a node could get locked and unable to be moved.
    - Fixed an issue where if a selected node was deleted, it would get added back next time the selected node changes.
     
  32. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Hello,

    Nice to work with. It is easy to use for my work.

    BTW, is there any future plan to open and release run time source code, not editor's?

    Thank you,

    -Kim


    ps. I'll post a few feedback later.
     
  33. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Awesome, I'm glad you are enjoying it!

    I am planning on releasing the source code along with (or shortly after) v1.5.0. However, it will cost more than the compiled form of Sage. I will post more details when they have been finalized.
     
  34. Paulo-Henrique025

    Paulo-Henrique025

    Joined:
    Dec 12, 2010
    Posts:
    230
    If a have two animations, Look Up and Look Down, can i use Sage to interpolate the in between of theses animation to create infinite variations, such as "looking a little down" "looking center" based on a variable "Direction"?
     
  35. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    You totally can! However, if you are using additive pose animations for it, and need to use ClampForever, you'll have to wait for Sage v1.5, as it fixes some issues with ClampForever wrap mode.

    As well, Sage v1.5, with the new fully nested blend/state graphs, will make doing this alot easier too. Sage 1.5 should hopefully be finished in the next few days. I'm like 95% done! :)
     
  36. Paulo-Henrique025

    Paulo-Henrique025

    Joined:
    Dec 12, 2010
    Posts:
    230
    Thanks! I'm looking forward to use SAGE within my project, we are using the "Locomotion System" from the BootCamp demo, and its very hard to use/comprehend.
     
  37. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    ....and not free for commercial use. ;)

    Nice
     
  38. Paulo-Henrique025

    Paulo-Henrique025

    Joined:
    Dec 12, 2010
    Posts:
    230
    The tech from BootCamp demo isn't free for use???
     
  39. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
  40. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166

    Good to hear that!

    We use PoketRPG sword trail system for our animation which is available at AssetStore for free.

    The problem is that it uses its own custom Play() API instead of using Unity's Animation.Play().

    But there is no way to replace Play() API which is inside SageController. It would be good if there is any way to use custom Play API.

    If there is no other way except modifying it on source level, that's ok. That's why I asked about source release.

    Another thing what I've found is that Sage runs well on iOS. But it only can be successfully built with arm6 setting. With arm7, it fails.

    - arm6 : ok
    - arm6 arm7 : ok
    - arm7 : fail

    I'm looking forward to see the 1.5 version soon.

    Cheers,

    -Kim
     
  41. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397

    That's odd...what error are you actually getting while building for Arm7? Have you tried creating a new project, importing Sage, and building for Arm7? Could try that and let me know if works? Thanks!
     
  42. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    I went to go buy it ( i saw on the front page of this post that it was only $45 ) but now it is back up to $75. Shame I didn't but it earlier, I probably wont be able to get it now :(
     
  43. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Doh, I'm soooo sorry about that! I forgot to update the first post after the Asset Store Madness sale was off. It is currently $20 off, and on sale for $75!!! (The normal price is $95)
     
  44. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    *sigh* I really need this for my project...

    Alright, I've cracked. Purchasing now.

    I hope it is as amazing as it seems to be!
     
  45. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Hey, I seem to be having a bit of an issue. I followed your video tutorial with the solider 100%, except for the fact that instead of using an xbox controller I used WASD. The solider when running forward (holding W) seems to run forward for a second, blend in the strafe right animation, and then start running backwards. When holding S, the soldier does the run forward animation, and you cannot use a or d to strafe left or right.
    strafing left and right seem to be mixed up with each other.

    Here is my game controller code:

    Code (csharp):
    1. using UnityEngine;
    2. using SageInternal;
    3.  
    4. [AddComponentMenu("Sage/Game/PlayerAnimation_GameController")]
    5. public class Player_GameController : PlayerAnimation_BaseController
    6. {
    7.    
    8.     public override void Update()
    9.     {
    10.         Vector2 axis = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
    11.        
    12.         this.Direction = GetDirectionFromAxis(axis);
    13.         this.Speed = axis.magnitude;
    14.        
    15.         base.Update();
    16.     }
    17.    
    18.     public float GetDirectionFromAxis(Vector2 axis)
    19.     {
    20.         // check if the axis is zero, if so, return 0
    21.         if(axis == Vector2.zero)
    22.             return 0.0f;
    23.        
    24.         //make sure the axis is normalized
    25.         axis.Normalize();
    26.        
    27.         // swap x and y
    28.         float temp = axis.x;
    29.         axis.x = axis.y;
    30.         axis.y = temp;
    31.        
    32.         //get the angle, and offset if needed
    33.         float angle = Mathf.PI - ((float)Mathf.Atan(axis.x / axis.y) + (Mathf.PI / 2.0f));
    34.         if (axis.y < 0.0f)
    35.             angle -= Mathf.PI;
    36.        
    37.         //return the angle as degrees
    38.         return Mathf.Rad2Deg * angle;
    39.     }
    40. }
    41.  
    To my knowledge I followed the video perfectly, I even went over it twice. What am I doing wrong?
     
  46. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    First off, thanks for the purchase and supporting what I am doing with Sage!

    The script looks perfect to me to. It seems the problem would be in the graph...could you take a screen shot of the setup of your graph(s) and send the to me? You could either email them to alteredrealityent@yahoo.com, post at forum.alteredr.com, or post here as well. I'd be more than help with this or any other issue you may run into!
     
  47. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.5 has been released in into the Unity Asset Store! http://u3d.as/content/altered-reality-entertainment/sage-anim-graph-editor/2AS

    This is a pretty big update, and adds the ability to nest any graphs inside of any other graphs!!! This gives Sage pretty much endless possibilities for how your State Machines and Blend Graphs are setup and how they work together. :D

    Version 1.5.0 Release Notes

    - Added the ability to fully nest any graph inside of any other graph. For example, you can place a state machine in another state machine, or a blend graph in a blend graph. This allows the user full freedom to setup how they want their graphs to interact with each other!
    - Added a tree view to display the hierarchy of graphs.
    - Added new Blend Graph Nodes: Blend Graph, State Machine
    - Added new State Machine Nodes: Blend Graph, State Machine, Parallel State Machine
    - Fixed an issue where negative animation speeds would cause movement not to apply.
    - Fixed an issue where rotation would not be applied if there was no movement.
    - Fixed an issue that would cause a Direction node to not blend properly in some cases.
    - Fixed some undo/redo issues.
    - Updated the soldier demo library so that it looks alot better.
    - Updated documentation.
     
    Last edited: Apr 19, 2012
  48. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Here is my graph:


     
  49. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    It appears fine to me. It almost seems as if your input mapping are different. Have you tried importing Sage into a fresh project and running the example level? Does this work properly in that case?

    Also, have you tried using the new Direction node? It makes blending movement directions like this ALOT easier. The tutorial video was created before I added that node, which is why it doesn't mention that. I'm going to make a "what's new" supplementary tutorial video to watch along with the current tutorial in order to inform users of all the new features.
     
  50. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    I am checking out the direction node now but I have no idea how to implement it.