deepnight / ldtk

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

Feature Request: Animated Tiles #119

Open nion-ne opened 3 years ago

nion-ne commented 3 years ago

Highly impressed from what's been done already, particularly the elegant UI and how modern everything feels.

Animated tiles is a core feature that is missing for me personally. A parameter to set in milliseconds the rate of each frame would be great as well.

Thanks and keep up the good work :)

RPGillespie6 commented 3 years ago

I was thinking of creating an issue for this, and I think a potentially more generalized solution is:

Basically, it would be nice if you could add metadata to the tileset and/or individual tiles in the tileset the way you can with entities (Tiled allows you to add metadata to individual tiles). That way you could attach arbitrary metadata to tiles to signal to your engine how to build animations, how long each frame should last, etc.

A few edge cases to consider: image

Note how with some animations each frame fits within a 16x16 tile, but in other animations (such as the door at the bottom), a frame is composed of 6 tiles. The way I do it in Tiled is to designate the top left tile of the first frame of the animation as holding all the metadata for the animation. There may be a more elegant way to accomplish this, however.

nion-ne commented 3 years ago

I like the idea of per-tile custom metadata, especially for roles or workflows that entities don't already fill. I would argue that a benefit of directly supporting animated tiles would be that you could preview the result directly in the editor, whereas a metadata approach would be static.

In either case I think it definitely deserves its own issue raised.

RPGillespie6 commented 3 years ago

Yes, I agree an animation previewer would be nice as Tiled's is very lacking (as you said, might need to be a separate issue).

And I don't necessarily like the way Tiled does things. I would love if L-Ed could have first-class animation support, where tileset menu has animation building tools (selecting frames, defining timing per frame, etc.) and animation metadata gets its own object inside the tileset object, for example. Per-tile metadata may be a decent workaround/stepping stone to first-class animation support as it's better than nothing (right now it doesn't seem like there is a good way of adding animation metadata to tilesets within L-Ed).

nion-ne commented 3 years ago

I tend to agree that Tiled's animator does feel a cumbersome, it's partly the reason i'm so drawn to L-Ed and how "flowy" it feels in comparison. I guess it depends on desired implementation but I do feel animated tiles to be a core feature of any modern tile map editor and probably ought to be supported as such. hmVYMZ4 Being able to have something like this visible within the editor and able to be paused/played on command would cover 90% of user use cases I feel.

Anything beyond that would be covered under an individual (or group of?) tile's metadata if desired. Happy to contribute to a discussion on that if you want to open an issue :)

Gerolmed commented 2 years ago

Is there any plans on adding animated tile support any time soon? This is basically the only blocker stopping me from using this great tool

deepnight commented 2 years ago

Right now, animated tiles are not on short-term roadmap (ie. 1.0 version) as I still have a long list of core features to be done, but I'd like to add them at some point though :)

airtonix commented 2 years ago

I'm building an LDtk loader for excalibur.js and the way I'm planning to support animated world prop entities is using a tile array fieldset on the entity. image

Perhaps the tileset could allow fieldsets for each tile to provide the same interface?

Inateno commented 1 year ago

Hey! Just discovered ldtk and I'm impress it feels very good. At the moment we do use Tiled, and I wanted to try the change.

But, we can't because we handle all our animations/hitbox and all inside Tiled which as a "quite complete" feature to setup animations with points, boxes and whatever.

Is this is a thing planned or not ? Sounds like a lot of work tho.

Thanks

deepnight commented 1 year ago

Hi! For now, animated tiles are not on short term roadmap. If they happen in LDtk, it will probably be only simple animations anyway.

However, I'm not sure of what you were looking for? If you were talking more about paths and moving objects around them, you may use the existing Entity fields, such as Points or References, to define such paths. You will not have visual movements in LDtk, but you will have a way to define them in editor, and use them in your engine.

Could you provide a clear example of the feature you are looking for? :)

Inateno commented 1 year ago

I understand and there is no problem for not being on short term roadmap. I was very pleased and excited by what I tried in 5 minutes.

Here's what I am talking about. image

We can edit many animations and by code getting the array of frames. For each frames we will have the information about boxes or others, also points, this is useful for the gameplay and can be easily edited by any "non-dev" people (it's also more convenient).

Also, after talking about it with the team, maybe the problem is that we use Tiled for "everything UI/visual related" and if we had a dedicated animated/collider editor it would do the job.

But it is quite pleasant and easy for us to use one software for everything with one single file format to read.

deepnight commented 1 year ago

I see, thanks for sharing.

If animations were to be done in LDtk, I would probably only focus on animated tiles, like for example:

The feature wouldn't be meant to be anything else. So in this case, it wouldn't be a generic asset manager to define visual fx, or player animations.

digiwombat commented 6 months ago

Congrats on the 1.5 release. Just wanted to do a check in and see if animated tiles might make it onto the roadmap. I am only really interested in it as you laid out, for water tiles and animated flowers and the like.

KristoferPaul commented 4 months ago

Animated tiles would make TLDK the goat for sure. Right now it's still competing with tiled. :o Well, that and collisions that can import into GDev.

RMDB-GD commented 4 months ago

me 2 dreamin for a gdevelop full compatibility (..aehm..collisions)..

TLINDEN commented 3 months ago

I'd propose this: there's already a way to add an array of tiles to an entity as outlined by @airtonix. However, this has to be done for each and every entity placed on the map. I'd rather have the possibility to pre-populate this tile array in the entity definition, so that all entities placed will have it.

Would that be possible?

seivan commented 1 month ago

I'd propose this: there's already a way to add an array of tiles to an entity as outlined by @airtonix. However, this has to be done for each and every entity placed on the map. I'd rather have the possibility to pre-populate this tile array in the entity definition, so that all entities placed will have it.

Would that be possible?

I second this. Having the tile set itself have the definition for animation as opposed to individual entities placed on a map is almost necessary.

Cammin commented 1 month ago

Here's how I implemented animated tiles for my unity importer:

The text editor for tileset tiles works well for this! So I define data for how the importer should parse it to make animated tiles!

https://cammin.github.io/LDtkToUnity/documentation/Topics/topic_AnimatedTiles.html

image