Animation frames keep changing order

I have some enemies in my game that keep resetting their animation frames. I duplicated some frames and moved them to a later part of the animation to create a reversing effect, and the order keeps changing back to how it was right after I duplicated them. It doesn’t matter how many times I save, make a new copy, overwrite the old frame order, and even changing the actual frames with extra useless ugly pixels didn’t work. The similar frames keep getting stacked next to each other no matter what I do. It’s completely ruining my animation, and it’s happening over and over. It’s incredibly tedious to fix, and keeps breaking itself without me doing a single thing to that enemy. What is happening and how do I fix it?

Can you screen snip the events that set the enemy animation frames? All of them.

It’s most likely that you’re setting the animation twice, first to one animation, and then the actual one you want.

So it’s nothing to do with events. It’s literally changing the order of my frames. I keep having to go into piskel and put my frames back in order.

The code for this works flawlessly. The problem is I’ve copied one enemy into 3 enemies with slight changes, and I’m realizing that’s a huge mistake because editing one changes the other unless you save a new copy in piskel, but then it still sometimes messes up the other 2 when I change one.

I don’t understand. These should be entirely separate objects with different saved animations at this point, because I STARTED by saving new copies when I edited the animations each time I made a new monster. They all have different names, and have SIMILAR animations because I re-used the tentacle animation at the bottom of the sprites, but I’m stuck with all this work done that keeps reversing itself now.

What’s worse, I even looked in the file maze to try and figure out why this was happening, as well as save a backup copy… And it’s got every single enemy’s sprite animation saved under the name of the template enemy I built it on. Three different enemies with distinct different names, and the idle animations are all saved as Fly_1 through Fly_61 in the files. No wonder the software gets confused. the order is all over the place too, the newest idle animation is numerically scattered inside an old one… As in the file name skips over numbers in no distinguishable order or pattern.

I think I just need to make new objects from scratch, copy over the animation frames, and never use the copy feature again after that.

Hopefully the 7th time will be the last time I rearrange every single frame.

Also none of this explains why it would keep duplicating and re-sorting my frames over and over after I’ve repeatedly saved the correct amount of frames in the correct order.

Ah, my bad, I misunderstood. So it’s happening in the editor.

To be clear…

  • You duplicate the enemy object
  • Then go into Piskel
  • Modify the sprite
  • Before hitting “Save” on Piskel, you go to the top left corner of Piskel and change from “Overwrite” to “New”
  • Hit “Save” in Piskel
  • Hit “Apply” on the object editor
  • …and now the frames order gets messed up?

…are you sure your changing to “New” instead of “Overwrite” each time you use Piskel?

Im not saying there might not be a bug… im saying i still do this from time to time if im distracted while working… stuff happens you know? :slight_smile:

The first time or so I hit Overwrite, but it’s definitely happening when I click New as well. Something about copying them messes it up really bad.

For example, on the newest variation of these similar monsters, I created the entire idle animation. It’s basically the same idle as all variations, except the head looks different. Made the change, saved as new version, and it’s an even different problem this time. I have 13 copies of one frame and I’m missing the other half of my remaining frames. At this point it appears random.

I’ve also tried alternating between a cloud save and a local save, so that isn’t it.

I feel this could be easily fixed by having the copy and paste features in the Objects box create a distinct new file name, or when you rename an object it changes the sprite file names as well… but it doesn’t even keep them in a discernable or sensible order in the saved folder the way it’s doing it now. Those 18 idle frames are scattered between the files names “assets_Fly_6” and “assets_Fly_60” in the local save.

I think my personal takeaway is DON’T COPY AND PASTE EXISTING OBJECTS INTO NEW OBJECTS.

You’re absolutely right about the “overwrite” thing, and I definitely did that a couple of times before figuring it out, but this is something different. It’s just saving the frames in some random jumble, and refuses to keep the order right because it’s trying to put them in some old order.

1 Like

When i have the time ill try and see if i can replicate this. It is starting to seem like some sort of bug.

What your suggesting already happens! When you make a copy of an Object, or “Duplicate” the object, it uses the exact same sprites, but if you go into Piskel and hit “New” and save, even if you dont change anything, it will create a new sprite with a new unique name.

So for example, if you duplicate an object with the sprite name “JustIdle1” and then hit new and save, a new sprite will be created called “JustIdle2”, thats why you have the same sprites being numbered from 6 to 60.

But if thats the case, then they should be unique and not cause issues… so there might be something else going on, ill have a look when i can :slight_smile:

@WabbajackSheep It took me a few tries to replicate what you were describing but i think i worked it out and found whats going wrong.

So heres whats happening… hope i can explain this right…

  • Your duplicate an Enemy Object
  • The 2 Objects now have different names, Enemy1 and Enemy2
  • Despite their names, they are still using the same asset sprites, the same file.
  • You open the object editor, duplicate the frames, rearrange the order and make the effect that you wanted and hit apply.
  • This has not made new sprites, they are still using the exact same frames.
  • If then you modify one of these frames and hit overwrite, either the copy or the original, it will change every frame thats using the same asset sprite.

I think your confusion might come from loosing track of which objects you went into Piskel and made “New” sprites and which you just used as “Overwritten”, so now its like a tangled mess, you change one thing, and all the ones that arent “New” will act weird.

Solution?

When making a duplicate object, first thing to do is hit “edit with piskel”, then change to “new” and save, do this for every animation. This will ensure that your object is now unique.

As for your current objects… do the same thing, go into each one of them, and without changing anything, “Edit with Piskel”, change to “New” and hit “Save”, then do the same for every animation and hit “Apply”. Repeat for each copy of your enemy object.

This should fix your issue. If not… then let us know :slight_smile: …i tried all the methods i could think of to replicate your issue, and this was the only thing that made it happen, hope it helps!

Right, and I learned that on my first duplication. It was left on “overwrite” the first time, but afterwards it happened again several times when I clicked “new”. You described everything right for the first time, but not the next few times it happened.

I might just be experiencing a bug tbh. I had an older copy of the enemy get messed up when I created a new idle for a new copy, and saved as new in Piskel… but it’s random how it got messed up, like only some of the frames got transferred over.

Also the previously copied enemy has double the amount of frames now for the idle, and they’re in the complete wrong order.

It’s literal hours of work that I’ve had to repeat about 5 times though, and it’s very frustrating.

I feel your pain… when i had an issue with the FlexBox extension, i had days of work to redo because of a buggy extension with a memory leak… it was painful :frowning:

…i tried everything i could think of to replicate your issue but i couldnt :frowning:

Just one more thing… @WabbajackSheep Are you using the Desktop version of GDevelop? …or the online version / app?

1 Like

I’m using desktop. I think I know how to avoid the issue in the future, it just happened because I duplicated the object instead of just creating a new one from existing assets.

If there’s going to be a fix, sadly I think it will involve taking up more storage space but that seems like a fair compromise for data integrity. I think, at the moment of duplication, the assets need to be duplicated and renamed. Better yet, maybe there’s an option for which way you want to do it.

Perhaps a dialogue box pops up that asks whether you want something like a clone or a new object from the assets. Clone would be the same thing with the same assets, and if you change one it edits the other. New object would start exactly the same, but every edit is unique only to the one you’re editing.

It might even be a problem with piskel. To be honest, the overwrite thing set to default is good for the most part, but a real pain when you’ve just duplicated an object.

Another temporary fix might be to just make a new save of every animation the moment you copy an object.

One of the key features of this glitch happening, was that my animation has frames duplicated from the middle of the animation outward.

Like this - suppose it was exactly 16 frames. Frames 8 and 9 were identical, frames 7 and 10 were identical, frames 6 and 11 were identical, frames 5 and 12 were identical, and so on.

Each duplicate frame was created by copying of course. It appears to play forward, then backward for the full loop. All of the duplicated copies also do this, because they have the same tentacle animation doing that.

Might have something to do with the glitch.