Update 50


On this animation taken from the game, you can see the frame rate in red and the green squares are the collisions (quite useful for debugging).

Here is the door animation for the second level, the movement is not very smooth because there are only 5 images for the animation. Can’t you use more than five images? Will it be smoother with 10 images? Yes with 10 images it will be good, but there is a price : VRAM space and loading time.  For 5 images I need to use two 2048*2048 textures so with 10 Image I need to use four 2048*2048 textures, the first texture can only contain 2 images because the static part of the map is also stored. 4*2048*2048 = 4096*4096 texture just for one map which is quite big for an animation. You can also see I have put the door on the left side of the map and not in the center for a reason.



This explains why in 2 games most of the animations are small because if the character or the object is 100*100 pixels you can put 20*20 = 400 images in 2048*2048 textures so you can have an animation for every attack something like that:


For  big animations, you can use a video but again the price just for 2 or 3 seconds of animation is expensive in term of loading time. Even with all the progress made in computer science, there is still limits because the memory is still finite. And if you use a resolution large enough you can fill up the memory pretty quickly, even with one animation!

Leave a Reply

Your email address will not be published. Required fields are marked *