Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Smooth Moves - 2D Skeletal Animation

Discussion in 'Assets and Asset Store' started by echo17, Feb 20, 2012.

  1. astrospoon

    astrospoon

    Joined:
    Mar 23, 2009
    Posts:
    16
    I'm planning to purchase this for a game I am making, but I wanted to check if a few features would work.

    1) Can you use characters you create in Smooth Moves in a 3D enviroment? (Similar to sprites in the orginal Mario Kart, or Doom, etc... basically as billboarded sprites in a 3d engine.)

    2) I read earlier that if you want to make variations of a character, you need to create an atlas of the characters textures, and then copy the atlas texture into photoshop and paint over it to create the variant. However, if a change needs to be made to the original (like a new frame added), and it changes the atlas layout, then all of your other textures need to be manually recreated which seems like it could be a nightmare. Does V2 provide a better solution for this?

    3) Specifically, I want to have players be able to customize their gear, which means using any combination of say pants, shirt and hat or whatever. Would I basically need to use a different material for each part of a character I would like to be able to swap? This could be really bad for draw calls. Is there a way to dynamically create an atlas that can be used, where specific pants, shirt and hat textures can be fit together into one atlas?
     
  2. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yep, you sure can. Have a look at my minigame, "Rise of the Dough". It is entirely 3D with 2D character animations made with SmoothMoves. You can play online here.

    This is the method to use if you wanted to swap an entire material. Yes, if you change your atlases a lot, then you'd have to update your swapped materials as well. If you go that route, I'd recommend creating your alternative atlases as a last step.

    Alternatively, you could just swap individual bones out with other textures, thus not needing to create mirror atlases. The swap keeps track of the texture's location in the atlas, even if it moves around with multiple builds.

    No, there is no way to dynamically create atlases at this time. To reduce draw calls, you'd need to do some planning on how you want your textures organized. Depending on your project requirements, this could be by clothing type (pants, shirt, hat) or by clothing set (warrior, monk, cleric).
     
  3. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Hey guys, check out The Unity Toolbox when you get a chance.

    It's a pretty cool project that is webifying the asset store (something that is sorely needed). I can't tell you how many times I wanted to browse the asset store without having to have a copy of Unity running on my machine (like my iPad). It's sparse, but growing.

    SmoothMoves is the latest project to be featured!
     
  4. astrospoon

    astrospoon

    Joined:
    Mar 23, 2009
    Posts:
    16
    This might be something to think about in the future. It usually isn't possible to lock down all your art and then start creating variations, since most people tend to iterate a bunch as they go. Imagine trying to make a game like Diablo, and then as a last step, creating all the loot variations once the entire game is done. It isn't very feasible.

    Thanks for the reply though... purchasing now!
     
  5. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yeah, I would recommend using the texture swapping method for its simplicity.
     
  6. I have a case where a texture atlas is not unloaded even after the game object with the animation is destroyed.

    When I do the following (pseudo code), things seems ok:
    - GameObject gameObject = (GameObject)Instantiate(Resource.Load("MyBoneAnimationPrefab"));
    - Destroy(gameObject)
    ---> At this point the atlas texture is still loaded
    - Resources.UnloadUnusedAssets() OR loaded another scene
    ---> Atlas texture now unloaded

    But if instead of explicitely calling Destroy on the gameobject, I just load another scene, the object in the current scene is destroyed (OnDestroy() was called on him) but the atlas texture is not unloaded, even after calling Resources.UnloadUnusedAssets().

    I don't have this issue with either scenario when doing the test with a game object that is only a cube with a texture on it. The texture is always unloaded.

    This was tested on iPhone.
    Textures loaded was known by using:
    Texture2D[] allTex = FindObjectsOfTypeIncludingAssets(typeof(Texture2D)) as Texture2D[];
    GameObject loaded was known by using:
    GameObject[] allObjects = FindObjectsOfTypeIncludingAssets(typeof(GameObject)) as GameObject[];

    Is this a bug, something I'm doing wrong or is it normal that I have to explicitly call Destroy on a SmoothMove BoneAnimation Objects?

    I have a small project I can send you if you wish.
    Thanks
     
  7. estivador

    estivador

    Joined:
    Nov 5, 2012
    Posts:
    4
    i 'm thinking in buy the smooth moves and watching the videos and reading the feats, i don't see if the tool have a option to make a distortion in one asset, i know its a bunch of squares with the images, but its possible to do something like this:



    i'm sorry if i didn't see this possibility, and if don't have, have any chance to add this feat. in a future update?
     
  8. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Loading and unloading of resources is a function that Unity performs. SmoothMoves has no control over this.
     
  9. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Nice artwork! No, unfortunately you cannot do the distortions you have shown. Mainly this is a complexity (and therefore memory) issue. It would require one bone per vertex (instead of one bone per quad). This would quadruple the memory needed to store all the data. Sorry, but I don't have any plans to incorporate this.
     
  10. kremedved

    kremedved

    Joined:
    Nov 8, 2012
    Posts:
    14
    How to create an animation of particles from a code without creating a lot of instances BoneAnimation in Hierarchy?
    If i create one BoneAnimation in Hierarchy and give it all the elements of my class, only the one particle rendered

    Sorry for my bad english



     
    Last edited: Nov 10, 2012
  11. moonrabbit

    moonrabbit

    Joined:
    Sep 14, 2012
    Posts:
    2




    I don't know this is bug or intended behavior, but Smooth Moves' generated animation has a lot of draw calls. This happens when there are 2 atlases used and their textures interleaving (with different hierarchy). For example, I have four bones having refs to weapon atlas and other bones to character atlas. This results in 7 submeshes even if I used only two atlas images.

    Your example chef character has also three submeshes, making three drawcalls per chef.

    Is there any solution for this?
     
    Last edited: Nov 11, 2012
  12. kremedved

    kremedved

    Joined:
    Nov 8, 2012
    Posts:
    14
    When a single animation is finished and the last frame of a few bones with alpha, calling Play () as a result they without alpha channel, is there some other way out than to use HideBone ()?
     
  13. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    564
    Hi, I'm trying to update my project but force build is taking too much.
    I have 5 2048x2048 texture, 5 bones animation and almost 300 animated gameobject per scenes.
     
  14. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    Is there a way to unregister from the callbacks for the BoneAnimation object after registering to them?

    RegisterUserTriggerDelegate();
    RegisterColliderTriggerDelegate();
    RegisterCollisionDelegate();
     
  15. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Sorry, I'm not sure what you are asking here. Can you send me your project to support@echo17.com with a detailed description of:

    1) What your are trying to accomplish
    2) What actually happens
    3) What steps to take to reproduce the issue
    4) What scene, code, and animation are relevant to the issue
     
  16. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yep, this is by design. I could have optimized the chef by placing the weapons in the same atlas, thereby getting one draw call, but I wanted to demonstrate the ability to have multiple atlases per animation.

    The reason that Unity has so many draw calls is that it has to draw each submesh, switch materials (triggering another draw call), then draw the next submesh, switch materials, etc. To optimize, you can:

    1) Reduce the number of atlases being used in your animations
    2) Group your atlases by depth as closely as possible. see the explanation i gave a while back on how Unity structures the mesh here.
     
  17. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    I'm not sure what you are asking here. Are you wondering how to hide a bone after an animation? If so you can do this in a couple of ways:

    1) Set a user trigger at the end of the animation. When you process the trigger, hide the bone.
    2) Set the bone color to zero alpha, with full blend. Be sure update colors is on.
     
  18. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    You only need to use force build when updating the plugin or updating multiple scenes (like before building for a device). Auto-build will only update the animations that change between playing the scenes.
     
  19. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Not currently, but that is a good item for my TODO list. Thanks!
     
  20. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    I'll just write a wrapper to handle it for now then.
     
  21. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Last edited: Nov 13, 2012
  22. netlander

    netlander

    Joined:
    Nov 22, 2011
    Posts:
    28
    For the price you're charging, should create a dedicated forum instead of using one forum thread on Unity's site.
    Come on!!!
     
  23. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Thanks for the suggestion! I have it on my TODO list.
     
  24. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    In v2, performance is much better. Notably, setting a bone animation to be inactive/active is lighting quick now. I think in v1, it rebuilt the whole bone hierarchy each time it was active again. Excellent work and just at the right time for me.
     
  25. Kiff

    Kiff

    Joined:
    Jul 13, 2012
    Posts:
    2
    Last edited: Nov 14, 2012
  26. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
    Hey folks,
    our graphics are exported in several resolutions. This works great for other plugins like NGUI which uses reference atlases to dynamically reference to other atlases with different resolutions. The mesh size stays the same, only texture size is different.

    Something like this would also work great with Smooth Moves. I would generate a second atlas, setup the pivots of the new atlas sprites and it should work with the animation data.

    But currently I found no possibility to achieve this with Smooth Moves 2. Did I overlooked something?

    Short summary, textures have different sizes BUT mesh size stays the same, so it technically should work.
     
  27. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Glad to hear it's working for you!
     
  28. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Sorry about that. My other domain expired (my old company name). Guess there are a lot of references to that link around the internet.
     
  29. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yep, check out chapter 8.3 in my user manual: http://www.echo17.com/support/smoothmoves_user_manual_v2.pdf

    You can create high resolution graphics, do your animations, then create low res graphics and swap at runtime if needed.
     
  30. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
    Ok, so there's no way to arrange a smaller atlas with same sprites and reference these.
     
  31. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yes, chapter 8.3 outlines how to do this.
     
  32. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    I just imported the new version into an empty new project and can not kill one pizza.

    I get this two errors:
    1.
    NullReferenceException: Object reference not set to an instance of an object
    SmoothMoves.BoneAnimation.RegisterColliderTriggerDelegate (SmoothMoves.ColliderTriggerDelegate colliderDelegate)
    Chef.Awake () (at Assets/Rise of the Dough/Scripts/Chef.cs:149)
    2.
    dt >= 0

    Edit:
    Ok i found the update pdf and load the projects settings and restart it with the latest unity 4 version from yesterday and still have the null reference excaption :)
     
    Last edited: Nov 15, 2012
  33. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    I am also interested in how i can make my later animated character shoot with i.e. a simple gun?
    How do i have to set the charcter up so i can later change the gun/ammo?
     
  34. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Please read the "readme.txt" file: import the RiseOfTheDough_ProjectSettings package. This sets up the layers and physics matrix.
     
  35. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    I imported the project settings already and the layers and physics look like in the update pdf from you and i then saved the scene and projects and start unity again but do get the same error
     
  36. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Just be sure your default pivot points (those set in the atlas) correspond to your weapons' holding points. For example, a good pivot point for a gun would probably be the grip. So every gun texture should pivot around it's grip.

    Then, at runtime, you can call one of the swap texture functions to switch out the guns (see the code in Rise of the Dough that swaps the rolling pin for the knife and cleaver). You can also check out the minigame to see how the pivots are set up on each weapon so that they'll be in the right place when swapped.
     
  37. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    Ok, i understand that and will look at your example but how can i make a gun shoot?
    Do i have to put an extra bone to the animation for each possible point where a bullet can come out of different guns if the have different size?
    Are the bullets part of the animation?

    Edit:
    With different sizes i mean i.e. i have one simple gun and a second shootgun with a longer gun barrel.

    I also just saw you 5 new video tutorials and want to ask if you will make more and if i can use the others still to learn from them (i.e. to learn how to switch the sword tutorial)?
     
    Last edited: Nov 15, 2012
  38. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Hmmm...that is odd. I would try to redownload the project from Unity (click the arrow next to import and select redownload -- it will prompt you if you want to update, just click yes). Be sure to set up a new project. Once the files are imported, import the settings package again.

    Importing can be a bit finicky in Unity, sometimes it takes a few tries until it all gels.
     
  39. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    That's really up to you. You could have various bones designating the end of each weapon's barrel and then select your bullet spawn bone based on the current weapon selected. I would not place the bullet in your animation, instead make it a separate object (preferably a sprite for simplicity) and instantiate it at your barrel bone's location.

    I plan on creating more tutorials. Support has taken up a good chunk of my free time :) but I'll eventually get to them.
     
  40. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    Have to say that your asset is great like your support too :)

    Just created a new project and ... but still the same error.

    I am not the expert but it look like the collider from the weapon is not setup correct. Can i recreate this by hand because the rest of the game is working.
    When i saw the scene i am wonder why you have the left wall with the oven and the fridge there a second time? When i walk true the scene in playmode i am always in front of them and so it makes no meaning for me.

    If i have the playmaker scripts from you, will they still work?
     
  41. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hey,

    I'm having some issues with "SwapBoneTexture"

    I have 3 atlases created

    I have created an animation that uses some of the textures from Atlas 1.

    Then at run time I want to swap the bone texture with one from another atlas.

    Here is what I have:

    Code (csharp):
    1. Enemy.SwapBoneTexture("Weapon", "Atlas1", "baseballBat", "Atlas2" , "pistol");
    Now when I run this, I get a null exception stating it can't find "Atlas2".

    Thanks,
    JL
     
  42. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    I do this to cover the pizza sauce splats that hit the floor. Since it isn't a true 3D environment, the sauce would look like it is floating in front of the walls / fridge. The extra layer covers that and gives it the illusion of 3D.

    The playmaker scripts should still work.
     
  43. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    In order for the animation to swap out to a new atlas, you'll need a reference to the new atlas in your animation as well. What I usually do is create a bogus animation clip with no frames, setting frame zero of one of the bones to a texture using the new atlas. This clip won't be played at all, but it sets up a reference to the other atlas.
     
  44. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Ok, great, that did it,

    Are all the atlases loaded into memory that are referenced? Or just the ones that have textures that are visible by the camera?

    Thanks,
     
  45. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Unity loads any asset that is referenced by an object in your scene. So if your bone animation is pointing to a bone animation data asset, which in turn points to several atlases, then they will all be loaded into memory at scene creation time.

    It would be crippling on mobile devices if the assets were loaded as necessary based on visibility.
     
  46. Sehui

    Sehui

    Joined:
    Nov 16, 2012
    Posts:
    2
    I'm still debating that I'm gonna buy smooth Moves or not.
    Today, Unity 4 is coming. How about this tool? Does it support Unity-4 ?
     
  47. silversteez

    silversteez

    Joined:
    Sep 25, 2012
    Posts:
    12
    i just upgraded my project to Unity 4 and smooth moves seems to be working just fine.
     
  48. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    Sadly i still can not play and learn from rise of the dough in unity.
    I started a new project a couple of times now and even tryed it only with the free rise of the dough asset from the store and can see that everything changed after i ad the project settings so after importing they have the right tags and physics.

    I use the latest Unity 4 RC in Win 7 64bit.
    Will try it on my mac now but it should run on win too.
    (I know, most of the time the failure is sitting in front of the monitor ;)

    Echo17 please help.

    Edit:
    Ok, i get the same error on the Mac :(
    Smooth Moves is working and most of the game too but i can not hit the pizzas :(
     
    Last edited: Nov 16, 2012
  49. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Yep, silversteez is correct. SmoothMoves will run on Unity 4. I will continue to publish updates on 3.5.6 for as long as I can, however, so the pro folks out there aren't forced to upgrade.
     
  50. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,241
    Sounds like your download from Unity became corrupted. Be sure you redownload it fresh from the Asset store:



    If you still can't get it to work, email me your invoice number you received when you purchased the plugin to support@echo17.com and I'll send you the package directly.