![]() |
Animated tiles?
Will it ever be possible to have some sort of feature to allow tiles to be animated? I know it's possible now, with addtiledef+gif, but that slows it down when there's a lot of animated tiles on the screen.
I guess it would be better if handled from whatever draws the tiles, so maybe a new addtiledef that would allow dividing up an image into frames for an animation. Like, addtiledef3(image.png,levelblah,addintotilesX,addi ntotilesY,framecount); And what it would do is divide the image according to how many frames, and animate it via the tile drawing, instead of by just showing a gif. |
Framecount, wouldn't that be in the image itself? - or you mean the delay before it's re-repeated?
Very nice suggestion!! |
1 Attachment(s)
Well it'd be more of the number of times to divide the image.
Say, in this example. You have 4 16x16(a 32x32 block) tiles that animate(maybe water tiles), and the water has 3 frames of animation. You'd tile each frame of the animation horizontally, save it, and do: addtiledef3(watertiles.png,world_,0,80,3); And it would animate the tiles through Graal, and not by just displaying a gif. Much like it does with the flower tiles, though a bit different as each frame won't have to be stored in the tileset image. The size of the image would look akin to the one attached. |
This would be a nice edition. I have animated water tiles through an image, but it lags like crazy. So I have to space them out :(
|
Oh, you mean the way flowers are animated?
Yeah, having some control over that would be nice. |
Ya, sort of like that... except you wouldn't have to include the animation frames in the tileset image. It'll get all the animation frames from the new tile image.
|
Hm. I don't think that'd be any better than adding an anigif to the tileset...plus there's the consideration of "virtually extending the tileset..."
I expect Stefan will say you should either use NPCs or showimg for such things. -_-; |
Well, the difference is the animation will be handled by Graal(much like the flowers, only the frames will be taken from the image given[see the attachment in my first post], and not from the tileset), and not as a gif. Showing gif's is much slower than just jumping the tile image around, as a whole level of flowers doesn't slow Graal down a bit.
|
Great idea! I sort of do this with my tiles emulation on my server :)
|
Flower animation doesn't slow down because it's pulling from the same buffer. If you're animating from the rest of the png, I think it'd be just as slow as animating from the next frame of the gif.
|
The flower animation is a built in feature. The other flower tiles are found near the snow marsh & cave tiles. Add an addtiledef2 image over one of the flowers and it'll still animate showing the new tile.
|
The speed/lag probably depends on the speed of the animation, the flowers are only updated each 3 frames and are single tiles. Animated gifs should not be slower than normal flowers when used as animated tiles. If you have huge blocks of animated tiles then it might be more efficient to use npcs for them.
|
So, if we take animated flowers, and made an entire level on the server covered in them.
Then did the same thing with .gif/.mng flower images, the same 3 frame ones, and did the same thing--placed them all over the level, the images would be quicker? I don't understand... |
No, it depends on the number of images. Having a lot (hundreds) of separate graphics is slow, and also updating graphics is slow (huge gifs or the whole level covered with animated flower or water tiles). So there needs to be some trade-off.
For best speed do: - use tiles for static graphics including the background and small details that are repeated often - use separate npcs for graphics that are supposed to move or animated or change often or should appear on top of players |
| All times are GMT +2. The time now is 05:54 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.