For an idea I'm considering to place/script several database animations set for permanent loop on the battlescreen.
However I've been warned that the default handling of animations is ineffective and slow, and that placing more than a few such animations would either require a rewrite of that code or slow down and lag the battlescreen.
For my idea to work, I would need up to twenty such animations, and that includes animations more complex than the simple skill animations from the RTP.
Has anyone worked with such animations and can tell me some numbers on how much lag that would result, or how much work a rewrite of the animation handling would be?
There are some alternatives I can use to replace this idea, but I don't want to scrap this idea without knowing the real amount of lag, and I'm simply not yet ready to test/script such looping animations on battlescreen by myself.
As long as you keep the animation data loaded in memory, I think the performance issues are not going to be overly hefty. However, the initial load will cause some lag, depending on how large the animations are. I pre-loaded two animations for use within a hand-written introduction scene, and there was maybe a half second delay between loading the animation and the start of the scene. However, once everything was loaded ... it was silky-smooth with each animation call.
EDIT: Can some of the animations be replaced with the usage of a Plane, or a Sprite using 'wave_*' properties?
I'd be inclined to ask where this warning came from and what the reasoning is behind it.
You are asking about the real amount of lag, not just indicators based on others experience.
I'm sorry but there really is no way around what you do not want to do. Yup, conduct the performance tests. Setup with as good test as possible.
Maybe your particular complex animation actually are processed faster than normal animations?
Another potential biggie is what else is happening on the battlescreen.
Personally I still want to hear any data other scripters might have. Such data can certainly be useful :3
*hugs*
I imagine the lag might be caused by the fact that an animation can be composed of a number of frames, each with a number of sprites, each with potential zoom and opacity settings (and rotation? can't remember). I haven't looked at the script (not even sure if we have access to that part), but I'm guessing if it draws each individual image, each frame, that'd cause a bit of lag.
If you can reduce the number of images that make up an animation - by pre-composing them so they're all in the right place on a single image - I imagine that'd reduce it a fair bit.
Looping animations on the battle screen when a character was inflicted with a certain state was something that was done in XP. I can't imagine Ace's performance with animations would be worse than XP's.
When I remember correctly the main reason for lag was the way the game handles the animation images. Once the last animation using a certain animation sheet is finished, the corresponding bitmaps are disposed from memory and have to be loaded again when another animation starts.
Depending on the size of those bitmaps this can cause a noticable delay if you repeatedly run the same animation (Since animation sheets are not limited in height).
Rotating sprites is pretty time-consuming and i don't think the angle is cached, so if you are showing an animation on 8 enemies at the same time, it has to rotate a multiple of 8 sprites every frame, which could cause the lag.
lol yeah moghunter animation anti-lags is usefull when we go in big animations
but we all know more the animation is big more longer it would took to load, retrieve , execute, update and Dispose the animation in question.
so example if you use the famous animations on the whole troops....the best idea would be to use a Global animations instead of calling animations for each enemies or call a big animations and after call smaller animations on the enemies for reduce the lags..this a options
but after you can either have the option to Preloads the Heavier animations before entering battles so maybe this could simply reduce a little the lags
by keeping them in memory so they will not have to reload them each time you call them who can be the one part who can somewhat reduce the lags