kelvinvv

Hello spine users/developers,
We encounter a very big problem in our skype animations. I myself create all sounds for these animations, like footsteps/grabs etc. I let these sounds play through events since there is no other way of doing this.

When I test our work on IOS/Android devices, I've noticed that it skips some audio events randomly. Example: audio1.aiff should play at 1 second/30 frame, but it skipped, I replay the same animation and then it does play. How is this possible?



Then the second question, is it possible to HEAR the actual sounds that i put in spine when I play the timeline? This could save so much time + better implementation of sound in animations. For a 300$ program I assume this should work.

Greetings, Kelvin
kelvinvv
  • Mesajlar: 2

Mitch

Mecanim or SkeletonAnimation?
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

kelvinvv

Mecanim

-- 06 Oct 2015, 10:15 --

Does Mecanim give conflicts? Or is this an unknown bug
kelvinvv
  • Mesajlar: 2

Mitch

Bugs like that exist in normal 3D unity Mecanim animations too.. I'm not sure Unity cares. Its been a problem for a long time.

Often the first loop of an animation will skip events during the first few frames during a transition.
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

Majicpanda

Mitch yazdı:Bugs like that exist in normal 3D unity Mecanim animations too.. I'm not sure Unity cares. Its been a problem for a long time.

Often the first loop of an animation will skip events during the first few frames during a transition.
Yea I notice this sometimes with my attacks and trying to use mecanim timeline events, they're unreliable for very important things.

Mitch, so is there no guaranteed way to get the spine events if using the Spine Animator and mecanim? I was debating to switch to an overlapcircle for my attacks based on a single frame Spine event in my animations because I have many different ones based on skill types. I noticed bounding box attachments seem to be pretty reliable, are they not based off of mecanim events to turn them on and off?

FYI to OP:
http://answers.unity3d.com/questions/806949/animation-events-not-firing.html

Basically I think you can work "around" the problem as long as your events are never in transition frames.. which is hard to 100% address.
Majicpanda
  • Mesajlar: 197

Mitch

Its fucking impossible to address in 100% of cases... I hate mecanim so much. I should just delete SkeletonAnimator from the repo. If someone gets me drunk enough I'll do it i swear!

The only "Fix" is to run the events timeline from Spine in parallel with Mecanim :/ I guess :/
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

Majicpanda

Mitch yazdı:Its fucking impossible to address in 100% of cases... I hate mecanim so much. I should just delete SkeletonAnimator from the repo. If someone gets me drunk enough I'll do it i swear!

The only "Fix" is to run the events timeline from Spine in parallel with Mecanim :/ I guess :/
Now I know why my mecanim questions don't get answered, lol ;)

Seriously though I couldn't see how to do things without it... the transitions and networking part becomes 1000x easier with mecanim. If there was an easy way to not use mecanim and get Skel Animation instead working with NodeCanvas, networking, transitions and a state machine idea believe me I'd probably do it... it's just hard to concept out that spaghetti of code needed.

Oh yea and the override controller basically makes it no work to re-use logic for some 100+ different monsters or add new nodes quickly visually.

-- 08 Oct 2015, 09:41 --

Mitch, how are bounding box attachments handled? Mecanim events if using mecanim?

I just ran into an issue where I changed my hit collider to be on 1 frame then off the next and sometimes it stays enabled... possible it's missing the turn back off frame somehow or is this a spine problem and not specific to mecanim?
Majicpanda
  • Mesajlar: 197

Mitch

BoundingBoxFollower just polls the current state every Unity frame.

It is possible for events to be missed. It is not possible for BoundingBoxFollower to miss - it may be a frame late in really weird situations.
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

Majicpanda

So it detects the current state of the collider and if it "should" be disabled and in that frame it is not.. it corrects it?

I'm just seeing some oddities where there are complete misses where it doesn't enable and then other times where it doesn't disable so I can run around stabbing people with my sword without swinging etc.

Is it possible blending or interrupted animations could cause issues? Like if you are swinging and the collider is enabled but you get hit and it instantly goes to the Get Hit animation that has no information about bounding boxes, it will never know to correct itself?

I seem to be able to get around this issue if I set all bounding boxes disabled in the start of every one of my animations, but that's pretty cumbersome of a workflow.
Majicpanda
  • Mesajlar: 197

Mitch

If you have multiple slots with Bounding Boxes on them its possible that you're blending through a frame that Disables it so it never actually gets disabled. You can use SkeletonUtility to check the state of any attachment/slot during runtime to see if the attachment itself got turned off, but for whatever reason not the collider controlled by BoundingBoxFollower.

I deal with this with my Hitman character pack by having an animation called "ClearAttackBoxes" or something of the like that literally only has keys to disable all the attack colliders. I don't blend it into the animation track, I just apply it directly to the skeleton when necessary (ie: when done transitioning)
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

Majicpanda

Is there any way to manually enable the collider in code? I notice you can iterate the BoundingBoxAttachment but nothing is exposed but the name and vertices.

Since we all know mecanim is very .. fun to deal with, I was considering using the normalized time of the attack animation to enable it in code and then simply disable on any exit of the attack states (quite easy in mecanim 5 in 1 simple script and OnStateExit). This would also allow me to track when the attack starts so that a target cant be hit more than once and then when finished clear the targets queue and inflict damage upon them.

I'm bound to mecanim due to designers and the ability to tie easily into it with NodeCanvas for some very robust AI we will be implementing, otherwise I'd jump ship and just use SkeletonAnimator.
Majicpanda
  • Mesajlar: 197

Mitch

Yes. The way is to not use BoundingBoxFollower. Use Skeleton Utility Bone's collider function. That'll permanently generate colliders you can do what you want with.
Kullanıcı avatarı
Mitch

Mitch
  • Mesajlar: 978

Majicpanda

Thanks for all the additional options Mitch, I know you hate dealing with Mecanim.

After playing around a bunch I was able to get some very solid results by adding lots more keyframes for enabling and disabling the collider during animations instead of just 1 on and then 1 off. It definitely wasn't a transition issue, so I'm not sure how the inner workings of Mecanim + bounding box follower works but it does seem possible to miss an enable or disable somehow with all the testing I've done.

If my attack anim is 20 frames I basically made 3 frames "enable" the collider and then 3 to disable it to give it a better chance at hitting one of the disables.

The bone collider option could be a last resort but that doesn't easily fix the "sometimes doesn't enable" issue I was seeing.. it would just allow the ability to completely disable them all easily to ensure they don't stick on, but I'm seeing a mix of sometimes not enabling and not disabling.. < 5% of attack animations.

The game currently runs at about 90fps so I can't see it being a frame skip issue.
Majicpanda
  • Mesajlar: 197


Dön Unity