deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.36k stars 184 forks source link

Can't read Aseprite v1.3.5 (beta) file format #1082

Open kennedy0 opened 6 months ago

kennedy0 commented 6 months ago

Platform: Microsoft Windows [Version 10.0.22621.3155] LDtk Version: 1.5.3-64bits (build 473703) Aseprite Version: v1.3.5 (This is the v1.3 Beta version on Steam)

Problem Description: When creating a new tileset from an Asprite file saved with Aseprite v1.3.5, LDtk fails to read the file.

Steps to Reproduce:

  1. Create a new LDtk project
  2. Create a new tileset
  3. In the File Open dialog, select an Aseprite file save with Aseprite v1.3.5 and click Open
  4. An error message will appear saying "Warning, Couldn't read file":

image

Test files: ldtk_aseprite.zip

Workaround: Reverting to Aseprite v1.3.2 and re-saving the file allows it to import.

There is no extra information in the log that I could find related to the problem:

[BOOT]         2024-03-09 12:55:59   App started
[BOOT]         2024-03-09 12:55:59   Version: 1.5.3-64bits (build 473703)
[BOOT]         2024-03-09 12:55:59   ExePath: C:/Users/andrew/AppData/Local/Programs/ldtk
[BOOT]         2024-03-09 12:55:59   Assets: C:/Users/andrew/AppData/Local/Programs/ldtk/resources/app.asar/assets
[BOOT]         2024-03-09 12:55:59   ExtraFiles: C:/Users/andrew/AppData/Local/Programs/ldtk/extraFiles
[BOOT]         2024-03-09 12:55:59   CWD: C:\Users\andrew\AppData\Local\Programs\ldtk\
[BOOT]         2024-03-09 12:55:59   Display: 2560x1440
[BOOT]         2024-03-09 12:55:59   Args: soloValues=[], args=[]
[FILE]         2024-03-09 12:55:59   Loading settings from C:/Users/andrew/AppData/Roaming/LDtk/settings...
[BOOT]         2024-03-09 12:55:59   AppZoomFactor: 1
[BOOT]         2024-03-09 12:55:59   Calling appReady...
[UPDATE]       2024-03-09 12:55:59   Looking for update
[BOOT]         2024-03-09 12:55:59   Start args: path=null levelIndex=null
[BOOT]         2024-03-09 12:55:59   Loading Home...
[GENERAL]      2024-03-09 12:55:59   Page started: page.Home()
[FILE]         2024-03-09 12:55:59   Loading page template: home from C:/Users/andrew/AppData/Local/Programs/ldtk/resources/app.asar/assets/tpl/pages/home.html
[DEBUG]        2024-03-09 12:55:59   samplesDir=C:/Users/andrew/AppData/Local/Programs/ldtk/extraFiles/samples
[SAVE]         2024-03-09 12:56:06   Preparing project saving: C:\Users\andrew\Desktop\ldtk_aseprite\project.ldtk...
[SAVE]         2024-03-09 12:56:06   => PreChecks...
[GENERAL]      2024-03-09 12:56:06   Progress created.
[GENERAL]      2024-03-09 12:56:06   Progress started: : "Preparing levels...", 1 operation(s)
[GENERAL]      2024-03-09 12:56:06   Progress completed: "Preparing levels..." (0s)
[SAVE]         2024-03-09 12:56:06   => SavingMainFile...
[GENERAL]      2024-03-09 12:56:06   Progress created.
[GENERAL]      2024-03-09 12:56:06   Progress started: : "Saving main file...", 2 operation(s)
[SAVE]         2024-03-09 12:56:06     Preparing SavingData...
[SAVE]         2024-03-09 12:56:06     Writing C:\Users\andrew\Desktop\ldtk_aseprite\project.ldtk...
[GENERAL]      2024-03-09 12:56:06   Progress completed: "Saving main file..." (0s)
[SAVE]         2024-03-09 12:56:06   => Done...
[SAVE]         2024-03-09 12:56:06   Saving complete (project.ldtk)
jbvovau commented 6 months ago

Same problem here, can't work anymore with Aseprite 1.3.5 and Ldtk 1.5.3

SnareChops commented 5 months ago

For the workaround, now that the main Steam release is the 1.3.5 version, you can change which version you want installed by right clicking on Aseprite in your library, choosing "Properties" -> "Betas" -> "V1.3 - Previous Aseprite 1.3" to rollback to 1.3.2.

niedzielski commented 5 months ago

I had a similar error trying to use tilemaps (#479). As soon as I changed my layer from a tilemap to a standard layer, LDtk v1.5.3 seemed to work with Aseprite v1.3.5. Tile positions and IDs appear to be consistent within Aseprite so long as one doesn't delete or move them. Unfortunately, the Aseprite "packed" output doesn't appear to be ordered by ID so I'm unsure if it's stable. It may be possible to write an Aseprite script to generate a stable PNG output that LDtk can read.

niedzielski commented 5 months ago

Exporting by rows optionally with a fixed width appears stable.

deepnight commented 5 months ago

This should be fixed with this commit I made in ase lib: https://github.com/deepnight/ase

I requested a merge to the official version: https://github.com/miriti/ase/pull/4

xThuby commented 4 months ago

For the workaround, now that the main Steam release is the 1.3.5 version, you can change which version you want installed by right clicking on Aseprite in your library, choosing "Properties" -> "Betas" -> "V1.3 - Previous Aseprite 1.3" to rollback to 1.3.2.

Seem like aseprite devs just removed this beta from the steam version. RIP

deepnight commented 4 months ago

Aseprite 1.3.5 support was fixed here: https://github.com/miriti/ase/commit/9e15258b97736490212a4f660c17d88e7b150b87

It will be part of LDtk next fix