-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Animated Tiles #57
Comments
As far as I am aware, nobody uses animated gifs for animated tiles, apart maybe from some really rare browser games (that don't use canvas but some HTML table or CSS to lay out gifs on a grid?). So while that may be a nice gimmick, the primary goal of this feature would be to find a good way to define an animation as a sequence of tiles from a tileset and a way to store that in the TMX format. |
Do you need the animations to appear inside the editor? Otherwise you can just add them automatically while doing the map format conversion to your game. |
@Storyyeller I think this feature is mainly about having a convenient user interface that allows you to define and preview the animation. Actually showing them while editing would also be nice, but that could also be annoying so then there needs to be a pause button or something. :-) |
I guess an animation should be simply a sequence of tiles picked by the user, cycled in a millisecond interval specified by the user. Probably one could choose specific tiles in a tileset that make up an animation, and they would disappear as separate tiles from the tile picker, and just merge to one single animated tile. This could be done by having a "compose animation" button which then allows to select multiple tiles in the tile picker, and having a "complete animation" button which then removes all those selected tiles (they could simply become blank/unselectable) and leaves only the first, displaying it now animated with the given settings. If the new animated tile is selected, another "dissolve animation" button could allow to expand the tiles again to their individual original tiles. All of those buttons would be part of the "Tilesets" window and become greyed out when not applicable. This approach would not allow tile animations with varying speed transitions between frames, frames from multiple different tilesets or using the same tile for multiple animations. But on the other hand, it would be relatively easy to implement, so I believe (and would also be easy to use). |
Well and there should be an animation speed input (text box or slider or something) which shows up during the compose animation step or when an animated tile is selected. |
Full control with sensible defaults would be preferred (at least by me) thus a new window would be the best bet. As for tile removal: tiles shouldn't be removed from the tile picker unless the user wants them to. |
I started implementing this feature. This is generic, but not very usable. (Or a good properties editor would be needded) |
I would prefer inside tiled for the sake of simplicity (wouldn't need another tool to be located, installed etc). But it doesn't really matter. |
Since gif is color limited, I created a specific animation format for 2d games: http://devnewton.bci.im/projects/nanim The tools I wrote are in java, but the format specification is made with protobuf so a C++ parser can be generated with zero development. Note, that it is not a simple apng/mng/fli/flc alternative: it is made for being used with texture packing, so it could also be usefull for #286 |
working version. Closes mapeditor#57.
Stefanbeller its nice to see someone has already given this feature some attention i was recently trying to find a way of specifying animations in Tiled in a simple manner. Currently, the only way i see fit is to specify a number of properties as you have pointed out yourself - but this is far from ideal. Bjorn, do you think this could possibly be included in the next release? |
working version. Closes mapeditor#57.
I rebased my attempt to the latest tiled version of bjorn. |
working version. Closes mapeditor#57.
Couldn't animations be integrated into the tmx format in some way? Using properties is a bit heavy, even if working, isn't it? (Yes, I'm also interested by that feature ;D) |
Well, the main goal of @stefanbeller was to support the animation properties used by The Mana World. Of coure I agree that a better integrated solution would be nicer. |
@bjorn I'll join you on this point, even thinking that if a common and official format for animated tiles could be integrated in the tmx format specifications, it would be TMW to adapt itself to those, along with other projects (such as mine ;]). I could almost bet on it. |
@stefanbeller @bjorn Do you think we could define a common spec for animated tiles here? Maybe you even got something done? |
If tiled implemented sprite sheet animations could be defined based off of the animation sequence in the sprite sheet. these are all idea's but if you look at other software that does similar functions as tiled allot of them are using common sprite sheets. |
@Disk1of5 Could you refer to those tools so that we may have a look at them? Also what is a "common sprite sheet"? I've seen sprite sheets take on many different forms, both regarding how to store the images (individually, on a regular grid like a tileset or on a packed texture) and how to store its animation (in the code or with XML files in various formats and with various different features). |
This feature can be very simple and it can be very complicated, depending on how far we want to take it.
<tile id="...">
<animation>
<frame tileid="..." duration="..."/>
<frame tileid="..." duration="..."/>
...
</animation>
</tile>
We can't implement all these features immediately, but ideally we should make sure that such extensions could in theory be made later without breaking backwards compatibility. And btw, most of the effort here will probably be in the UI, allowing the animations to be set up and changed, all with full undo/redo support of course. Saving/loading and animating a bunch of tiles is peanuts compared to that. |
@bjorn Hi :) |
@bjorn Well, I tried it. Loading/sabing tmw files with animated data is just here and done. :) Best regards, |
@Bertram25 Right, sorry I should have written a little manual. Here comes the tiny manual:
If you have placed the tile you're editing the animation of on the map, you should see the animation playing there automatically and it will update as you change it. |
@bjorn My bad, I should have seen it. It was rather obvious after all. :) Tried it, and it's working great so far. (I didn't try exporting animated tiles data in something other than the tmx format yet.) If you wanted feedback basically, here is some:
Best regards, |
@Bertram25 If you're using Linux, depending on your desktop environment you might be able to right-click the window and select "always on top". @bjorn Everything seems to work well for me so far! I know I'm testing this pretty late, so I hope my input is useful somehow anyway. The animated tiles get out of sync for me while I'm editing. I suppose this is inevitable if you have animations whose durations never align, but it might be nice to have some sort of "reset timing" option. I guess an example of where this might be useful would be if you have a terrain that's an animated shoreline, and the various tide frames need to sync up. |
Already did. :) Yet, I am sure there is an OS independant solution to this. |
Excited for this feature! Notice it was added to the |
@englercj The milestone is just for organizing the release, and there's some smaller things still to do on this feature before the release hence I added it there. However, this feature is already available on the master branch (and the daily builds), so please try it out! I can't give ETA on things that rely on my spare time. My last goal was to get 0.10 out in August, but it's currently looking like I'm not going to make it. |
Alright, animation preview pushed in 48fdd68. With that I'd like to close this task rather than keeping it open until it's perfect. @Bertram25 I know I didn't get around to the "animated tile" marker change you suggested, but I hope you don't mind I'll keep that as a possible future enhancement and focus instead on getting 0.10 out. @Clean3d Thanks for your feedback and indeed the thing with animations getting out of sync bothers me as well. I'll have to think of some solution for this later as well. |
Np. This isn't important. |
Hi @bjorn , I am very happy to see this feature rolled out in the last update. Thanks a lot. |
@sudhalucky Sorry but I don't have time to help you with that. This is something you have to talk to the cocos2d-x developers about. The feature is very new so it is understandable that cocos2d-x does not support it yet, and since it's not based on custom properties but adds new XML tags to the TMX format, support for this will have to be coded explicitly. |
@bjorn Thank you for your instant reply. However I observed one issue in the tool, once a tile is added to the animation list there is no way to remove the tile in the UI but to delete it from the XML by manually editing, I hope you are already working on this. Sudhaker |
@sudhalucky Hmm, you should be able to select frames in the list and press the Delete key to remove them. Is this not working for you? If not, on which platform? |
Hello, See my animation format: http://catchchallenger.first-world.info/wiki/Map_format in some case I need random offset to prevent all tile start at same animation level. Cheers, |
@alphaonex86 Well, trigger could already be done by a custom property, but at the moment you can define only a single animation per tile. So if you want separate animations for opening and closing, in Tiled you may define this as one animation and then use custom properties to indicate when to play back which part of the animation. |
|
I would really like to have multiple (named) animations on one tile, this is especially useful for objects, since these might change their animation during the game.
It would be great to have all these animation specifications in a single place, and I think the Tiled file would be an excellent location. For the time being I will probably create each animation on the starting tile and add the names as custom properties. |
@Rialgar Yes, it's a feature that could be added. Maybe you could open a separate issue about it? |
Hello, apologies on commenting on a very old and closed issue, but I am genuinely wondering if there's a more efficient way of defining tile animations, other than selecting a tile, choosing "tile animation editor" menu option, drag and drop tiles, repeat. My tile set has above 100 tiles, with each tile has its own animation. It does become a bit tedious going through the GUI to do the animation for all tiles. The frames are put vertically on top of each other in a sprite sheet, so potentially could I manually edit the .tmx file with a text editor to add the animation myself? Or is there a better way to do it? |
Tiles should easily be animated.
Either by using an animated gif or other animated format.
The other option would be to cycle through some tiles within one tileset.
The text was updated successfully, but these errors were encountered: