prog112

Hey.
Another problem that I've had for a while and have no idea how to solve/ what is causing it.

Sometimes between some of the animations there is this one frame where almost everything disappears/gets all weird and it goes away after a frame or so. Hard to explain so please look carefully at this gif (notice for example after character rolls for the third time what happens):

http://i.imgur.com/0Ez2o8l.gifv

As if my attachments got distorted or something. When paused it looks like this:



Weird, right? Well, I'm looking for ideas what the hell is this.
prog112
  • Postovi: 8

Pharan

Can you enable rendering wireframes in your Scene view (upper left menu) and try to screencap it again when it happens?
The shape of the underlying mesh will be informative.
Avatar
Pharan
  • Postovi: 5366

prog112

Here's just few frames before:


And problematic frame:


Also: I've noticed that when I change crossfade mix time from standard to say, 4s, it actually flicks multiple times:
gif - http://i.imgur.com/D3EkBqx.gif
prog112
  • Postovi: 8

Pharan

Sorry, I meant both the wireframe and the render. I think it's called "Shaded Wireframe".

Do you have any hunches as to why it only happens with the armor and not with the base body?
Avatar
Pharan
  • Postovi: 5366

prog112

Okay, there seems to be something weird showing up top/right part of the character when the flick happens. No idea what is it though:



prog112
  • Postovi: 8

Pharan

Do you have any hunches as to why it only happens with the armor and not the base body?

On a separate note, why are those quads so huge?

-- 22 Dec 2015 2:07 am --

Can you zoom in as much as you can on the left view?

-- 22 Dec 2015 2:08 am --

You can press ctrl F or shift F or something, to let the Scene View camera follow your gameobject.

-- 22 Dec 2015 2:11 am --

On the off chance it works, try replacing your SkeletonRenderer.cs with this code: https://gist.github.com/pharan/44f1b72f2e418bbc1fdb
Click on "Raw" to get an easy-to-copy-paste version.
It includes a fix with some extra checks that are supposed to handle certain weird cases. Not sure if the same bugs it's supposed to fix is causing your problem.

You can restore to the original version of SkeletonRenderer by copying this code: https://raw.githubusercontent.com/EsotericSoftware/spine-runtimes/master/spine-unity/Assets/spine-unity/SkeletonRenderer.cs
Avatar
Pharan
  • Postovi: 5366

prog112

Armor is done with attachments so maybe that's why?

Why are the quads so huge - no idea. Big textures probably :D



-- 21 Dec 2015, 18:16 --

The new SkeletonRenderer doesn't work unfortunately.
prog112
  • Postovi: 8

Pharan

It's unfortunately really hard to tell what it's doing with the meshes like this.
If you have permission, you can send your spine project (and unity project if it's not too big) to unity@esotericsoftware.com for investigation.

When you say "armor is done with attachments"; what do you mean by that?

And on that tangent.
You should pre-trim your images next time. You should know that these giant quads mean that it's eating up GPU processing power (fillrate allowance) rendering giant transparent areas in your texture. Have enough of similar skeletons like these and it will slow down your game significantly, and for no benefit.
Avatar
Pharan
  • Postovi: 5366

prog112

Ok, I've sent you an email!
prog112
  • Postovi: 8

Pharan

Ok. Temporary fix for you.
Go to line 264 of SkeletonRenderer.cs.
https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-unity/Assets/spine-unity/SkeletonRenderer.cs#L264

Replace that line with this:
bool mustUpdateMeshStructure = true; //CheckIfMustUpdateMeshStructure(stateTemp.attachments, stateTemp.attachmentsFlipState, stateTemp.addSubmeshArguments);
Note that this is extra performance cost, but arguably not by much compared to the current clubhouse-sandwiching of your atlasing.
We can discuss how to address that in another thread, but I do hope you don't have untrimmed images on your zombies too. This matters especially if you have multiple instances of this type of setup.

We might take a while to get an optimized fix SkeletonRenderer officially to handle the bug you discovered, but that temporary fix above should work well.
Avatar
Pharan
  • Postovi: 5366

prog112

Hmm they are untrimmed because you realise I have multiple armors and will have dozens more in the future so that's why I need those images little bit bigger so that other powerful armors will fit into the same image and not get displaced because of the different resolution.

The fix works, thanks!
prog112
  • Postovi: 8

Pharan

That's not a problem. You can switch between attachments of different sizes if you need armor or weapon parts that are bigger or smaller. You just need to make sure you resize by adding an equal number of pixels to all four sides and it will keep the pivot. You can also resize it any way you want import them in Spine to find out the correct pivot/offset to use.

Are you using Spine Essential?
I seemed to be able to fix the problem pretty easily by trimming the atlases naively but this isn't actually possible if you're using meshes. If you're using meshes, you need to trim them BEFORE you make the meshes.

You should know also though that your animation is doing some other weird thing. (the flickering is happening with the weapons, and this is actually because of the actual animation data.)

I think you didn't want to key the weapon attachments here. If you remove all those keys, the flickering should go away.

Avatar
Pharan
  • Postovi: 5366


Natrag na Unity