Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tileset import support #30

Closed
ItsSunnyMonster opened this issue Jun 14, 2024 · 8 comments
Closed

Tileset import support #30

ItsSunnyMonster opened this issue Jun 14, 2024 · 8 comments

Comments

@ItsSunnyMonster
Copy link

I apologise if there is a way to do this already.

There should be an import option that allows importing all frames of an aseprite file into Godot in the form of a tileset for use in a tilemap.

@nklbdev
Copy link
Owner

nklbdev commented Jun 14, 2024

I'm sorry, but this is impossible.
If you want to import a file for use in a tileset, import it as Texture2D.
Godot uses a sequence of cells to animate tiles.
Unfortunately I can't convert Aseprite's frames into these sequences.
You will have to manually convert your animations to these cells(((((((
image

@nklbdev
Copy link
Owner

nklbdev commented Jun 14, 2024

Maybe you want something different?
For example, do you want to get a spritesheet from Aseprite's regular animation?
image
Then try importing this file as Sprite sheet (JSON).
image

If you use the experimental Importality branch, in which the image is saved as PortableCompressedTexture2D, then you will only get a JSON resource, without the image itself. Sorry. It will be fixed in future.

But if you use the main Importality branch, then you will get a PNG image next to the aseprite-file. That's what you need!
And if you load the imported JSON resource from code, you will get all information about frames and tags you need.

@ItsSunnyMonster
Copy link
Author

Thank you for your response!

Sorry I wasn't clear enough with my issue,

I don't need the tileset to be animated. What I have is an aseprite file where each frame is a 16x16 terrain tile and I want to import it as a tileset which can be used in a tilemap.

@nklbdev
Copy link
Owner

nklbdev commented Jun 15, 2024

Yes, that's a good approach! I started developing this type of import.
Do you want to import this file as PortableCompressedTexture2D? It will contain metadata about all the tiles in it and the animations that you can assemble from those tiles using your own code.

Now the most difficult part remains - to split the resulting array of images into sections - one for each animation.

But I can release a version of the importer without this modification.

I once made an isometric strategy game and also used Aseprite animation frames to store tiles in them. This helped me make different types of terrain with different variations for my tile mapper built into the game.
image

@nklbdev
Copy link
Owner

nklbdev commented Jun 15, 2024

Please, try to use dev-branch of this repository.

To be safe, try experimenting on a new empty Godot project.
Select Aseprite-file and select the importer for it: "Aseprite -> Sprite sheet (PortableCompressedTexture2D)".
Try experimenting with the import settings.
You will get a texture that has meta information with frame and animation data.

image

P.S.:
All other importers will also create an embedded PortableCompressedTexture2D instead of a separate PNG file.

@nklbdev
Copy link
Owner

nklbdev commented Jun 15, 2024

What version of godot are you using? To use this version of the importer you will need 4.3 beta1 that includes changes from 4.3 dev2 (changelog) that includes two my pull-requests:

  • 86835 Fix data format storage method for PortableCompressedTexture2D
  • 77712 Fix lossless formats in PortableCompressedTexture2D

Without them, the importer will not be able to create PortableCompressedTexture2D.

@nklbdev
Copy link
Owner

nklbdev commented Jun 29, 2024

@ItsSunnyMonster, please tell me, have you tried the new version of the importer (see posts above)? Did it give you the result you wanted?

@ItsSunnyMonster
Copy link
Author

Hello, sorry for not responding sooner. I have been quite busy recently and I had no time to try this. I will close this issue for now and maybe reopen it once I have the time to come back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants