paatz04

  • 17 окт 2024
  • Регистрация: 12 фев 2023

    Thanks a lot!
    As usual I spend hours trying to fix it, then decide to post - and 20mins later I sort it out myself.

    Turns out the issue was moving characters using physics in Update() as opposed to not using physics or physics in FixedUpdate().

    Sorry for wasting your time and thank you for the great break down of problem solving regarding this issue.

    Hi,
    I'm noticing significant blur when moving/running with my character.
    I've tried different texture settings:
    mipmaps, compression/no compression, vsync, build vs editor, multiple screens, turned on and off anti aliasing, no post processing.

    I'm wondering if there is anything happening internally when scaling the character. We have set the scale to 0.002 - to match the size we'd like to have the character rendered. If we go to 0.01 the motion blur doesn't happen.
    Any tips how I can render the characters without having massive blur?

    Also when I screen record a video or take a screenshot the blur is not visible.

    Thanks!

    Best regards,
    Patric

    If we have 40 skins that can be toggled on and off. And 2 variations of each, how can we avoid creating a duplicate for each of those 40 skins. We understand how to combine these dynamically via code. We are trying to have 1 skin control the shade, and the others control the actual addons. Is that possible? Thanks!

    • Misaki ответили на это сообщение.

      Hey,
      We have a couple of helmets for our characters. The helmets share a skin-placeholder, but some helmets also have a light that is assigned to that skin. In the Spine Editor when pinning a helmet, then another one and unpinning the previous one, it behaves as we expect, the placeholder is replaced, and the extra light attachment is turned off.

      In unity the extra attachment lingers around, the stuff in the placeholders is replaced, but the light would just stay visible, even though the skin was removed from the newly applied mixAndMatch skin.

      We can fix this by adding every single skin attachment to their own skin placeholder, but this would require a lot of extra work. Do I need to refresh or update anything additionally in Unity?

      internal void SetSkin(string skinName)
      {
          m_activeSkinList.Add(skinName);
          UpdateSkin();
      }
      
      internal void RemoveSkin(string skinName)
      {
          m_activeSkinList.Remove(skinName);
          UpdateSkin();
      }
      
      internal void UpdateSkin()
      {
          var skeleton = m_skeletonAnimation.Skeleton;
          var skeletonData = skeleton.Data;
          var mixAndMatchSkin = new Skin("skin_match");
          for (int i = 0; i < m_activeSkinList.Count; i++)
          {
              Skin skin = skeletonData.FindSkin(m_activeSkinList[i]);
              if (skin != null)
                  mixAndMatchSkin.AddSkin(skin);
          }
          skeleton.SetSkin(mixAndMatchSkin);
          skeleton.SetSlotsToSetupPose();
          m_skeletonAnimation.AnimationState.Apply(m_skeletonAnimation.Skeleton);
          ColorTeam();
      }

      Thank you!

      Awesome thank you! I missed that setting.
      Now it's usually under 1ms, unless we have all 4 on screen. I've set it to Only Animation Status, if we don't use event timelines - that shouldn't cause any unexpected issues.

      • Nate оценил это.

      Hey,
      Currently spine is using the most CPU time by far in my game.43 calls to SkeletonAnimation.Update are causing around 4.2ms of CPU time (20ms during deep profiling).

      Is this the expected performance or am I doing something wrong?
      If it is the expected performance, I guess then I should start implementing my own culling for stuff that's not on screen?

      Thank you!

      • Harald ответили на это сообщение.

        Thanks so much for the explanation! I was only playing around with one of the other spotlights and didn't realize there was a separate light setup for it. This makes a lot of sense.

        Hello Harald. I've been playing around with the URP 2D renderer example. But I can't seem to see what effect the light mask has? Do I need to turn on any post processing for it to affect anything?

        Hi,

        I have an idle, aim, run and a shoot animation.
        Track 1 sets the animation to either idle, aim or run.
        Track 2 sets the animation to shoot.

        This is working fine so far, but the only limitation we are having is that we can't key the legs for the shoot, otherwise it'd override the legs of the run. Is it possible to have keyed legs for the shoot, but exclude those for when mixing it with the run? Like is there a way to give priority to certain bones on lower tracks?
        I know I could solve this by having 2 different shoot animations (1 with keyed legs, one without) but I'm trying to see if that can be avoided.

        Thanks,
        Patric

        Hey Misaki! Thank you, that actually helped me to debug the issue. The skin placeholder that was causing the issue, was assigned to one of the full skins as well as it's own skin.

        • Misaki ответили на это сообщение.
                  m_activeSkinList.Add(skin);
                  var skeleton = m_skeletonAnimation.Skeleton;
                  var skeletonData = skeleton.Data;
                  var mixAndMatchSkin = new Skin("skin_match");
                  for(int i=0; i < m_activeSkinList.Count; i++)
                      mixAndMatchSkin.AddSkin(skeletonData.FindSkin(m_activeSkinList[i]));
                  skeleton.SetSkin(mixAndMatchSkin);
                  skeleton.SetSlotsToSetupPose();       
                  m_skeletonAnimation.AnimationState.Apply(m_skeletonAnimation.Skeleton);

          Hi,
          I'm using the mix and match example to have multiple skins active at the same time.
          This is working great, but some of my skins don't spawn in the correct spot, instead there are a couple of frames where you can see it being at the wrong position and then adjusting to the right position.

          I've tried to find this in the documentation but couldn't find a lead.
          Any ideas how I can show it at the right spot straight away?

          Thank you!

          • Misaki ответили на это сообщение.

            Sorry I tried searching the forum and must have used the wrong keywords. Thanks for that!

            Hi,
            I was wondering if it was possible to achieve a similar effect as this with a spine skeleton?

            Thanks!
            Patric

            Calling m_skeletonAnimation.initialSkinName = "default";

            works on 3/4 but breaks another one of my spine characters. While setting it to "" - breaks the same one as if I don't set it at all.

            • Изменено

            Thank you Harald.
            Setting the default animation to my "run" animation fixed the error for me for 3/4 Skeletons but not for one of them. But trying to the same with my "aim" animation throws the same error for all of them.

            Both animations are setup the same way and show up just fine in the SkeletonDataAsset inspector.
            And all 4 characters are setup the same as well.

            We are not using skins at this time so that didn't seem to be required. Currently the Skeleton is assigned as a reference in the unity editor and not loading from Streaming Assets.

            IndexOutOfRangeException: Index was outside the bounds of the array.
            Spine.RGBATimeline.Apply (Spine.Skeleton skeleton, System.Single lastTime, System.Single time, Spine.ExposedList1[T] firedEvents, System.Single alpha, Spine.MixBlend blend, Spine.MixDirection direction) (at Library/PackageCache/com.esotericsoftware.spine.spine-csharp@c658453bb5/Animation.cs:1171)
            Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Library/PackageCache/com.esotericsoftware.spine.spine-csharp@c658453bb5/AnimationState.cs:266)
            Spine.Unity.SkeletonAnimation.ApplyAnimation () (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@c658453bb5/Runtime/spine-unity/Components/SkeletonAnimation.cs:252)
            Spine.Unity.SkeletonAnimation.Update (System.Single deltaTime) (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@c658453bb5/Runtime/spine-unity/Components/SkeletonAnimation.cs:239)
            Spine.Unity.SkeletonAnimation.LateUpdate () (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@c658453bb5/Runtime/spine-unity/Components/SkeletonAnimation.cs:273)
            Spine.Unity.SkeletonRenderer.Initialize (System.Boolean overwrite, System.Boolean quiet) (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@c658453bb5/Runtime/spine-unity/Components/SkeletonRenderer.cs:426)
            Spine.Unity.SkeletonAnimation.Initialize (System.Boolean overwrite, System.Boolean quiet) (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@c658453bb5/Runtime/spine-unity/Components/SkeletonAnimation.cs:187)
            Unit.SetUnitData (SpawnerLevelData spawnerData) (at Assets/_scripts/battle/units/Unit.cs:103)

            I've been loading the skeleton as you suggest (and the link)
            m_skeletonAnimation.skeletonDataAsset = UnitManager.Instance.GetUnitSkeletonData(spawnerData.m_id);
            m_skeletonAnimation.Initialize(true);

            But I'm getting the following error:

            IndexOutOfRangeException: Index was outside the bounds of the array.
            Spine.RotateTimeline.Apply (Spine.Skeleton skeleton, System.Single lastTime, System.Single time, Spine.ExposedList
            1[T] firedEvents, System.Single alpha, Spine.MixBlend blend, Spine.MixDirection direction) (at Library/PackageCache/com.esotericsoftware.spine.spine-csharp@c658453bb5/Animation.cs:481)`

            Hey I was wondering if there was an easy way to load spine data from Streaming Assets.
            We are setting our game up for modding, and a lot of our other assets (png's, json data files etc.) are exposed in Streaming Assets. I was wondering what the best way would be to also load spine characters from Streaming Assets with the goal to expose them to the players and let them modify them.

            Cheers!