Gdevelop mixing animation sprites with other objects

Has anyone noticed Gdevelop confusing the animation sprites of objects from time to time?

For example, I have the below eggs.

You can select them, in order to hatch dragons from them etc.
The eggs are part of a Global group called Dragons and all of their animations share the same names in order to change them without additional hassle when you select a character.

For example
Blue dragon

Pink Dragon

.
.
.

Now I have over 10 eggs in this scene that works fine, however when I click preview this bug occurs.

image

As you can see the pink egg (Top left) is confusing its Idle animation with the idle animation of the blue egg below it.
This makes no sense to me, as the blue egg sprite isn’t even registered in the animation panel of the white egg. Neither do I have an event that for example, creates the blue egg at this position.

This bug occurred to me one more time some weeks ago in my other game but I ignored it since it was probably my fault for deleting an asset from the game’s folder while I was working on it in Gdevelop. However this time I added the sprite files like I usually do, without deleting anything so I have no idea why it happened. Previously to fix this, I had to delete the bugged object, along with all of its sprites, and import them again.

Maybe it has to do with the way I store my assets? But if this is the problem, why does it occur only occasionally?

This is how I sort everything.

Main game folder and the subfolders

Every dragon has its own folder

image

And a folder for their specific animations.

.
image

For example the folder Egg of Emily includes the pngs for the egg animation

If I check on Gdevelop Resources panels, the eggs are indeed getting their sprites from their specific paths. So yeah I have no idea why this happens. Perhaps a visual bug?

It sounds a strange that you fix it by deleting and importing the images again.

Can you post screen snips of the events that control the egg animations in case there’s something in those?

1 Like

It’s happened to me a couple of times too. It’s true, the only solution is to delete the animation and import the images into a new animation. I also had to change the name of the file (image) I was importing, because the error still persisted on some occasions.

1 Like

GDevelop does not support subfolders in general other than just the asset subfolder. They’re not explicitly broken, just not designed around.

Any subfolders are not kept after export, either, so files that share the same filename (Even if they have unique paths) will run into conflicts.

I imagine having filenames that are both egg0001-0009/etc may be what’s causing your issue.

2 Likes

I see, thanks. That explains it. Kind of sad, I really like creating subfolders to manage my assets easily.
Guess I also just need to have unique names for all of my assets from now on :melting_face:

Still not sure why this happens on certain occasions. For example in this game most of my assets share the same name and everything was working fine till I added the blue egg dragon. Like, why now of all times?

Would also like to know how the assets are named/arranged after the export.
I was expecting issues like this to occur after you export the game since as you said that’s when the files are merged together.

For desktop OS (Windows/MacOS/Linux) builds, the names remain unchanged as far as I know. They keep their names and all are thrown into a single electron bundle (an .asar file).

For web builds they’re thrown into the main export folder with the index.html

I don’t know for sure on mobile builds.

When you preview a game, it has to throw all of the files into a single temp folder and then run it. I’d guess the issue occurs when your Desktop OS decides to not give the file a duplicate indicator (egg0001(1).jpg) and instead just overwrites.

1 Like