About animations / Acerca de las animaciones

In these previous days, a person came with a dubt about mixing animations. Two different animations, in two different objects, mixing sprites.

The ideas came an go. Change the animation names, change de folders and so on. In the end, it was the file names, duplicated but in a different folder, what was making the bug happen.

Not sure if everyone is aware of this, or if it is common knowledge that we don’t got before; but it may lead to weird bugs if not documented, or corrected.

Different animations, for different objects MUST MUST HAVE EXCLUSIVE NAMES. Player_walk.png, Enemy_walk.png so the software doesn’t get conffused. Maybe it is due the way Gdevelop handles the files when you compile your game, as it loses the folder structure and is saved in the root folder of the game.

En estos últimos días, una persona llegó con una duda acerca de animaciones mezclándose. Dos animaciones diferentes, dos objetos diferentes, mezclando sprites.

Las ideas fueron y vinieron. Cambiar el nombre de las animaciones, cambiar el nombre de las carpetas, y demás. Al final fueron los nombres de archivo, duplicados en diferente carpeta, lo que hacía que sucediera el bug.

No estoy seguro si todos lo saben, o si es conocimiento comun que nosotros no teníamos; pero puede llevar a bugs extraños si no se documenta o corrige.

Animaciones diferentes, para objetos diferentes DEBEN TENER NOMBRES EXCLUSIVOS. Jugador_caminar.png, Enemigo_caminar.png así el software no se confunde. Tal vez se deba a la forma en como Gdevelop maneja los archivos cuando se compila tu juego, ya que se pierde la estructra de las carpetas y se guarda todo en la carpeta raíz del juego.

I know when the game is compiled to HTML5 all the assets are dumped into the main directory with no file structure.

Besides simplicity, is there a reason @4ian that they don’t retain their file structure?

The problem is that Gdevelop doesn’t takes the folder structure, even before the game is compiled.
The person pointing this bug has different sprites for different NPCs in different folders, but with the same name, and Gdevelop was mixing his animations.

I’d actually think about this the opposite way. Most compiled games from any engine doesn’t take into account project folder structure at all. Its just that most other engines have to convert assets for use with HTML5.

With GD5, it can export to HTML5 natively by just generating the js and HTML5, so it just exports it to what it considers the natural state (since the projects don’t truly expect a managed folder structure anyway, although it can support it)

Maintaining folder structure is on the trello as a future enhancement, though.

Thanks a lot for the answer. So to avoid the bug we need to be sure to use exclusive file names for each animation we will use.

I would recommend unique names for all files in your project. Yes. Even if you just preface your names with unique identifiers

Eg. Every enemy could have an attack animation, but for skeletons it would be skeleton-attack, for zombies it would be zombie-attack, etc. This ensures if you are using piskel or another system to create assets, it will give the frames unique names.

I tend to do it, like “Player_walk_up”, “Enemy_Tank_walk_left” and so on

1 Like