Character animation and movement test

Just testing out another aspect of the engine - animation and character movement. This engine is just so good.

vid

debugrenderer

edit: added debugrenderer vid

Ah that looks cool. Can you share the code for that? I made a platformer with animations but I feel that the animation code is not done properly. Urho’s CharacterDemo is using an AnimationController, are you using that too like in that sample?

Hmm, it’s not so much the code but the animation set that I bought from the unity store. Luckily, the set that I bought had “InPlace” and “RootMotion” sets, and I used the RootMotion set to extract displacement per frame and convert that to velocity. And yes, I’m using 18_CharacterDemo code with AnimationController.

Mind sharing the set you nabbed? I like the dummy character, and it looks like it has enough animations for me to make use of it without fiddling around with 3DS Max for a few weeks.

Hasn’t the Unity Store License something that you can only use the resources with Unity?

Unfortunately, the EULA restricts me to pass them around. Edit – it says “you can not re-sell my animations, or give them away to someone else, even if you modify them.”

Good question, but the question is very broad. I haven’t looked at every asset being sold at the Unity Store to know if any one of those are restricted to used with Unity only. I can tell you that everything that I bought had no restriction to Unity only. I’ve also looked at assets from Unity Essentials, made by Unity, and those have no license. Most asset license that I bought typically read something like: “royalty free, world wide, for any number of games or applications.”

If you aren’t sure if the license has a restriction to Unity only, you should visit the publisher’s site and see. Kubold for example states in their license:

ref - http://www.kubold.com/?page_id=527

I think, the license prohibits distribute animations separately, but allows as part of a product (otherwise how to sell the game?). Demo is product xD

Unfortunately, the EULA restricts me to pass them around. Edit – it says “you can not re-sell my animations, or give them away to someone else, even if you modify them.”
[/quote]

I meant a link to the set you found :stuck_out_tongue: I assume I can access that asset store from a browser?

Assets in the Unity Store seem to be either under the default proprietary Unity Store License or one of three free licenses. Custom licenses are not allowed.
Couldn’t find anything about not redistributing outside of Unity though. Thought I read that somewhere in their default license.

[quote]
I meant a link to the set you found :stuck_out_tongue: I assume I can access that asset store from a browser?[/quote]

Kubold, link in my previous post. The guy has many assortments of animations.

[quote=“gawag”]Assets in the Unity Store seem to be either under the default proprietary Unity Store License or one of three free licenses. Custom licenses are not allowed.
Couldn’t find anything about not redistributing outside of Unity though. Thought I read that somewhere in their default license.[/quote]

I didn’t know Unity can put a restriction on all assets sold on their store to be used only for Unity game engine. I’ve never seen that license. No matter, I bought my assets directly from publisher’s site.

Found this in “Asset Store Terms of Service and EULA.”

So the Unity Essential assets can not be distributed. Good to know, but I haven’t used that anyway.

[quote=“Lumak”]

[quote=“gawag”]Assets in the Unity Store seem to be either under the default proprietary Unity Store License or one of three free licenses. Custom licenses are not allowed.
Couldn’t find anything about not redistributing outside of Unity though. Thought I read that somewhere in their default license.[/quote]

I didn’t know Unity can put a restriction on all assets sold on their store to be used only for Unity game engine. I’ve never seen that license. No matter, I bought my assets directly from publisher’s site.[/quote]

Of course they can’t change the copyright but they can disallow certain license terms of stuff published on their site. As it seems they only allow one of four licenses to choose from when publishing stuff on the store.

I’m still not convinced that Unity restricts all assets sold on their store to be used only with Unity game engine.

I read the “Unity Asset Store Terms of Service and EULA” again and can’t find where it states that. What I found was this phrase:

[quote]2.2
Licensor grants to the END-USER a non-exclusive, worldwide, and perpetual license to the Asset to integrate Assets only as incorporated and embedded components of electronic games and interactive media and distribute such electronic game and interactive media. Except for game services software development kits (?Services SDKs?), END-USERS may modify Assets. END-USER may otherwise not reproduce, distribute, sublicense, rent, lease or lend the Assets. It is emphasized that the END-USERS shall not be entitled to distribute or transfer in any way (including, without, limitation by way of sublicense) the Assets in any other way than as integrated components of electronic games and interactive media. Without limitation of the foregoing it is emphasized that END-USER shall not be entitled to share the costs related to purchasing an Asset and then let any third party that has contributed to such purchase use such Asset (forum pooling).[/quote]

The first sentence:
[quote]… integrate Assets only as incorporated and embedded components of electronic games and interactive media and distribute such electronic game and interactive media[/quote]

It doesn’t specify that the electronic games have to be made with Unity game engine. And I only see one EULA, not four. Maybe someone can point to where this restriction is cited.

[quote=“Lumak”]I’m still not convinced that Unity restricts all assets sold on their store to be used only with Unity game engine.

I read the “Unity Asset Store Terms of Service and EULA” again and can’t find where it states that. What I found was this phrase:

[/quote]
As I already said I couldn’t find that either. Maybe they changed that or I misunderstood something.

[quote]
The first sentence:
[quote]… integrate Assets only as incorporated and embedded components of electronic games and interactive media and distribute such electronic game and interactive media[/quote]

It doesn’t specify that the electronic games have to be made with Unity game engine. And I only see one EULA, not four. Maybe someone can point to where this restriction is cited.[/quote]
The part with the four available licenses is in the store submission guidelines linked from unity3d.com/asset-store/sell-assets:
unity3d.com/asset-store/sell-ass … guidelines
Under 6.2:

[quote]6.2 Licensing your Content
For the sake of consistency, all Asset Store offerings are covered by a license we have created. Please have a look at the End User License Agreement to be sure you are comfortable with it. If you are offering your content for free, you have the further option of selecting one of three free-licenses, which override the basics of our commercial license. Please do not include your own license terms in your offering.[/quote]

Ok, thanks for the links. The submission guidelines 6.2 refers back to “Asset Store Terms of Service and EULA.” It’s clear to me that there’s no restriction about having to use Unity game engine for 3rd party assets.
I wonder if, rather, doubt Unity will offer 3rd parties an exclusive license to restrict the assets to be only used by their engine/platform.

Let me cover how I incorporate the RootMotion in my character demo. It’s a very simple process.

Using the jump animation as an example, I extracted the Hips/Pelvis node key frames from RootMotion, which is this:

Jump animation AnimationKeyFrame - total frames = 17
frame= 0, t=0.0333, pos(0, 0, 0)
frame= 1, t=0.0666, pos(0, 0.0957, 0.3708)
frame= 2, t=0.1000, pos(0, 0.2871, 0.6140)
frame= 3, t=0.1333, pos(0, 0.4306, 0.7775)
frame= 4, t=0.1666, pos(0, 0.5941, 0.9131)
frame= 5, t=0.2000, pos(0, 0.7297, 1.0328)
frame= 6, t=0.2333, pos(0, 0.8533, 1.1484)
frame= 7, t=0.2666, pos(0, 0.9251, 1.2521)
frame= 8, t=0.3000, pos(0, 0.9530, 1.3877)
frame= 9, t=0.3333, pos(0, 0.9650, 1.5113)
frame=10, t=0.3666, pos(0, 0.9490, 1.6229)
frame=11, t=0.4000, pos(0, 0.9171, 1.7505)
frame=12, t=0.4333, pos(0, 0.8533, 1.8781)
frame=13, t=0.4666, pos(0, 0.7656, 2.0337)
frame=14, t=0.5000, pos(0, 0.5742, 2.2091)
frame=15, t=0.5333, pos(0, 0.3150, 2.3726)
frame=16, t=0.5666, pos(0, 0.0837, 2.5241)

Secondly, keep track of curPos and prevPos each frame using a similar method found in void AnimationState::ApplyTrackFullWeight()
and acquire deltaPos = curPos - prevPos;

Orient the deltaPos in character orientation:
Vector3 vDisplacement = body->GetRotation() * deltaPos;
Knowing vDisplacement and timeStep, calculate linearVelocity = vDisplacement * (1.0f/timeStep); and just call rigidbody->SetLinearVelocity();

I also turn off gravity during the jump motion to get an exact match of the animation (the animation already accounts for gravity).

[quote=“Lumak”]Let me cover how I incorporate the RootMotion in my character demo. It’s a very simple process.

Using the jump animation as an example, I extracted the Hips/Pelvis node key frames from RootMotion, which is this:

[/quote]
So you are moving the bones manually and not with the normal system with the .ani files? Or are you converting that somehow?

The character changes it’s position in the animation? That should yield problems when using physics. You would have to offset the physical player shape somehow to match the animation offsetted model.

So you are moving the bones manually and not with the normal system with the .ani files? Or are you converting that somehow?
Yes, you move the rigidbody with linear velocity. So the body and the character will be in sync. If you play the rootmotion in the game, the animation character will out of sync with the body.

The character changes it’s position in the animation? That should yield problems when using physics. You would have to offset the physical player shape somehow to match the animation offsetted model.
The character’s position changes by matching rigidbody’s position, as mentioned above. Manipulating rigidbody’s linear velocity is similar to applying ApplyImpulse(), the character will naturally follow the body in the system. I turn off/on the gravity using an animation trigger file.

One caveat to implementing this displacement mover is you’ll need to smooth out the camera. I’m still working on tweaking mine.

Created a video with physic debugrenderer turned on.

T-pose

vid

the best way is extracting the motion of root bone offline and the store the motion vector in animation resource, my way is modifying the animation in script after the animation is loaded.
the difficult part is animation with rotation or root motion bone is pelvis(the bone has the motion is no the root bone but with local rotation and position)