2D Toolkit Forum

2D Toolkit => Support => Topic started by: ComputerNerd on October 01, 2016, 12:58:46 am

Title: Sprite Collection corruption
Post by: ComputerNerd on October 01, 2016, 12:58:46 am
Hi,

Over time, my Sprite Collections become corrupted.  I am unsure how this happens as I do nothing extraordinary.  I don't even notice that something is wrong until I see that the sprite is no longer working so I can't pinpoint when and how it actually happens.  I was wondering if you had some ideas on this, why it may happen, and how to fix this without recreating the whole sprite collection and sprite animations.

It seems to gradually infest all of my sprite collections at some point.

(http://i.imgur.com/idrQHAR.png)

As you can see, this sprite sheet frame is connected to the wrong sprite.  On most spritesheets in this corrupt collection I am unable to click on a frame at all in the Sheet's middle view where it groups them all.

If I click on Config->Apply, it creates a second set of sprites, as so:
(http://i.imgur.com/ldYQojn.png)

This isn't ideal since I lose important data like anchor points.

Oh, the sprite animations connected to these corrupt sprite collections also become corrupt.

(http://i.imgur.com/muElyKv.png)

Any way to easily correct this?  Thanks!  I am using 2.5.4.
Title: Re: Sprite Collection corruption
Post by: unikronsoftware on October 02, 2016, 03:06:12 pm
Do you use version control? The easiest way to track this down will be to compare the 2 assets to figure out what's changed. I've not seen this happen before and I've not heard this bug report, would be good to figure it whats happening here.
Title: Re: Sprite Collection corruption
Post by: ComputerNerd on October 05, 2016, 10:40:39 pm
Hi Unikron,

I've rolled back to a version that is working and have been able to recreate the problem.  I'll recreate the steps in picture form.

Normal sprite sheet, everything looks ok:
(http://i.imgur.com/A9gjRDT.png)

And it matches the sprite:
(http://i.imgur.com/Fum3E1i.png)

I Delete this sprite sheet because I do not need it anymore:
(http://i.imgur.com/2yWcc5B.png)

Now what was the normal sprite sheet is now broken:
(http://i.imgur.com/yKp53mG.png)

The broken sprite:
(http://i.imgur.com/Qhx7myN.png)


You'll notice that the Sprite Id changed in both the Sprite as well as the sprite sheet, however they changed to different values.

This is in 2.5.4.

Thank you,
Brian
Title: Re: Sprite Collection corruption
Post by: ComputerNerd on October 05, 2016, 11:59:38 pm
I just created a new Sprite Collection fresh to try it again.

Added just three sprite sheets of two sprites each.  Committed.  Saved the scene.  Checked-in.

Went back to it and deleted just the first sprite sheet.  Committed.  Saved the scene.

And it broke.  Clicking in the red circle area does nothing.  If I hit Config/Apply, it will duplicate the sprites.

(http://i.imgur.com/QZs753L.png)
Title: Re: Sprite Collection corruption
Post by: ComputerNerd on October 06, 2016, 02:00:09 am
Mistake on my end.  It's fixed.